replace recursion with iteration
[liba.git] / python / test / CMakeLists.txt
bloba9a55c9f753ea86083cd3b7be85a6fd09d1b11fa
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 py_${name} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
15     COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/${source}.py ${ARGS}
16   )
17   set_tests_properties(py_${name} PROPERTIES TIMEOUT 30
18     FAIL_REGULAR_EXPRESSION "ERROR;error"
19   )
20 endfunction()
22 unittest(a a a.log)
24 unittest(crc crc)
26 unittest(hpf hpf)
28 unittest(lpf lpf)
30 unittest(mf mf)
32 unittest(pid pid)
34 unittest(pid_fuzzy pid_fuzzy)
36 unittest(pid_neuro pid_neuro)
38 unittest(poly poly)
40 unittest(regress_simple regress_simple)
42 unittest(tf tf)
44 unittest(trajbell trajbell)
46 unittest(trajpoly3 trajpoly3)
48 unittest(trajpoly5 trajpoly5)
50 unittest(trajpoly7 trajpoly7)
52 unittest(trajtrap trajtrap)
54 unittest(version version)