gemstone/tests/ast/CMakeLists.txt

52 lines
1.7 KiB
CMake
Raw Permalink Normal View History

2024-05-07 13:22:52 +00:00
include(CTest)
include_directories(${PROJECT_SOURCE_DIR}/src)
# ------------------------------------------------------- #
# CTEST 1
# test building the syntax tree
add_executable(ast_build_tree
${PROJECT_SOURCE_DIR}/src/ast/ast.c
${PROJECT_SOURCE_DIR}/src/sys/log.c
build_tree.c)
set_target_properties(ast_build_tree
PROPERTIES
OUTPUT_NAME "build_tree"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/ast)
add_test(NAME ast_build_tree
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND python ${GEMSTONE_TEST_DIR}/ast/test_ast.py check_build_tree)
# ------------------------------------------------------- #
# CTEST 2
# test node to string output
add_executable(ast_print_node
${PROJECT_SOURCE_DIR}/src/ast/ast.c
2024-05-08 11:49:06 +00:00
${PROJECT_SOURCE_DIR}/src/sys/log.c
2024-05-07 13:22:52 +00:00
print_node.c)
2024-05-08 11:49:06 +00:00
set_target_properties(ast_print_node
2024-05-07 13:22:52 +00:00
PROPERTIES
2024-05-08 11:49:06 +00:00
OUTPUT_NAME "print_node"
2024-05-07 13:22:52 +00:00
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/ast)
add_test(NAME ast_print_node
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND python ${GEMSTONE_TEST_DIR}/ast/test_ast.py check_print_node)
2024-05-08 11:49:06 +00:00
# ------------------------------------------------------- #
# CTEST 3
# test graphviz output
add_executable(ast_graphviz
${PROJECT_SOURCE_DIR}/src/ast/ast.c
${PROJECT_SOURCE_DIR}/src/sys/log.c
print_graphviz.c)
set_target_properties(ast_graphviz
PROPERTIES
OUTPUT_NAME "print_graphviz"
RUNTIME_OUTPUT_DIRECTORY ${GEMSTONE_BINARY_DIR}/tests/ast)
add_test(NAME ast_graphviz
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND python ${GEMSTONE_TEST_DIR}/ast/test_ast.py check_print_graphviz)