| RoomModel room.basic.test { |
| |
| import room.basic.service.timing.* from "TimingService.room" |
| import room.basic.types.* from "Types.room" |
| |
| /** |
| * A SubSystemClass or ActorClass having this annotation is construed as an instance.<br> |
| * During generation the necessary instantiation (LogicalSystem, SubSystemRef etc.) and mapping will be created. |
| * <p> |
| * Must not have LogicalThreads. Globally only once allowed. Runtime execution on DefaultThread of given PhysicalSystem. |
| * </p> |
| */ |
| AnnotationType TestInstance { |
| target = { SubSystemClass, ActorClass } |
| } |
| |
| ActorClass SequentialTestExecutor { |
| Interface { |
| conjugated Port control[*]: PTestControl |
| |
| } |
| Structure { |
| usercode3 { |
| "#include \"etUnit/etUnit.h\"" |
| } |
| external Port control |
| Attribute next : int16 |
| } |
| Behavior { |
| StateMachine { |
| State execute { |
| entry |
| |
| { |
| "if(next < self->constData->control.size){" |
| "\tcontrol[next++].start();" |
| "} else {" |
| "\tetUnit_testFinished(0);" |
| "}" |
| } |
| } |
| Transition init0: initial -> execute |
| { |
| } |
| Transition tr0: execute -> execute { |
| triggers { |
| <done: control> |
| } |
| } |
| } |
| } |
| } |
| |
| ProtocolClass PTestControl { |
| incoming { |
| /** |
| * Start test execution. |
| */ |
| Message start() |
| |
| /** |
| * Abort test execution. |
| */ |
| Message abort() |
| } |
| outgoing { |
| /** |
| * Test execution finished or aborted. |
| */ |
| Message done(success : boolean) |
| } |
| // semantics { |
| // in:start -> out:done |
| // in:abort -> out:done |
| // } |
| } |
| |
| } |