diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-05 04:56:15 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-05 04:56:15 +0200 |
commit | 2a2b00777f312db7eb39e7d0f620c6382313a31c (patch) | |
tree | 6c0c456d1e0251eacb7cac54a9ce2ae3d6da77b7 | |
parent | 3a9e6b4869ef49b5b4c5ecb15afc9ff4572ddfbf (diff) | |
download | kit-2a2b00777f312db7eb39e7d0f620c6382313a31c.zip |
Update build script
-rw-r--r-- | build_and_test.sh | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/build_and_test.sh b/build_and_test.sh index b595cb6..00e8bba 100644 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -21,49 +21,77 @@ elif command -v clang >/dev/null 2>&1; then COMPILEPP=clang else echo "C compiler not found" - exit + exit 1 fi echo "" $COMPILE -c -o "build/kit${OBJ_POSTFIX}" "source/kit/_static.c" +if [ ! $? -eq 0 ]; then + exit 1 +fi + $COMPILE -c -o "build/kit_test${OBJ_POSTFIX}" "source/kit_test/_static.c" +if [ ! $? -eq 0 ]; then + exit 1 +fi $COMPILE -o "build/kit_test_suite${EXE_POSTFIX}" \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ "source/tests/_static.c" +if [ ! $? -eq 0 ]; then + exit 1 +fi $COMPILE -o "build/test_too_many_assertions${EXE_POSTFIX}" \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ "source/tests/test_too_many_assertions.c" +if [ ! $? -eq 0 ]; then + exit 1 +fi $COMPILE -o "build/test_too_many_tests${EXE_POSTFIX}" \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ "source/tests/test_too_many_tests.c" +if [ ! $? -eq 0 ]; then + exit 1 +fi $COMPILEPP -o "build/test_cpp${EXE_POSTFIX}" \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ "source/tests/test_cpp.cpp" +if [ ! $? -eq 0 ]; then + exit 1 +fi $COMPILEPP -o "build/test_signals${EXE_POSTFIX}" \ "build/kit${OBJ_POSTFIX}" \ "build/kit_test${OBJ_POSTFIX}" \ "source/tests/test_signals.cpp" +if [ ! $? -eq 0 ]; then + exit 1 +fi echo "Run tests" echo "" +STATUS=0 + ./build/kit_test_suite +if [ ! $? -eq 0 ]; then + STATUS=1 +fi ./build/test_too_many_assertions --quiet if [ $? -eq 0 ]; then echo "too many assertions - OK" else echo "too many assertions - FAILED (code $?)" + STATUS=1 fi ./build/test_too_many_tests --quiet @@ -71,6 +99,7 @@ if [ $? -eq 0 ]; then echo "too many tests - OK" else echo "too many tests - FAILED (code $?)" + STATUS=1 fi ./build/test_cpp --quiet @@ -78,6 +107,7 @@ if [ $? -eq 0 ]; then echo "cpp - OK" else echo "cpp - FAILED (code $?)" + STATUS=1 fi ./build/test_signals --quiet @@ -85,5 +115,7 @@ if [ $? -eq 0 ]; then echo "signals - OK" else echo "signals - FAILED (code $?)" + STATUS=1 fi +exit $STATUS |