diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-06-06 12:40:35 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-06-06 12:40:35 +0200 |
commit | ff3183ed8c292507254c06b343e24d5da3f73763 (patch) | |
tree | 33cd848adc76dd2837643fd7bb9d85eb71e4d677 | |
parent | 8bf732bb6498d9c35c4976ac65ce63c94c51d7ab (diff) | |
download | kit-ff3183ed8c292507254c06b343e24d5da3f73763.zip |
[build] run executables by full names
-rwxr-xr-x | build.c | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -35,10 +35,13 @@ enum { }; #if defined(_WIN32) && !defined(__CYGWIN__) +#define DELIM "\\" enum { OS = WINDOWS, }; #elif defined(__APPLE__) +#define DELIM "/" enum { OS = MACOS, }; #else +#define DELIM "/" enum { OS = LINUX, }; #endif @@ -419,7 +422,7 @@ i32 main(i32 argc, c8 **argv) { if (system(fmt( "%s %s " - "%s%s/" PROJECT "%s " + "%s%s" DELIM PROJECT "%s " SOURCE_LIB, compiler_c, flags, flag_obj, destination, postfix_obj) @@ -430,8 +433,8 @@ i32 main(i32 argc, c8 **argv) { if (system(fmt( "%s %s " - "%s%s/test_suite%s " - "%s/" PROJECT "%s " + "%s%s" DELIM "test_suite%s " + "%s" DELIM PROJECT "%s " FOLDER_TESTS "_exe.c " "%s", compiler_c, flags, @@ -450,8 +453,8 @@ i32 main(i32 argc, c8 **argv) { for (i32 i = 0; i < sizeof c_tests / sizeof *c_tests; ++i) if (system(fmt( "%s %s " - "%s%s/%s%s " - "%s/" PROJECT "%s " + "%s%s" DELIM "%s%s " + "%s" DELIM PROJECT "%s " FOLDER_TESTS "%s.c" " %s", compiler_c, flags, @@ -470,8 +473,8 @@ i32 main(i32 argc, c8 **argv) { for (i32 i = 0; i < sizeof cpp_tests / sizeof *cpp_tests; ++i) if (system(fmt( "%s %s " - "%s%s/%s%s " - "%s/" PROJECT "%s " + "%s%s" DELIM "%s%s " + "%s" DELIM PROJECT "%s " FOLDER_TESTS "%s.cpp" " %s", compiler_cpp, flags, @@ -492,12 +495,12 @@ i32 main(i32 argc, c8 **argv) { printf("Run tests\n\n"); - if (system(fmt("%s/test_suite", destination)) != 0) + if (system(fmt("\"." DELIM "%s" DELIM "test_suite\"", destination)) != 0) status = 1; i32 code; - code = system(fmt("%s/test_too_many_assertions --quiet", destination)) & 0xff; + code = system(fmt("\"." DELIM "%s" DELIM "test_too_many_assertions\" --quiet", destination)) & 0xff; if (code == 0) printf("too many assertions - OK\n"); else { @@ -505,7 +508,7 @@ i32 main(i32 argc, c8 **argv) { status = 1; } - code = system(fmt("%s/test_too_many_tests --quiet", destination)) & 0xff; + code = system(fmt("\"." DELIM "%s" DELIM "test_too_many_tests\" --quiet", destination)) & 0xff; if (code == 0) printf("too many tests - OK\n"); else { @@ -513,7 +516,7 @@ i32 main(i32 argc, c8 **argv) { status = 1; } - code = system(fmt("%s/test_cpp --quiet", destination)) & 0xff; + code = system(fmt("\"." DELIM "%s" DELIM "test_cpp\" --quiet", destination)) & 0xff; if (code == 0) printf("cpp - OK\n"); else { @@ -521,7 +524,7 @@ i32 main(i32 argc, c8 **argv) { status = 1; } - code = system(fmt("%s/test_signals --quiet", destination)) & 0xff; + code = system(fmt("\"." DELIM "%s" DELIM "test_signals\" --quiet", destination)) & 0xff; if (code == 0) printf("signals - OK\n"); else { @@ -529,12 +532,12 @@ i32 main(i32 argc, c8 **argv) { status = 1; } - system(fmt("%s/test_interprocess clean", destination)); + system(fmt("\"." DELIM "%s" DELIM "test_interprocess\" clean", destination)); if (OS == WINDOWS) - system(fmt("start \"\" /b %s/test_interprocess reader", destination)); + system(fmt("start \"\" /b %s/test_interprocess\" reader", destination)); else - system(fmt("%s/test_interprocess reader &", destination)); - code = system(fmt("%s/test_interprocess writer", destination)); + system(fmt("\"." DELIM "%s" DELIM "test_interprocess\" reader &", destination)); + code = system(fmt("\"." DELIM "%s" DELIM "test_interprocess\" writer", destination)); if (code == 0) printf("interprocess - OK\n"); else { |