Project

General

Profile

« Previous | Next » 

Revision a3c5526d

Added by Hamza Bourbouh over 7 years ago

add targets

View differences:

regression_tests/README
13 13
>ctest
14 14

  
15 15
If you want to specify witch tests to run you can choose to run test
16
matching regular expressions:
16
matching regular expressions: 
17
>ctest -R EXP
17 18

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

  
20
The existing targets are: 
21
make test //to run all tests
21 22

  
22

  
23
To report test to CDash
24
>ctest -D Experimental
23
to run a folder of tests for example Kind_fmcad08/large/src/TIMEOUT:
24
make Kind_fmcad08_large_TIMEOUT
25
make Kind_fmcad08_large_SAFE
26
make Kind_fmcad08_large_CEX
27
make Stateflow
28
make Simulink
regression_tests/lustre_files/success/Simulink/CMakeLists.txt
79 79
	
80 80
ENDFOREACH()
81 81

  
82

  
82
add_custom_target(Simulink COMMAND ${CMAKE_CTEST_COMMAND} -R Simulink)
regression_tests/lustre_files/success/Stateflow/CMakeLists.txt
80 80
	
81 81
ENDFOREACH()
82 82

  
83

  
83
add_custom_target(Stateflow COMMAND ${CMAKE_CTEST_COMMAND} -R Stateflow)
regression_tests/lustre_files/success/kind_fmcad08/large/src/CEX/CMakeLists.txt
20 20
  FOREACH(lfile ${LFILES})
21 21
	  get_filename_component(L ${lfile} NAME_WE)
22 22
	  set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${L}")
23
	  file(COPY ${lfile}  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
24
	if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.xml)
25
		file(COPY ${L}.xml   DESTINATION  ${LUSTRE_OUTPUT_DIR})
26
	else()
27
		message("generate ${L}.xml for reference\n")
28
		Zustre_Compile(LUS_FILE ${lfile}
29
					NODE "top"
30
					OPTS ${ZUSTRE_OPTIONS_OPT})
31
		set(ZUS_OPTS_CUT ${ZUSTRE_OPTS_POSTFIX_${L}})
23
	  file(COPY ${lfile}   DESTINATION  ${LUSTRE_OUTPUT_DIR})
24
	  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.lusi)
25
		file(COPY  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
26
	  else()
27
		message("generate ${L}.lusi \n")
28
		Lustre_Compile(LUS_FILE ${lfile}
29
				NODE ""
30
				OPTS "-lusi")				
31
		set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
32 32
		execute_process(RESULT_VARIABLE res 
33
					OUTPUT_VARIABLE ${L}_output
34
					COMMAND  ${ZUSTRE_COMPILER} ${ZUSTRE_ARGS_${L}_top_${ZUS_OPTS_CUT}} 
33
					COMMAND ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}__${LUS_OPTS_CUT}} 
35 34
					WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
36 35
		if(${res} STREQUAL "0")
37
			if( ${${L}_output} MATCHES "<Answer>CEX</Answer>")
38
				message("${L} CEX")
39
				file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${L}.xml ${${L}_output})
40
				file(COPY ${L}.xml   DESTINATION  ${LUSTRE_OUTPUT_DIR})
36
			file(COPY  ${L}.lusi DESTINATION  ${LUSTRE_OUTPUT_DIR})
37
		else()
38
			message("${L}.lusi Error")
39
		endif()
40
	  endif()
41
		if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${L}.xml)
42
			file(COPY ${L}.xml   DESTINATION  ${LUSTRE_OUTPUT_DIR})
43
		else()
44
			message("generate ${L}.xml for reference\n")
45
			Zustre_Compile(LUS_FILE ${lfile}
46
						NODE "top"
47
						OPTS ${ZUSTRE_OPTIONS_OPT})
48
			set(ZUS_OPTS_CUT ${ZUSTRE_OPTS_POSTFIX_${L}})
49
			execute_process(RESULT_VARIABLE res 
50
						OUTPUT_VARIABLE ${L}_output
51
						COMMAND  ${ZUSTRE_COMPILER} ${ZUSTRE_ARGS_${L}_top_${ZUS_OPTS_CUT}} 
52
						WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
53
			if(${res} STREQUAL "0")
54
				if( ${${L}_output} MATCHES "<Answer>CEX</Answer>")
55
					message("${L} CEX")
56
					file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${L}.xml ${${L}_output})
57
					file(COPY ${L}.xml   DESTINATION  ${LUSTRE_OUTPUT_DIR})
58
				else()
59
					message("${L} is not CEX\n ${${L}_output}")
60
				endif()
41 61
			else()
42
				message("${L} is not CEX\n ${${L}_output}")
62
				message("${L}.xml Error")
43 63
			endif()
44
		else()
45
			message("${L} Error")
46 64
		endif()
47
	endif()
48 65
	  
49 66
  ENDFOREACH()
50 67

  
......
68 85
					NODE ${ZUSTRE_NODE_OPT}
69 86
					OPTS ${ZUSTRE_OPTIONS_OPT})
70 87
	set(ZUS_OPTS_CUT ${ZUSTRE_OPTS_POSTFIX_${L}})
88
	set(ZUSTRE_OUTPUT_DIR ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}})
71 89
	
72 90
	set(ZUSTRE_ARGS_TEMP "${ZUSTRE_ARGS_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}" "> ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml")
73 91
    JOIN("${ZUSTRE_ARGS_TEMP}" " " ZUSTRE_ARGS)
74 92
    
75 93
	add_test(NAME Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
76 94
			COMMAND bash -c "${ZUSTRE_COMPILER} ${ZUSTRE_ARGS}"
77
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
95
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
78 96
	)
79 97
	SET_TESTS_PROPERTIES (  Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
80 98
			PROPERTIES FAIL_REGULAR_EXPRESSION "AssertionError;ERROR;Failed"
......
83 101
			
84 102
	add_test(NAME Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
85 103
			COMMAND bash -c "tail -n +8 ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml > ${L}_tailed1.xml"
86
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
104
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
87 105
			#DEPENDS Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
88 106
	)
107
	SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
108
	 PROPERTIES REQUIRED_FILES  ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml
109
				DEPENDS Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT})
89 110
	
90 111
	add_test(NAME Kind_fmcad08_large_CEX_TAIL2_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
91 112
			COMMAND bash -c "tail -n +8 ${L}.xml > ${L}_tailed2.xml"
92 113
			WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${L}/
93 114
	)
94
					
115
	SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_TAIL2_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
116
	 PROPERTIES REQUIRED_FILES  ${L}.xml
117
				DEPENDS Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT})
118
				
119
				
95 120
	add_test(NAME Kind_fmcad08_large_CEX_DIFF_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
96
			COMMAND bash -c "diff  ${L}_tailed1.xml  ../${L}_tailed2.xml"
97
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
121
			COMMAND ${CMAKE_COMMAND} -E compare_files  ${L}_tailed1.xml  ../${L}_tailed2.xml
122
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
98 123
	)
99 124
	SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_DIFF_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
100 125
	 PROPERTIES REQUIRED_FILES  ${L}_tailed1.xml
101
				DEPENDS Kind_fmcad08_large_CEX_TAIL1_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT} )	
126
				DEPENDS Kind_fmcad08_large_CEX_TAIL2_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT})	
102 127

  
103 128
	
104 129
	if(EXISTS ${CMAKE_BINARY_DIR}/modules/XPathParser_lusi.class)
130
	    #message("add tests for comaring Zustre and lustrec in large/src/CEX")
105 131
		add_test(NAME Kind_fmcad08_large_CEX_XPathParser_lusi_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
106 132
			COMMAND ${JAVA_RUNTIME} -cp ${CMAKE_BINARY_DIR}/modules/ XPathParser_lusi ${ZUSTRE_NODE_OPT} ../${L}.lusi ${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}.xml
107
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
133
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
108 134
		)
109 135
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_XPathParser_lusi_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
110 136
		 PROPERTIES REQUIRED_FILES  ${CMAKE_CURRENT_BINARY_DIR}/${L}/${L}.lusi 
......
115 141
		Lustre_Compile(LUS_FILE ${lus_file}
116 142
						NODE ${LUSTRE_NODE_OPT}
117 143
						OPTS ""
118
						DIR ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}})
144
						DIR ${ZUSTRE_OUTPUT_DIR})
119 145
						
120 146
		set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
121 147
		add_test(NAME Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
122 148
				COMMAND  ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}} 
123
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
149
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
124 150
		)
125 151

  
126 152
		 #********************* make -f ${L}.makefile ***************************
127 153
		 add_test(NAME Kind_fmcad08_large_CEX_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
128 154
				COMMAND  make -f ${L}.makefile
129
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
155
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
130 156
		)
131 157
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_MAKE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
132 158
		 PROPERTIES DEPENDS Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
......
139 165
			add_test(
140 166
				NAME Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT} 
141 167
				COMMAND ${BASH} -c "./${L}_${LUSTRE_NODE_OPT} < input_values > ${L}_${LUSTRE_NODE_OPT}_outputs"
142
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
168
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
143 169
			)
144 170
			SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
145 171
				PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}
......
149 175
		endif()
150 176

  
151 177
		 #************** execute C binary **********************************
152
		 add_test(NAME Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
153
				COMMAND ${CMAKE_COMMAND} -E compare_files ${L}_${LUSTRE_NODE_OPT}_outputs xml_output_values
154
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
178
		 add_test(NAME Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF_LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
179
				COMMAND ${CMAKE_COMMAND} -E compare_files ${L}_${LUSTRE_NODE_OPT}_outputs ZUSTRE_output_values
180
				WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR}
155 181
		)
156
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
182
		SET_TESTS_PROPERTIES ( Kind_fmcad08_large_CEX_COMPARE_OUTPUTS_OF_LUSTREC_ZUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}
157 183
		 PROPERTIES REQUIRED_FILES ${L}_${LUSTRE_NODE_OPT}_outputs
158 184
					DEPENDS Kind_fmcad08_large_CEX_BIN_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT} )
159
		
185
					
186
					
187

  
160 188
	endif()
161 189
	
162 190
ENDFOREACH()
163

  
191
add_custom_target(Kind_fmcad08_large_CEX COMMAND ${CMAKE_CTEST_COMMAND} -R Kind_fmcad08_large_CEX)
164 192

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/SAFE/CMakeLists.txt
52 52

  
53 53
ENDFOREACH()
54 54

  
55
add_custom_target(Kind_fmcad08_large_SAFE COMMAND ${CMAKE_CTEST_COMMAND} -R Kind_fmcad08_large_SAFE)
55 56

  
regression_tests/lustre_files/success/kind_fmcad08/large/src/TIMEOUT/CMakeLists.txt
51 51
				
52 52

  
53 53
ENDFOREACH()
54

  
54
add_custom_target(Kind_fmcad08_large_TIMEOUT COMMAND ${CMAKE_CTEST_COMMAND} -R Kind_fmcad08_large_TIMEOUT)
55 55

  
regression_tests/modules/XPathParser_lusi.java
150 150
		PrintWriter writer_in, writer_out;
151 151
		try {
152 152
			writer_in = new PrintWriter("input_values", "UTF-8");
153
			writer_out = new PrintWriter("xml_output_values", "UTF-8");
153
			writer_out = new PrintWriter("ZUSTRE_output_values", "UTF-8");
154 154
			for(int instant=0; instant<nbInstants; instant++){
155 155
				for (Iterator<String> iterator = inputs_names.iterator(); iterator.hasNext();) {
156 156
					String name = iterator.next();

Also available in: Unified diff