test-container: add exec, cwd
commit4f79b3e2fb3eba003240ec38a0e68702b9a60b86
authorDJ Delorie <dj@redhat.com>
Mon, 3 Feb 2020 19:49:25 +0000 (3 14:49 -0500)
committerDJ Delorie <dj@redhat.com>
Mon, 3 Feb 2020 19:49:25 +0000 (3 14:49 -0500)
tree00831cd7fc606ec9915bbe3152b3a7cfa5f32d13
parent2db7feeb95e94b948a6a653fb61821092c7781b9
test-container: add exec, cwd

exec <path_to_test_binary> [optional_argv_0]

  copies test binary to specified location and runs it from
  there.  If the second argument is provided, that will
  be used for argv[0]

cwd <directory>

  attempts to chdir(directory) before running test

Note: "cwd" not "cd" as it takes effect just before the
test binary runs, not when it's encountered in the script,
so it can't be used as a path shortcut like "cd" would imply.

cleanup: use xstrdup() instead of strdup()

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
support/test-container.c