Navigation


source: freeDiameter/freeDiameter/tests/CMakeLists.txt @ 29:5ba91682f0bc

Last change on this file since 29:5ba91682f0bc was 29:5ba91682f0bc, checked in by Sebastien Decugis <sdecugis@nict.go.jp>, 11 years ago

Added a test for cnxctx (tbc) and fixed some bugs

File size: 1.4 KB
Line 
1# Test directory
2PROJECT("libfreeDiameter tests" C)
3
4# give the possibility to configure the timeout duration for the tests
5OPTION(TEST_TIMEOUT "Timeout for the tests, in seconds (default: 5)?")
6IF(TEST_TIMEOUT)
7        ADD_DEFINITIONS(-DTEST_TIMEOUT=${TEST_TIMEOUT})
8ENDIF(TEST_TIMEOUT)
9
10
11#############################
12# List the test cases
13SET(TEST_LIST
14        testlist
15        testdict
16        testmesg
17        testfifo
18        testsess
19        testdisp
20        testcnx
21)
22
23#############################
24# Some parameters for the tests
25
26ADD_DEFINITIONS(-DTEST_DEBUG)
27ADD_DEFINITIONS(-DTRACE_LEVEL=NONE)
28
29INCLUDE_DIRECTORIES( ".." )
30INCLUDE_DIRECTORIES( "../../libfreeDiameter" )
31
32BISON_FILE(../fdd.y)
33FLEX_FILE(../fdd.l)
34
35SET(TEST_COMMON_SRC "")
36
37FOREACH( SRC_FILE ${FD_COMMON_SRC})
38   SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../${SRC_FILE}")
39ENDFOREACH(SRC_FILE)
40
41FOREACH( SRC_FILE ${FD_COMMON_GEN_SRC})
42   SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "${CMAKE_CURRENT_BINARY_DIR}/../${SRC_FILE}")
43ENDFOREACH(SRC_FILE)
44
45FOREACH( SRC_FILE ${LFD_SRC})
46   SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../../libfreeDiameter/${SRC_FILE}")
47ENDFOREACH(SRC_FILE)
48
49# Create an archive with the daemon common files (all but main)
50ADD_LIBRARY(fDcore STATIC ${TEST_COMMON_SRC})
51
52
53#############################
54# Compile each test
55FOREACH( TEST ${TEST_LIST} )
56   ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h)
57   TARGET_LINK_LIBRARIES(${TEST} fDcore ${FD_LIBS})
58   ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST})
59ENDFOREACH( TEST )
Note: See TracBrowser for help on using the repository browser.