-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
25 lines (23 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cmake_minimum_required(VERSION 3.15.0)
project(evox LANGUAGES CXX)
add_library(evox STATIC evox.cpp)
option(BUILD_TESTER "Build tester executable" OFF)
if(BUILD_TESTER)
add_executable(tester tester.cpp)
target_link_libraries(tester PRIVATE evox)
enable_testing()
add_test(NAME TestMismatchedParentheses COMMAND tester "(2+3)*4)")
add_test(NAME TestMismatchedParentheses2 COMMAND tester "((2+3)*4")
add_test(NAME TestOrderOfOperations COMMAND tester "2+3*4")
add_test(NAME TestOrderOfOperations2 COMMAND tester "2*3+4")
add_test(NAME TestDecimalWithoutTrailingZeros COMMAND tester "0.5*2")
add_test(NAME TestDecimalExponents COMMAND tester "2^0.5")
add_test(NAME TestSinFunction COMMAND tester "sin(3.14159/2)")
set_tests_properties(TestMismatchedParentheses PROPERTIES PASS_REGULAR_EXPRESSION "Error: Mismatched parentheses.*")
set_tests_properties(TestMismatchedParentheses2 PROPERTIES PASS_REGULAR_EXPRESSION "Error: Mismatched parentheses.*")
set_tests_properties(TestOrderOfOperations PROPERTIES PASS_REGULAR_EXPRESSION "14")
set_tests_properties(TestOrderOfOperations2 PROPERTIES PASS_REGULAR_EXPRESSION "10")
set_tests_properties(TestDecimalWithoutTrailingZeros PROPERTIES PASS_REGULAR_EXPRESSION "1")
set_tests_properties(TestDecimalExponents PROPERTIES PASS_REGULAR_EXPRESSION "1.41421")
set_tests_properties( TestSinFunction PROPERTIES PASS_REGULAR_EXPRESSION "1")
endif()