• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1##############################################################################
2# Copyright 2005-2009 Andreas Huber Doenni
3# Distributed under the Boost Software License, Version 1.0. (See accompany-
4# ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5##############################################################################
6
7project libs/statechart/test ;
8
9local test_monitor =
10  ../../../libs/test/build//boost_test_exec_monitor/<link>static ;
11# Some platforms have either problems with the automatic detection of the
12# threading mode (e.g. vc-7_1 & gcc >= 3.4.0) or don't support single-
13# threaded mode (e.g. vc-8_0). We therefore manually turn MT off here
14local st-requirements = <define>BOOST_DISABLE_THREADS ;
15local dll = <define>BOOST_STATECHART_TEST_DYNAMIC_LINK ;
16local dll-export = $(dll) <define>BOOST_STATECHART_TEST_DLL_EXPORT ;
17
18local normal = ;
19local native = <define>BOOST_STATECHART_USE_NATIVE_RTTI ;
20local relaxed = <define>BOOST_STATECHART_RELAX_TRANSITION_CONTEXT ;
21local both = $(native) $(relaxed) ;
22
23rule independent-obj-build ( name : cpp-sources + : requirements * )
24{
25  local objs ;
26
27  for local cpp-source in $(cpp-sources)
28  {
29    obj $(name)$(cpp-source) : $(cpp-source).cpp : $(requirements) ;
30    objs += $(name)$(cpp-source) ;
31  }
32
33  return $(objs) ;
34}
35
36rule statechart-st-lib ( name : cpp-sources + : requirements * )
37{
38  local reqs =
39    <threading>single $(st-requirements)
40    <link>shared\:$(dll-export) $(requirements) ;
41
42  lib $(name)
43    : [ independent-obj-build $(name)
44          : $(cpp-sources)
45          : $(reqs) ] : $(reqs) ;
46
47  return $(name) ;
48}
49
50rule statechart-run ( name : sources + : requirements * )
51{
52  return [ run $(sources) $(test_monitor) : : : $(requirements) : $(name) ] ;
53}
54
55rule statechart-st-run ( name : sources + : requirements * )
56{
57  return [ statechart-run $(name) : $(sources)
58             : <threading>single $(st-requirements) $(requirements) ] ;
59}
60
61rule statechart-st-run-variants ( cpp-source )
62{
63  local result ;
64
65  result += [ statechart-st-run $(cpp-source)Normal
66                : $(cpp-source).cpp : $(normal) ] ;
67  result += [ statechart-st-run $(cpp-source)Native
68                : $(cpp-source).cpp : $(native) ] ;
69  result += [ statechart-st-run $(cpp-source)Relaxed
70                : $(cpp-source).cpp : $(relaxed) ] ;
71  result += [ statechart-st-run $(cpp-source)Both
72                : $(cpp-source).cpp : $(both) ] ;
73
74  return $(result) ;
75}
76
77rule statechart-compile-fail ( name : cpp-sources + : requirements * )
78{
79  return [ compile-fail $(cpp-sources).cpp : $(requirements) : $(name) ] ;
80}
81
82rule statechart-compile-fail-variants ( cpp-source )
83{
84  local result ;
85
86  result += [ statechart-compile-fail $(cpp-source)Normal
87                : $(cpp-source) : $(normal) ] ;
88  result += [ statechart-compile-fail $(cpp-source)Native
89                : $(cpp-source) : $(native) ] ;
90  result += [ statechart-compile-fail $(cpp-source)Relaxed
91                : $(cpp-source) : $(relaxed) ] ;
92  result += [ statechart-compile-fail $(cpp-source)Both
93                : $(cpp-source) : $(both) ] ;
94
95  return $(result) ;
96}
97
98rule statechart-st-lib-run (
99  name : exe-cpp-sources + : lib-cpp-sources + : requirements * )
100{
101  return [ statechart-st-run $(name)
102             : $(exe-cpp-sources).cpp
103               [ statechart-st-lib $(name)Lib
104                   : $(lib-cpp-sources) : $(requirements) ]
105             : <link>shared\:$(dll) $(requirements) ] ;
106}
107
108rule statechart-st-compile-example ( name : directory : cpp-sources + )
109{
110  return [ link ../example/$(directory)/$(cpp-sources).cpp
111             : <threading>single $(st-requirements) : $(name)Example ] ;
112}
113
114test-suite statechart
115  : [ statechart-compile-fail-variants InvalidChartTest1 ]
116    [ statechart-compile-fail-variants InvalidChartTest2 ]
117    [ statechart-compile-fail-variants InvalidChartTest3 ]
118    [ statechart-st-run-variants TransitionTest ]
119    [ statechart-compile-fail-variants InvalidTransitionTest1 ]
120    [ statechart-compile-fail-variants InvalidTransitionTest2 ]
121    [ statechart-st-run-variants InStateReactionTest ]
122    [ statechart-st-run-variants TerminationTest ]
123    [ statechart-st-run-variants DeferralTest ]
124    [ statechart-st-run-variants DeferralBug ]
125    [ statechart-st-run-variants CustomReactionTest ]
126    [ statechart-compile-fail-variants InvalidResultAssignTest ]
127    [ statechart-compile-fail-variants InvalidResultDefCtorTest ]
128    [ statechart-st-run-variants InvalidResultCopyTest ]
129    [ statechart-st-run-variants UnconsumedResultTest ]
130    [ statechart-st-run-variants HistoryTest ]
131    [ statechart-compile-fail-variants InconsistentHistoryTest1 ]
132    [ statechart-compile-fail-variants InconsistentHistoryTest2 ]
133    [ statechart-compile-fail-variants InconsistentHistoryTest3 ]
134    [ statechart-compile-fail-variants InconsistentHistoryTest4 ]
135    [ statechart-compile-fail-variants InconsistentHistoryTest5 ]
136    [ statechart-compile-fail-variants InconsistentHistoryTest6 ]
137    [ statechart-compile-fail-variants InconsistentHistoryTest7 ]
138    [ statechart-compile-fail-variants InconsistentHistoryTest8 ]
139    [ statechart-compile-fail-variants UnsuppDeepHistoryTest ]
140    [ statechart-st-run-variants StateCastTest ]
141    [ statechart-st-run-variants TypeInfoTest ]
142    [ statechart-st-run-variants StateIterationTest ]
143    [ statechart-st-run-variants FifoSchedulerTest ]
144    [ statechart-st-run-variants TriggeringEventTest ]
145    [ statechart-st-lib-run LibTestNormal
146        : TuTestMain : TuTest : <link>static $(normal) ]
147    [ statechart-st-lib-run LibTestNative
148        : TuTestMain : TuTest : <link>static $(native) ]
149    [ statechart-st-lib-run DllTestNormal
150        : TuTestMain : TuTest : <link>shared $(normal) ]
151    [ statechart-st-lib-run DllTestNative
152        : TuTestMain : TuTest : <link>shared $(native) ]
153    [ statechart-st-compile-example BitMachine : BitMachine : BitMachine ]
154    [ statechart-st-compile-example Camera
155        : Camera : Camera Configuring Main Shooting ]
156    [ statechart-st-compile-example Handcrafted : Handcrafted : Handcrafted ]
157    [ statechart-st-compile-example Keyboard : Keyboard : Keyboard : ]
158    [ statechart-st-compile-example Performance : Performance : Performance ]
159    [ statechart-st-compile-example PingPong : PingPong : PingPong Player ]
160    [ statechart-st-compile-example StopWatch : StopWatch : StopWatch ]
161    [ statechart-st-compile-example StopWatch2 : StopWatch : StopWatch2 ] ;
162