From 138937af57af8ca4d26e002d2881ed29e73e3e96 Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 2 May 2024 10:04:00 +0200 Subject: [PATCH] fixed output test and reformatted CMake --- tests/logging/CMakeLists.txt | 20 ++++++++++++++------ tests/logging/test_logging.py | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/logging/CMakeLists.txt b/tests/logging/CMakeLists.txt index 9c90431..0db2412 100644 --- a/tests/logging/CMakeLists.txt +++ b/tests/logging/CMakeLists.txt @@ -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) diff --git a/tests/logging/test_logging.py b/tests/logging/test_logging.py index 54f5d75..86816fd 100644 --- a/tests/logging/test_logging.py +++ b/tests/logging/test_logging.py @@ -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 _: