annotate tests/CMakeLists.txt @ 882:ae96ae28f3dd 1.1.5

Limit python version to avoid using python3 (not compatible)
author Sebastien Decugis <sdecugis@freediameter.net>
date Sat, 03 Nov 2012 18:45:41 +0100
parents 901526bc034c
children b415d1384e0d
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
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 585
diff changeset
2 PROJECT("freeDiameter 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
733
b2bc31410425 Cosmetics
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 706
diff changeset
5 OPTION(TEST_TIMEOUT "Timeout for the tests, in seconds (default: 120)?")
0
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
737
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
10 # default command line for the tests
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
11 OPTION(OPT_TEST_ARGUMENTS "Specify the default arguments for the tests" OFF)
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
12 IF(OPT_TEST_ARGUMENT)
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
13 SET(TEST_ARGUMENTS ${OPT_TEST_ARGUMENTS})
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
14 ELSE(OPT_TEST_ARGUMENT)
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
15 SET(TEST_ARGUMENTS "")
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
16 ENDIF(OPT_TEST_ARGUMENT)
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
17
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
18
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
19 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
20 # List the test cases
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
21 SET(TEST_LIST
477
4e4ed23028ca Add a simple test to verify ticket #12
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 316
diff changeset
22 testsctp
706
4ffbc9f1e922 Large UNTESTED commit with the following changes:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 672
diff changeset
23 testostr
878
901526bc034c Added simple implementation of barriers for Mac OS X
Sebastien Decugis <sdecugis@freediameter.net>
parents: 853
diff changeset
24 testfifo
748
1f721af3cac3 New test to try and reproduce a reported problem
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 737
diff changeset
25 testpeers
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
26 testdict
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
27 testmesg
3
ef303f1078ab Progress; added session module; testsess to be completed
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 2
diff changeset
28 testsess
7
e5af94b04946 Added dispatch module and tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 3
diff changeset
29 testdisp
29
5ba91682f0bc Added a test for cnxctx (tbc) and fixed some bugs
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 10
diff changeset
30 testcnx
669
26482481d4ef New test to check if there are linking problems with built extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
31 testloadext
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
32 )
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
33
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
34 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
35 # Some parameters for the tests
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
36
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
37 ADD_DEFINITIONS(-DTEST_DEBUG)
2
d8ce06172629 Added a global debug level var
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 1
diff changeset
38 ADD_DEFINITIONS(-DTRACE_LEVEL=NONE)
669
26482481d4ef New test to check if there are linking problems with built extensions
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 668
diff changeset
39 ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}")
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
40
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 585
diff changeset
41 INCLUDE_DIRECTORIES( "../libfdproto" )
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 585
diff changeset
42 INCLUDE_DIRECTORIES( "../libfdcore" )
667
1f7c7ce85db3 More cleanups in the CMakeLists files
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 658
diff changeset
43 INCLUDE_DIRECTORIES(${LFDCORE_INCLUDES})
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
44
316
aa8f41bca657 Fixed libraries dependencies
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 304
diff changeset
45
672
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
46 SET(testcnx_ADDITIONAL_LIB ${CLOCK_GETTIME_LIBS})
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
47 SET(testfifo_ADDITIONAL_LIB ${CLOCK_GETTIME_LIBS})
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
48 SET(testsess_ADDITIONAL_LIB ${CLOCK_GETTIME_LIBS})
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
49 SET(testloadext_ADDITIONAL_LIB ${CMAKE_DL_LIBS})
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
50
285
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
51 ##############################
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
52 # App_acct test
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
53
585
4d7872860080 Add test_app_acct when ALL_EXTENSIONS is specified
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 477
diff changeset
54 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
55 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
56 IF(TEST_APP_ACCT)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
57
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_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
59 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
60 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
61 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
62
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
63 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
64
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
65 # Extension dependencies
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
66 FIND_PACKAGE(PostgreSQL REQUIRED)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
67 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
68 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
69
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
70 # 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
71 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
72 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
73 #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
74
285
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
75 SET( APP_ACCT_SRC
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
76 app_acct.h
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
77 app_acct.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
78 acct_db.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
79 acct_records.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
80 )
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
81 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
82 lex.acct_conf.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
83 acct_conf.tab.c
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
84 acct_conf.tab.h
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
85 )
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 # The extension headers
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 585
diff changeset
88 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
89
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
90 SET(testappacct_ADDITIONAL "")
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
91
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
92 FOREACH( SRC_FILE ${APP_ACCT_SRC})
658
f198d16fa7f4 Initial commit for 1.1.0:
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 585
diff changeset
93 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
94 ENDFOREACH(SRC_FILE)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
95
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
96 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
97 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
98 ENDFOREACH(SRC_FILE)
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
99
0daf6fc2b751 Added a test case for the app_acct extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 29
diff changeset
100 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
101 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
102
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
103
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
104 #############################
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
105 # Compile each test
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
106 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
107 ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h ${${TEST}_ADDITIONAL})
672
877ed3fd4bcb Cleaned link relations for tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 669
diff changeset
108 TARGET_LINK_LIBRARIES(${TEST} libfdproto libfdcore ${GNUTLS_LIBRARIES} ${GCRYPT_LIBRARY} ${${TEST}_ADDITIONAL_LIB})
737
03bcd4870f44 Set default output to CHECK only in nightly tests
Sebastien Decugis <sdecugis@nict.go.jp>
parents: 733
diff changeset
109 ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST} ${TEST_ARGUMENTS})
0
13530e1f02e3 Initial files imported
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff changeset
110 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
111
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
112
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
113 ####
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 ## 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
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 # we do not install the tests
"Welcome to our mercurial repository"