Project

General

Profile

Revision 6304ff63 regression_tests/lustre_files/success/Stateflow/CMakeLists.txt

View differences:

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