fixed output test and reformatted CMake

This commit is contained in:
Sven Vogel 2024-05-02 10:04:00 +02:00
parent dc240acb9d
commit 138937af57
2 changed files with 15 additions and 7 deletions

View File

@ -1,25 +1,33 @@
include(CTest)
include_directories(${PROJECT_SOURCE_DIR}/src)
# ------------------------------------------------------- #
# CTEST 1
# test the default output of the logger
add_executable(logging_output ${PROJECT_SOURCE_DIR}/src/sys/log.c output.c)
target_include_directories(logging_output PUBLIC ${PROJECT_SOURCE_DIR}/src)
add_executable(logging_output
${PROJECT_SOURCE_DIR}/src/sys/log.c
output.c)
set_target_properties(logging_output
PROPERTIES
OUTPUT_NAME "output"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/logging)
add_test(NAME logging_output WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND python ${GEMSTONE_TEST_DIR}/logging/test_logging.py check_output)
add_test(NAME logging_output
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND python ${GEMSTONE_TEST_DIR}/logging/test_logging.py check_output)
# ------------------------------------------------------- #
# CTEST 1
# test the panic functionality of the logger
add_executable(logging_panic ${PROJECT_SOURCE_DIR}/src/sys/log.c panic.c)
target_include_directories(logging_panic PUBLIC ${PROJECT_SOURCE_DIR}/src)
add_executable(logging_panic
${PROJECT_SOURCE_DIR}/src/sys/log.c
panic.c)
set_target_properties(logging_panic
PROPERTIES
OUTPUT_NAME "panic"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/logging)
add_test(NAME logging_panic WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND python ${GEMSTONE_TEST_DIR}/logging/test_logging.py check_panic)
add_test(NAME logging_panic
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND python ${GEMSTONE_TEST_DIR}/logging/test_logging.py check_panic)

View File

@ -56,7 +56,7 @@ if __name__ == "__main__":
match target:
case "check_output":
run_logger_test()
run_check_output()
case "check_panic":
run_check_panic()
case _: