Mercurial > hg > freeDiameter
annotate tests/CMakeLists.txt @ 668:4ef3b7cdf734
Some more cleanups in linking
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 17 Jan 2011 14:08:08 +0900 |
parents | 1f7c7ce85db3 |
children | 26482481d4ef |
rev | line source |
---|---|
0 | 1 # Test directory |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
2 PROJECT("freeDiameter tests" C) |
0 | 3 |
4 # give the possibility to configure the timeout duration for the tests | |
5 OPTION(TEST_TIMEOUT "Timeout for the tests, in seconds (default: 5)?") | |
6 IF(TEST_TIMEOUT) | |
7 ADD_DEFINITIONS(-DTEST_TIMEOUT=${TEST_TIMEOUT}) | |
8 ENDIF(TEST_TIMEOUT) | |
9 | |
10 | |
11 ############################# | |
12 # List the test cases | |
13 SET(TEST_LIST | |
477
4e4ed23028ca
Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
316
diff
changeset
|
14 testsctp |
3
ef303f1078ab
Progress; added session module; testsess to be completed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
2
diff
changeset
|
15 testlist |
0 | 16 testdict |
17 testmesg | |
10
c5c99c73c2bf
Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
18 testfifo |
3
ef303f1078ab
Progress; added session module; testsess to be completed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
2
diff
changeset
|
19 testsess |
7
e5af94b04946
Added dispatch module and tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
3
diff
changeset
|
20 testdisp |
29
5ba91682f0bc
Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
10
diff
changeset
|
21 testcnx |
0 | 22 ) |
23 | |
24 ############################# | |
25 # Some parameters for the tests | |
26 | |
27 ADD_DEFINITIONS(-DTEST_DEBUG) | |
2
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
28 ADD_DEFINITIONS(-DTRACE_LEVEL=NONE) |
0 | 29 |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
30 INCLUDE_DIRECTORIES( "../libfdproto" ) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
31 INCLUDE_DIRECTORIES( "../libfdcore" ) |
667
1f7c7ce85db3
More cleanups in the CMakeLists files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
658
diff
changeset
|
32 INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES}) |
0 | 33 |
316
aa8f41bca657
Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
304
diff
changeset
|
34 |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
35 ############################## |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
36 # App_acct test |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
37 |
585
4d7872860080
Add test_app_acct when ALL_EXTENSIONS is specified
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
477
diff
changeset
|
38 IF(BUILD_APP_ACCT OR ALL_EXTENSIONS) |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
39 OPTION(TEST_APP_ACCT "Test app_acct extension? (Requires a configured database, see testappacct.c for details)" OFF) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
40 IF(TEST_APP_ACCT) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
41 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
42 OPTION(TEST_APP_ACCT_CONNINFO "The connection string to the database") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
43 IF(TEST_APP_ACCT_CONNINFO) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
44 ADD_DEFINITIONS(-DTEST_CONNINFO="${TEST_APP_ACCT_CONNINFO}") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
45 ENDIF(TEST_APP_ACCT_CONNINFO) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
46 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
47 SET(TEST_LIST ${TEST_LIST} testappacct) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
48 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
49 # Extension dependencies |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
50 FIND_PACKAGE(PostgreSQL REQUIRED) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
51 INCLUDE_DIRECTORIES(${POSTGRESQL_INCLUDE_DIR}) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
52 SET(testappacct_ADDITIONAL_LIB ${POSTGRESQL_LIBRARIES}) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
53 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
54 # List of source files, copied from the extension CMakeLists. |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
55 BISON_FILE(../extensions/app_acct/acct_conf.y) |
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
56 FLEX_FILE(../extensions/app_acct/acct_conf.l) |
288
6bbbbc8040b9
Attempt to fix issue for FreeBSD
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
285
diff
changeset
|
57 #SET_SOURCE_FILES_PROPERTIES(lex.acct_conf.c acct_conf.tab.c PROPERTIES COMPILE_FLAGS "-I ${CMAKE_CURRENT_SOURCE_DIR}") |
6bbbbc8040b9
Attempt to fix issue for FreeBSD
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
285
diff
changeset
|
58 |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
59 SET( APP_ACCT_SRC |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
60 app_acct.h |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
61 app_acct.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
62 acct_db.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
63 acct_records.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
64 ) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
65 SET( APP_ACCT_SRC_GEN |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
66 lex.acct_conf.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
67 acct_conf.tab.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
68 acct_conf.tab.h |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
69 ) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
70 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
71 # The extension headers |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
72 INCLUDE_DIRECTORIES( "../extensions/app_acct" ) |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
73 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
74 SET(testappacct_ADDITIONAL "") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
75 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
76 FOREACH( SRC_FILE ${APP_ACCT_SRC}) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
77 SET(testappacct_ADDITIONAL ${testappacct_ADDITIONAL} "../extensions/app_acct/${SRC_FILE}") |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
78 ENDFOREACH(SRC_FILE) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
79 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
80 FOREACH( SRC_FILE ${APP_ACCT_SRC_GEN}) |
658
f198d16fa7f4
Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
585
diff
changeset
|
81 SET(testappacct_ADDITIONAL ${testappacct_ADDITIONAL} "${CMAKE_CURRENT_BINARY_DIR}/../extensions/app_acct/${SRC_FILE}") |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
82 ENDFOREACH(SRC_FILE) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
83 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
84 ENDIF(TEST_APP_ACCT) |
585
4d7872860080
Add test_app_acct when ALL_EXTENSIONS is specified
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
477
diff
changeset
|
85 ENDIF(BUILD_APP_ACCT OR ALL_EXTENSIONS) |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
86 |
0 | 87 |
88 ############################# | |
89 # Compile each test | |
90 FOREACH( TEST ${TEST_LIST} ) | |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
91 ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h ${${TEST}_ADDITIONAL}) |
668
4ef3b7cdf734
Some more cleanups in linking
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
667
diff
changeset
|
92 TARGET_LINK_LIBRARIES(${TEST} libfdproto libfdcore ${${TEST}_ADDITIONAL_LIB} ${CLOCK_GETTIME_LIBS}) |
0 | 93 ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST}) |
94 ENDFOREACH( TEST ) | |
304
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
95 |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
96 |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
97 #### |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
98 ## INSTALL section ## |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
99 |
ad3c46016584
Added install directives for cmake; also allow default directory to seek for extensions and configuration files
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
288
diff
changeset
|
100 # we do not install the tests |