From 3f37f48efc9e614d6964e488a6c39801f10dfccc Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 5 Sep 2023 10:02:23 +0200 Subject: test --- build_and_test.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/build_and_test.sh b/build_and_test.sh index c61a04f..e086f65 100644 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -7,6 +7,8 @@ COMPILEPP=g++ OBJ_POSTFIX=.o EXE_POSTFIX= FLAGS= +FLAG_OBJ="-c -o" +FLAG_EXE="-o" case $(uname | tr '[:upper:]' '[:lower:]') in *darwin*) @@ -30,6 +32,8 @@ case $(uname | tr '[:upper:]' '[:lower:]') in COMPILEPP=cl.exe OBJ_POSTFIX=.obj EXE_POSTFIX=.exe + FLAG_OBJ="/c /Fo" + FLAG_EXE="/Fe" elif command -v gcc >/dev/null 2>&1; then echo "C compiler found - GCC" elif command -v clang >/dev/null 2>&1; then @@ -67,27 +71,27 @@ if [ "$COMPILE" = "gcc" ] || [ "$COMPILE" = "clang" ]; then fi else if [ "$1" = "release" ]; then - FLAGS="\O2" + FLAGS="/O2" else - FLAGS="\Od" + FLAGS="/Od" fi fi -$COMPILE -c -o "build/kit${OBJ_POSTFIX}" \ +$COMPILE ${FLAG_OBJ} "build/kit${OBJ_POSTFIX}" \ ${FLAGS} \ "source/kit/_static.c" if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILE -c -o "build/kit_test${OBJ_POSTFIX}" \ +$COMPILE ${FLAG_OBJ} "build/kit_test${OBJ_POSTFIX}" \ ${FLAGS} \ "source/kit_test/_static.c" if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILE -o "build/kit_test_suite${EXE_POSTFIX}" \ +$COMPILE ${FLAG_EXE} "build/kit_test_suite${EXE_POSTFIX}" \ ${FLAGS} \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ @@ -96,7 +100,7 @@ if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILE -o "build/test_too_many_assertions${EXE_POSTFIX}" \ +$COMPILE ${FLAG_EXE} "build/test_too_many_assertions${EXE_POSTFIX}" \ ${FLAGS} \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ @@ -105,7 +109,7 @@ if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILE -o "build/test_too_many_tests${EXE_POSTFIX}" \ +$COMPILE ${FLAG_EXE} "build/test_too_many_tests${EXE_POSTFIX}" \ ${FLAGS} \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ @@ -114,7 +118,7 @@ if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILEPP -o "build/test_cpp${EXE_POSTFIX}" \ +$COMPILEPP ${FLAG_EXE} "build/test_cpp${EXE_POSTFIX}" \ ${FLAGS} \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ @@ -123,7 +127,7 @@ if [ ! $? -eq 0 ]; then exit 1 fi -$COMPILEPP -o "build/test_signals${EXE_POSTFIX}" \ +$COMPILEPP ${FLAG_EXE} "build/test_signals${EXE_POSTFIX}" \ ${FLAGS} \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ -- cgit v1.2.3