Mercurial > hg > freeDiameter
annotate freeDiameter/tests/CMakeLists.txt @ 285:0daf6fc2b751
Added a test case for the app_acct extension
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 30 Apr 2010 17:55:16 +0900 |
parents | 5ba91682f0bc |
children | 6bbbbc8040b9 |
rev | line source |
---|---|
0 | 1 # Test directory |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
2 PROJECT("libfreeDiameter 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 | |
3
ef303f1078ab
Progress; added session module; testsess to be completed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
2
diff
changeset
|
14 testlist |
0 | 15 testdict |
16 testmesg | |
10
c5c99c73c2bf
Added some extensions and functions in the daemon
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
8
diff
changeset
|
17 testfifo |
3
ef303f1078ab
Progress; added session module; testsess to be completed
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
2
diff
changeset
|
18 testsess |
7
e5af94b04946
Added dispatch module and tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
3
diff
changeset
|
19 testdisp |
29
5ba91682f0bc
Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
10
diff
changeset
|
20 testcnx |
0 | 21 ) |
22 | |
23 ############################# | |
24 # Some parameters for the tests | |
25 | |
26 ADD_DEFINITIONS(-DTEST_DEBUG) | |
2
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
27 ADD_DEFINITIONS(-DTRACE_LEVEL=NONE) |
0 | 28 |
29 INCLUDE_DIRECTORIES( ".." ) | |
2
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
30 INCLUDE_DIRECTORIES( "../../libfreeDiameter" ) |
0 | 31 |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
32 BISON_FILE(../fdd.y) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
33 FLEX_FILE(../fdd.l) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
34 |
0 | 35 SET(TEST_COMMON_SRC "") |
36 | |
37 FOREACH( SRC_FILE ${FD_COMMON_SRC}) | |
38 SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../${SRC_FILE}") | |
39 ENDFOREACH(SRC_FILE) | |
40 | |
8
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
41 FOREACH( SRC_FILE ${FD_COMMON_GEN_SRC}) |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
42 SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "${CMAKE_CURRENT_BINARY_DIR}/../${SRC_FILE}") |
3e143f047f78
Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
7
diff
changeset
|
43 ENDFOREACH(SRC_FILE) |
0 | 44 |
2
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
45 FOREACH( SRC_FILE ${LFD_SRC}) |
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
46 SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../../libfreeDiameter/${SRC_FILE}") |
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
47 ENDFOREACH(SRC_FILE) |
d8ce06172629
Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
1
diff
changeset
|
48 |
1
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
49 # Create an archive with the daemon common files (all but main) |
bafb831ba688
Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
0
diff
changeset
|
50 ADD_LIBRARY(fDcore STATIC ${TEST_COMMON_SRC}) |
0 | 51 |
285
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
52 ############################## |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
53 # App_acct test |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
54 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
55 IF(BUILD_APP_ACCT) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
56 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
|
57 IF(TEST_APP_ACCT) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
58 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
59 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
|
60 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
|
61 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
|
62 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
|
63 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
64 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
|
65 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
66 # Extension dependencies |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
67 FIND_PACKAGE(PostgreSQL REQUIRED) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
68 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
|
69 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
|
70 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
71 # List of source files, copied from the extension CMakeLists. |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
72 SET( APP_ACCT_SRC |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
73 app_acct.h |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
74 app_acct.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
75 acct_db.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
76 acct_records.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
77 ) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
78 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
|
79 lex.acct_conf.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
80 acct_conf.tab.c |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
81 acct_conf.tab.h |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
82 ) |
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 # The extension headers |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
85 INCLUDE_DIRECTORIES( "../../extensions/app_acct" ) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
86 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
87 SET(testappacct_ADDITIONAL "") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
88 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
89 FOREACH( SRC_FILE ${APP_ACCT_SRC}) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
90 SET(testappacct_ADDITIONAL ${testappacct_ADDITIONAL} "../../extensions/app_acct/${SRC_FILE}") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
91 ENDFOREACH(SRC_FILE) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
92 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
93 FOREACH( SRC_FILE ${APP_ACCT_SRC_GEN}) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
94 SET(testappacct_ADDITIONAL ${testappacct_ADDITIONAL} "${CMAKE_CURRENT_BINARY_DIR}/../../extensions/app_acct/${SRC_FILE}") |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
95 ENDFOREACH(SRC_FILE) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
96 |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
97 ENDIF(TEST_APP_ACCT) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
98 ENDIF(BUILD_APP_ACCT) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
99 |
0 | 100 |
101 ############################# | |
102 # Compile each test | |
103 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
|
104 ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h ${${TEST}_ADDITIONAL}) |
0daf6fc2b751
Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
29
diff
changeset
|
105 TARGET_LINK_LIBRARIES(${TEST} fDcore ${FD_LIBS} ${${TEST}_ADDITIONAL_LIB}) |
0 | 106 ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST}) |
107 ENDFOREACH( TEST ) |