Project

General

Profile

Revision 4f76e5f5

View differences:

regression_tests/lustre_files/success/CMakeLists.txt
9 9
add_subdirectory(lego_robot)
10 10
add_subdirectory(linear_ctl)
11 11
add_subdirectory(mpfr)
12
add_subdirectory(lusic)
regression_tests/lustre_files/success/lusic/CMakeLists.txt
1
cmake_minimum_required(VERSION 2.8.4)
2
include(FindUnixCommands)
3

  
4

  
5
set(GLOBAL_LUSTRE_FILES "test2.lus" "test1.lus")
6
FOREACH(lus_file ${GLOBAL_LUSTRE_FILES})
7
	get_filename_component(L ${lus_file} NAME_WE)
8
	set(LUSTRE_NODE_OPT  "")
9
	#first combination :
10
	set(LUSTRE_OPTIONS_OPT "")
11

  
12
	
13
	# First command generate C files from Lustre file
14
	Lustre_Compile(LUS_FILE ${lus_file}
15
					NODE ${LUSTRE_NODE_OPT}
16
					OPTS ${LUSTRE_OPTIONS_OPT}
17
					CALL_ID "1")
18
					
19
	set(LUS_OPTS_CUT_1 "${LUSTRE_OPTS_POSTFIX_${L}_1}")
20
	add_test(NAME lusic_COMPIL_LUSTRE_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_1}
21
			COMMAND  ${LUSTRE_COMPILER} ${LUSTREC_ARGS_${L}_${LUSTRE_NODE_OPT}_${LUS_OPTS_CUT_1}} 
22
	)
23

  
24
	
25
ENDFOREACH()
26

  
27
add_custom_target(lusic COMMAND ${CMAKE_CTEST_COMMAND} -R lusic)
28

  
regression_tests/lustre_files/success/lusic/test1.lus
1
#open "test2"
2

  
3
type prod = struct { a : int; b : toto clock; };
4

  
5
type sum = enum { One, Two, Three };
6

  
7
node bool2float (x:bool) returns (y:real)
8
let
9
  y = if x then 0. else 1.;
10
tel
11

  
12
node as_soon_as (x:bool) returns (y:bool)
13
let
14
  y = x || (false -> pre y);
15
tel
regression_tests/lustre_files/success/lusic/test1.lusi
1
(* Generated Lustre Interface file from test1.lusi *)
2
(* by Lustre-C compiler version 323, 2014/6/23, 19:11:53 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
#open "test2"
6

  
7
type prod = struct {a : int; b : toto clock; }; 
8

  
9
type sum = enum {One, Two, Three }; 
10

  
11
function bool2float (x: bool) returns (y: real);
12

  
13
node as_soon_as (x: bool) returns (y: bool);
14

  
regression_tests/lustre_files/success/lusic/test2.lus
1

  
2
type toto = enum { Up, Down };
3

  
4
const titi = [1, 2];
regression_tests/lustre_files/success/lusic/test2.lusi
1
(* Generated Lustre Interface file from test2.lusi *)
2
(* by Lustre-C compiler version 323, 2014/6/23, 18:25:31 *)
3
(* Feel free to mask some of the definitions by removing them from this file. *)
4

  
5
type toto = enum {Up, Down }; 
6

  
7
const titi = [1,2];
8

  
tests/lusic/test1.lus
4 4

  
5 5
type sum = enum { One, Two, Three };
6 6

  
7
node bool2float (x:bool) returns (y:float)
7
node bool2float (x:bool) returns (y:real)
8 8
let
9 9
  y = if x then 0. else 1.;
10 10
tel

Also available in: Unified diff