equal
deleted
inserted
replaced
|
1 ##### Probably don't want to edit below this line ##### |
|
2 |
|
3 SET( QT_USE_QTTEST TRUE ) |
|
4 |
|
5 # Use it |
|
6 INCLUDE( ${QT_USE_FILE} ) |
|
7 |
|
8 INCLUDE(AddFileDependencies) |
|
9 |
|
10 # Include the library include directories, and the current build directory (moc) |
|
11 INCLUDE_DIRECTORIES( |
|
12 ../src |
|
13 ${CMAKE_CURRENT_BINARY_DIR} |
|
14 ) |
|
15 |
|
16 ADD_EXECUTABLE( |
|
17 cmdline_tester |
|
18 cmdline_tester.cpp |
|
19 ) |
|
20 |
|
21 SET (qjson_test_support_SRCS person.cpp) |
|
22 QT4_WRAP_CPP(qjson_test_support_MOC_SRCS person.h) |
|
23 |
|
24 ADD_LIBRARY (qjson_test_support STATIC ${qjson_test_support_SRCS} |
|
25 ${qjson_test_support_MOC_SRCS}) |
|
26 |
|
27 #ADD_FILE_DEPENDENCIES(cmdline_tester.cpp ${MOC_SOURCE}) |
|
28 TARGET_LINK_LIBRARIES( |
|
29 cmdline_tester |
|
30 ${QT_LIBRARIES} |
|
31 qjson |
|
32 ) |
|
33 |
|
34 SET( UNIT_TESTS |
|
35 testparser |
|
36 testqobjecthelper |
|
37 testserializer |
|
38 ) |
|
39 |
|
40 # Build the tests |
|
41 FOREACH(test ${UNIT_TESTS}) |
|
42 MESSAGE(STATUS "Building ${test}") |
|
43 QT4_WRAP_CPP(MOC_SOURCE ${test}.cpp) |
|
44 ADD_EXECUTABLE( |
|
45 ${test} |
|
46 ${test}.cpp |
|
47 ) |
|
48 |
|
49 ADD_FILE_DEPENDENCIES(${test}.cpp ${MOC_SOURCE}) |
|
50 TARGET_LINK_LIBRARIES( |
|
51 ${test} |
|
52 ${QT_LIBRARIES} |
|
53 qjson |
|
54 qjson_test_support |
|
55 ) |
|
56 if (QJSON_TEST_OUTPUT STREQUAL "xml") |
|
57 # produce XML output |
|
58 add_test( ${test} ${test} -xml -o ${test}.tml ) |
|
59 else (QJSON_TEST_OUTPUT STREQUAL "xml") |
|
60 add_test( ${test} ${test} ) |
|
61 endif (QJSON_TEST_OUTPUT STREQUAL "xml") |
|
62 ENDFOREACH() |