support for FAIL_REGULAR_EXPRESSION
[liba.git] / lua / test / CMakeLists.txt
blob51590edcd21fea09908f573665054ba5e1eb67b2
1 function(unittest source name)
2   set(ARGS)
4   foreach(arg ${ARGN})
5     get_filename_component(ext ${arg} EXT)
7     if(NOT ext OR IS_ABSOLUTE ${arg})
8       list(APPEND ARGS ${arg})
9     else()
10       list(APPEND ARGS ${CMAKE_CURRENT_BINARY_DIR}/${arg})
11     endif()
12   endforeach()
14   add_test(NAME lua_${name} WORKING_DIRECTORY ${WORKING_DIRECTORY}
15     COMMAND ${LUA_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/${source}.lua ${ARGS}
16   )
17   set_tests_properties(lua_${name} PROPERTIES TIMEOUT 30
18     FAIL_REGULAR_EXPRESSION "ERROR;error"
19   )
20 endfunction()
22 unittest(a a a.log)
24 unittest(complex complex)
26 unittest(crc8 crc8)
28 unittest(crc16 crc16)
30 unittest(crc32 crc32)
32 unittest(crc64 crc64)
34 unittest(hpf hpf)
36 unittest(lpf lpf)
38 unittest(mf mf)
40 unittest(pid pid)
42 unittest(pid_fuzzy pid_fuzzy)
44 unittest(pid_neuro pid_neuro)
46 unittest(tf tf)
48 unittest(trajbell trajbell)
50 unittest(trajpoly3 trajpoly3)
52 unittest(trajpoly5 trajpoly5)
54 unittest(trajpoly7 trajpoly7)
56 unittest(trajtrap trajtrap)
58 unittest(version version)