Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

lustrec-tests / regression_tests / lustre_files / success / kind_fmcad08 / large / src / CEX / CMakeLists.txt @ 7d3c8bd3

History | View | Annotate | Download (2.55 KB)

1
cmake_minimum_required(VERSION 2.8.4)
2

    
3

    
4

    
5
if(ZUSTRE_COMPILER)
6
  message(STATUS "Found zustre: ${ZUSTRE_COMPILER} ")
7
else(ZUSTRE_COMPILER)
8
  message(FATAL_ERROR "zustre not found")
9
endif(ZUSTRE_COMPILER)
10

    
11

    
12

    
13

    
14
#first combination :no option
15
set(ZUSTRE_OPTIONS_OPT "--timeout" "60" "--xml" )
16
#take all lustre files
17
  set(GLOBAL_LUSTRE_FILES "")
18
  LUSTREFILES(LFILES ${CMAKE_CURRENT_SOURCE_DIR} )
19
  list(APPEND GLOBAL_LUSTRE_FILES ${LFILES})
20
  FOREACH(lfile ${LFILES})
21
	  get_filename_component(L ${lfile} NAME_WE)
22
	  set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${L}")
23
	  file(COPY ${lfile}   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}})
32
		execute_process(RESULT_VARIABLE res 
33
					OUTPUT_VARIABLE ${L}_output
34
					COMMAND  ${ZUSTRE_COMPILER} ${ZUSTRE_ARGS_${L}_top_${ZUS_OPTS_CUT}} 
35
					WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
36
		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})
41
			else()
42
				message("${L} is not CEX\n ${${L}_output}")
43
			endif()
44
		else()
45
			message("${L} Error")
46
		endif()
47
	endif()
48
	  
49
  ENDFOREACH()
50

    
51

    
52

    
53

    
54
FOREACH(lus_file ${GLOBAL_LUSTRE_FILES})
55
	get_filename_component(L ${lus_file} NAME_WE)
56
	set(ZUSTRE_NODE_OPT  "top")
57

    
58
	Lustre_Compile(LUS_FILE ${lus_file}
59
					NODE ""
60
					OPTS "-horn")
61
					
62
	set(LUS_OPTS_CUT ${LUSTRE_OPTS_POSTFIX_${L}})
63
	add_test(NAME Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
64
			COMMAND  ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT}} 
65
	)
66

    
67
	Zustre_Compile(LUS_FILE ${lus_file}
68
					NODE ${ZUSTRE_NODE_OPT}
69
					OPTS ${ZUSTRE_OPTIONS_OPT})
70
	set(ZUS_OPTS_CUT ${ZUSTRE_OPTS_POSTFIX_${L}})
71
	
72

    
73
	add_test(NAME Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
74
			COMMAND  ${ZUSTRE_COMPILER} ${ZUSTRE_ARGS_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}} 
75
			WORKING_DIRECTORY ${ZUSTRE_OUTPUT_DIR_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}}
76
	)
77
	SET_TESTS_PROPERTIES (  Kind_fmcad08_large_CEX_COMPIL_ZUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT}
78
			PROPERTIES PASS_REGULAR_EXPRESSION "<Answer>CEX</Answer>"
79
					DEPENDS Kind_fmcad08_large_CEX_COMPIL_LUSTRE_${L}_${ZUSTRE_NODE_OPT}_${ZUS_OPTS_CUT})
80
				
81

    
82
ENDFOREACH()
83

    
84