Add CMAKE unit tests

Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar>
Co-authored-by: Juan Barmasch <jbarmasch@itba.edu.ar>
This commit is contained in:
Santiago Lo Coco 2022-04-20 11:24:00 -03:00
parent a1dd79326f
commit 24abb554a9
1 changed files with 16 additions and 0 deletions

View File

@ -58,3 +58,19 @@ add_executable(BFBCompiler
# Linkear el proyecto y sus librerías:
target_link_libraries(BFBCompiler)
file(GLOB_RECURSE correct_use_cases "doc/examples/correct/use-case-*.b" )
file(GLOB_RECURSE incorrect_use_cases "doc/examples/incorrect/use-case-*.b" )
enable_testing()
foreach(test ${correct_use_cases})
add_test(NAME ${test}
COMMAND ${CMAKE_SOURCE_DIR}/compile.sh ${test}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endforeach()
foreach(test ${incorrect_use_cases})
add_test(NAME ${test}
COMMAND ${CMAKE_SOURCE_DIR}/compile.sh ${test}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set_tests_properties(${test} PROPERTIES WILL_FAIL TRUE)
endforeach()