annotate freeDiameter/tests/CMakeLists.txt @ 477:4e4ed23028ca

Add a simple test to verify ticket #12
author Sebastien Decugis <sdecugis@nict.go.jp>
date Mon, 09 Aug 2010 18:06:09 +0900
parents aa8f41bca657
children 4d7872860080
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
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
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
3
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
4 # give the possibility to configure the timeout duration for the tests
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
5 OPTION(TEST_TIMEOUT "Timeout for the tests, in seconds (default: 5)?")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
6 IF(TEST_TIMEOUT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
7 ADD_DEFINITIONS(-DTEST_TIMEOUT=${TEST_TIMEOUT})
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
8 ENDIF(TEST_TIMEOUT)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
9
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
10
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
11 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
12 # List the test cases
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
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
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
16 testdict
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
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
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
22 )
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
23
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
24 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
25 # Some parameters for the tests
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
26
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
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
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
29
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
30 INCLUDE_DIRECTORIES( ".." )
2
d8ce06172629 Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
31 INCLUDE_DIRECTORIES( "../../libfreeDiameter" )
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
32
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 7
diff changeset
33 BISON_FILE(../fdd.y)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 7
diff changeset
34 FLEX_FILE(../fdd.l)
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 7
diff changeset
35
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
36 SET(TEST_COMMON_SRC "")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
38 FOREACH( SRC_FILE ${FD_COMMON_SRC})
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
39 SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../${SRC_FILE}")
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40 ENDFOREACH(SRC_FILE)
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
41
8
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 7
diff changeset
42 FOREACH( SRC_FILE ${FD_COMMON_GEN_SRC})
3e143f047f78 Backup for the week-end
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 7
diff changeset
43 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
44 ENDFOREACH(SRC_FILE)
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
45
2
d8ce06172629 Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
46 FOREACH( SRC_FILE ${LFD_SRC})
d8ce06172629 Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
47 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
48 ENDFOREACH(SRC_FILE)
d8ce06172629 Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
49
1
bafb831ba688 Fix names to proper case for freeDiameter
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 0
diff changeset
50 # 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
51 ADD_LIBRARY(fDcore STATIC ${TEST_COMMON_SRC})
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
52
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
53
285
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 # App_acct test
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
56
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
57 IF(BUILD_APP_ACCT)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
58 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
59 IF(TEST_APP_ACCT)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
60
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
61 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
62 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
63 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
64 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
65
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
66 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
67
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
68 # Extension dependencies
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
69 FIND_PACKAGE(PostgreSQL REQUIRED)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
70 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
71 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
72
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
73 # List of source files, copied from the extension CMakeLists.
288
6bbbbc8040b9 Attempt to fix issue for FreeBSD
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 285
diff changeset
74 BISON_FILE(../../extensions/app_acct/acct_conf.y)
6bbbbc8040b9 Attempt to fix issue for FreeBSD
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 285
diff changeset
75 FLEX_FILE(../../extensions/app_acct/acct_conf.l)
6bbbbc8040b9 Attempt to fix issue for FreeBSD
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 285
diff changeset
76 #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
77
285
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
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
79 app_acct.h
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
80 app_acct.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
81 acct_db.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
82 acct_records.c
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 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
85 lex.acct_conf.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
86 acct_conf.tab.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
87 acct_conf.tab.h
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
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
90 # The extension headers
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
91 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
92
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
93 SET(testappacct_ADDITIONAL "")
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
94
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
95 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
96 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
97 ENDFOREACH(SRC_FILE)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
98
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
99 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
100 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
101 ENDFOREACH(SRC_FILE)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
102
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
103 ENDIF(TEST_APP_ACCT)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
104 ENDIF(BUILD_APP_ACCT)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
105
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
106
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
107 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
108 # Compile each test
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
109 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
110 ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h ${${TEST}_ADDITIONAL})
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
111 TARGET_LINK_LIBRARIES(${TEST} fDcore ${FD_LIBS} ${LFD_LIBS} ${${TEST}_ADDITIONAL_LIB})
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
112 ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST})
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
113 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
114
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
115
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
116 ####
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
117 ## 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
118
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
119 # we do not install the tests
"Welcome to our mercurial repository"