Commit 3c95fa61 authored by Kevin Locke's avatar Kevin Locke Committed by David Gibson

configurator: Use native directory separator

Although Windows APIs generally permit "/" or "\\" for directory
separators in paths, cmd.exe does not recognize "./" when invoking
executables using a relative path and prints the following error:

    '.' is not recognized as an internal or external command,
    operable program or batch file.

Therefore, use "\\" when invoking tests on Windows.
Signed-off-by: default avatarKevin Locke <kevin@kevinlocke.name>
Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent 891b43ea
......@@ -38,6 +38,12 @@
#define OUTPUT_FILE "configurator.out"
#define INPUT_FILE "configuratortest.c"
#ifdef _WIN32
#define DIR_SEP "\\"
#else
#define DIR_SEP "/"
#endif
static int verbose;
enum test_style {
......@@ -585,7 +591,7 @@ static bool run_test(const char *cmd, struct test *test)
free(output);
/* We run INSIDE_MAIN tests for sanity checking. */
if ((test->style & EXECUTE) || (test->style & INSIDE_MAIN)) {
output = run("./" OUTPUT_FILE, &status);
output = run("." DIR_SEP OUTPUT_FILE, &status);
if (!(test->style & EXECUTE) && status != 0)
errx(1, "Test for %s failed with %i:\n%s",
test->name, status, output);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment