Project

General

Profile

« Previous | Next » 

Revision 6304ff63

Added by Hamza Bourbouh over 8 years ago

add ctest for Stateflow

View differences:

regression_tests/CMakeLists.txt
1 1
cmake_minimum_required(VERSION 2.8.4)
2

  
3 2
project (lustrec-tests)
3
include( CTest )
4 4

  
5 5
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules)
6 6
include(./modules/Lustre_compile.cmake)
regression_tests/CTestConfig.cmake
1
## This file should be placed in the root directory of your project.
2
## Then modify the CMakeLists.txt file in the root directory of your
3
## project to incorporate the testing dashboard.
4
##
5
## # The following are required to submit to the CDash dashboard:
6
##   ENABLE_TESTING()
7
##   INCLUDE(CTest)
8

  
9
set(CTEST_PROJECT_NAME "Lustrec-tests")
10
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
11

  
12
set(CTEST_DROP_METHOD "http")
13
set(CTEST_DROP_SITE "my.cdash.org")
14
set(CTEST_DROP_LOCATION "/submit.php?project=Lustrec-tests")
15
set(CTEST_DROP_SITE_CDASH TRUE)
16

  
17

  
18

  
regression_tests/CTestCustom.cmake
1
set( CTEST_CUSTOM_WARNING_EXCEPTION 
2
	${CTEST_CUSTOM_WARNING_EXCEPTION} 
3
	"warning: overriding recipe for target"
4
	"warning: ignoring old recipe for target")
regression_tests/README
4 4
> cd build
5 5
> cmake ..
6 6
> make
7

  
8

  
9
In Build folder if you want to run Ctest test:
10

  
11
>make test
12
Or
13
>ctest
14

  
15
If you want to specify witch tests to run you can choose to run test
16
matching regular expressions:
17

  
18
run all tests have Stateflow in their names.
19
> ctest -R Stateflow 
20

  
21

  
22

  
23
To report test to CDash
24
>ctest -D Experimental
regression_tests/lustre_files/success/Stateflow/CMakeLists.txt
1 1
cmake_minimum_required(VERSION 2.8.4)
2 2

  
3

  
3 4
#helpfull functions and macros
4 5
MACRO(SUBDIRLIST result curdir)
5 6
  FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
......
47 48
#first combination :no option
48 49
set(LUSTRE_OPTIONS_OPT "")
49 50
set(GENERATION_RESULTS "")
51
set(REPORT_PATH  "${CMAKE_CURRENT_BINARY_DIR}/report")
52
file(WRITE REPORT_PATH "")
50 53
FOREACH(lus_file ${GLOBAL_LUSTRE_FILES})
51 54
	get_filename_component(L ${lus_file} NAME_WE)
52 55
	set(LUSTRE_NODE_OPT  "${L}")
......
60 63
	#second command : generate C binary from C files generated before		
61 64
	#third step : compare binary outputs with the reference.
62 65
	add_custom_command(
63
		OUTPUT ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/${L}_${LUSTRE_NODE_OPT}_outputs
66
		OUTPUT ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/report
64 67
		DEPENDS ${LUSTRE_GENERATED_FILES_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}
65 68
		COMMAND make 
66 69
		ARGS  -f ${L}.makefile
......
71 74
		WORKING_DIRECTORY ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}
72 75
		COMMENT " make -f ${L}.makefile \n ./${L}_${LUSTRE_NODE_OPT}  < ../input_values > ${L}_${LUSTRE_NODE_OPT}_outputs \n diff -s ${L}_${LUSTRE_NODE_OPT}_outputs ../outputs_values > report"
73 76
	)
74
	set(GENERATION_RESULTS ${GENERATION_RESULTS} ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/${L}_${LUSTRE_NODE_OPT}_outputs)
77
	add_test(NAME Stateflow_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}
78
			WORKING_DIRECTORY ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}
79
			COMMAND diff -s  ${L}_${LUSTRE_NODE_OPT}_outputs ../outputs_values)
80
	set_tests_properties(Stateflow_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}
81
			PROPERTIES PASS_REGULAR_EXPRESSION "are identical")
82
			
83
			
84
	set(GENERATION_RESULTS ${GENERATION_RESULTS} ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/report)
85
	
86
	if(EXISTS ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/report )
87
		file(READ ${LUSTRE_OUTPUT_DIR_${L}_${LUSTRE_NODE_OPT}_${LUSTRE_OPTIONS_OPT}}/report REPORT)
88
		file(APPEND ${REPORT_PATH}.in  "${REPORT}")
89
		# Copy the temporary file to the final location
90
		configure_file(${REPORT_PATH}.in ${REPORT_PATH} COPYONLY)
91
	endif()
92
	
75 93
ENDFOREACH()
76 94

  
77 95

  

Also available in: Unified diff