File: Testing.cmake

package info (click to toggle)
wbxml2 0.11.8%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,672 kB
  • sloc: ansic: 12,690; xml: 6,399; perl: 294; sh: 159; makefile: 7; cpp: 7
file content (63 lines) | stat: -rw-r--r-- 2,758 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
ENABLE_TESTING()
INCLUDE( CTest )

IF ( CMAKE_COMPILER_IS_GNUCC )
	SET( CMAKE_C_FLAGS_PROFILING "-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Compiler Flags" ) 
	# SET( CMAKE_C_FLAGS_PROFILING "-g -O0 -Wall -W -Wextra -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -pedantic -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Compiler Flags" )
	SET( CMAKE_CXX_FLAGS_PROFILING "-g -O0 -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Compiler Flags" ) 
	SET( CMAKE_SHARED_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags" )
	SET( CMAKE_MODULE_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags" )
	SET( CMAKE_EXEC_LINKER_FLAGS_PROFILING " -fprofile-arcs -ftest-coverage" CACHE STRING "Profiling Linker Flags" )
ENDIF ( CMAKE_COMPILER_IS_GNUCC )

MACRO( BUILD_CHECK_TEST _testName _testSource ) 

	if(COMMAND cmake_policy)
		cmake_policy(SET CMP0003 NEW)
		## The macro ADD_CHECK_TEST creates false warning.
		cmake_policy(SET CMP0002 OLD)
	endif(COMMAND cmake_policy)
	ADD_EXECUTABLE( ${_testName} ${_testSource} )
	TARGET_LINK_LIBRARIES( ${_testName} ${ARGN} )

ENDMACRO( BUILD_CHECK_TEST )

MACRO( ADD_CHECK_TEST _testName _testSource ) 

	if(COMMAND cmake_policy)
		cmake_policy(SET CMP0003 NEW)
		## The macro ADD_CHECK_TEST creates false warning.
		cmake_policy(SET CMP0002 OLD)
	endif(COMMAND cmake_policy)
	BUILD_CHECK_TEST( ${_testName} ${_testSource} ${ARGN} )
	#	ADD_EXECUTABLE( ${_testName} ${_testSource} )
	#	TARGET_LINK_LIBRARIES( ${_testName} ${ARGN} )
	ADD_TEST( ${_testName} ${CMAKE_CURRENT_BINARY_DIR}/${_testName} )

ENDMACRO( ADD_CHECK_TEST )

MACRO( OSYNC_TESTCASE _testSource _testDest ) 

	if(COMMAND cmake_policy)
		cmake_policy(SET CMP0003 NEW)
		## The macro ADD_CHECK_TEST creates false warning.
		cmake_policy(SET CMP0002 OLD)
	endif(COMMAND cmake_policy)

	# 1st Argument is the testcase name
	# 2nd Argument is the executable name
        # 3rd Argument the testcase name, again, as argument for the executable
	ADD_TEST( ${_testDest} ${_testSource} ${_testDest} )

ENDMACRO( OSYNC_TESTCASE )


MACRO( OSYNC_TESTCASE_DISABLED _testSource _testDest _ticket ) 

	OSYNC_TESTCASE( ${_testSource} ${_testDest} ) 
	SET( CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} "${_testDest}" )

	MESSAGE( STATUS "Testcase \"${_testDest}\" disabled/ignored! ${TICKETURL}${_ticket}" )

ENDMACRO( OSYNC_TESTCASE_DISABLED )