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(CTest)
include_directories(${PROJECT_SOURCE_DIR}/src)
# ------------------------------------------------------- # # ------------------------------------------------------- #
# CTEST 1 # CTEST 1
# test the default output of the logger # test the default output of the logger
add_executable(logging_output ${PROJECT_SOURCE_DIR}/src/sys/log.c output.c) add_executable(logging_output
target_include_directories(logging_output PUBLIC ${PROJECT_SOURCE_DIR}/src) ${PROJECT_SOURCE_DIR}/src/sys/log.c
output.c)
set_target_properties(logging_output set_target_properties(logging_output
PROPERTIES PROPERTIES
OUTPUT_NAME "output" OUTPUT_NAME "output"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/logging) 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 # CTEST 1
# test the panic functionality of the logger # test the panic functionality of the logger
add_executable(logging_panic ${PROJECT_SOURCE_DIR}/src/sys/log.c panic.c) add_executable(logging_panic
target_include_directories(logging_panic PUBLIC ${PROJECT_SOURCE_DIR}/src) ${PROJECT_SOURCE_DIR}/src/sys/log.c
panic.c)
set_target_properties(logging_panic set_target_properties(logging_panic
PROPERTIES PROPERTIES
OUTPUT_NAME "panic" OUTPUT_NAME "panic"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/logging) 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: match target:
case "check_output": case "check_output":
run_logger_test() run_check_output()
case "check_panic": case "check_panic":
run_check_panic() run_check_panic()
case _: case _: