fix: add return code to tests

This commit is contained in:
thetek 2023-06-23 18:07:03 +02:00
parent a1b9ef6022
commit 2eda6ec549
3 changed files with 9 additions and 2 deletions

View File

@ -258,7 +258,8 @@ def run_tests():
directory.
'''
compile_executable(Compilation_Mode.Test)
subprocess.call([get_target_name(Compilation_Mode.Test)])
return_code = subprocess.call([get_target_name(Compilation_Mode.Test)])
exit(return_code)
def main():

View File

@ -22,7 +22,7 @@ main (const int argc, const char *const argv[])
t_run (test_add);
t_end_tests ();
return EXIT_SUCCESS;
t_exit ();
}

View File

@ -2,6 +2,7 @@
#define TEST_H_
#include <stdlib.h>
#include "common.h"
#include "log.h"
@ -53,4 +54,9 @@ typedef struct {
} \
} while (0)
#define t_exit() \
do { \
exit (__test_results.failure == 0u ? EXIT_SUCCESS : EXIT_FAILURE); \
} while (0)
#endif // TEST_H_