File tree Expand file tree Collapse file tree 4 files changed +15
-16
lines changed
Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,15 @@ export class Framework {
5757 public run ( cores : number = 1 ) { // todo remove cores
5858 this . suites . forEach ( ( suite : Suite ) => {
5959 this . testees . forEach ( ( testee : Testee ) => {
60+ const order : TestScenario [ ] = testee . scheduler . schedule ( suite ) ;
61+ const first : TestScenario = order [ 0 ] ;
62+ before ( 'Initialize testbed' , async function ( ) {
63+ this . timeout ( testee . connector . timeout ( testee . specification . type ) ) ;
64+ await testee . initialize ( first . program , first . args ?? [ ] ) ;
65+ } ) ;
66+
6067 describe ( `Testing on ${ testee . name } .` , ( ) => {
6168 // todo add parallelism
62- const order : TestScenario [ ] = testee . scheduler . schedule ( suite ) ;
6369
6470 // if (!bed.disabled) { // TODO necessary? isn't this done in de test itself?
6571 //
@@ -70,17 +76,7 @@ export class Framework {
7076 // });
7177 // }
7278
73- let initialized : boolean = false ;
74-
7579 order . forEach ( ( test : TestScenario ) => {
76- if ( ! initialized ) {
77- before ( 'Initialize testbed' , async function ( ) {
78- this . timeout ( testee . connector . timeout ( testee . specification . type ) ) ;
79- await testee . initialize ( test . program , test . args ?? [ ] ) ;
80- } ) ;
81- initialized = true ;
82- }
83-
8480 testee . describe ( test , this . runs ) ;
8581 } ) ;
8682 } ) ;
Original file line number Diff line number Diff line change @@ -106,7 +106,11 @@ export class Testee { // TODO unified with testbed interface
106106 before ( 'Compile and upload program' , async function ( ) {
107107 this . timeout ( testee . connector . timeout ( testee . specification . type ) ) ;
108108 let compiled : CompileOutput = await new CompilerFactory ( WABT ) . pickCompiler ( description . program ) . compile ( description . program ) ;
109- await testee . testbed ! . sendRequest ( new SourceMap . Mapping ( ) , Message . updateModule ( compiled . file ) ) ;
109+ try {
110+ await testee . testbed ! . sendRequest ( new SourceMap . Mapping ( ) , Message . updateModule ( compiled . file ) ) ;
111+ } catch ( e ) {
112+ await testee . initialize ( description . program , description . args ?? [ ] ) ;
113+ }
110114 } ) ;
111115
112116 before ( 'Fetch source map' , async function ( ) {
Original file line number Diff line number Diff line change @@ -16,4 +16,3 @@ export * from './framework/scenario/Invoker';
1616export * from './testbeds/TestbedSpecification' ;
1717
1818export const latch = Framework . getImplementation ( ) ;
19- export { find } from './util/util' ;
You can’t perform that action at this time.
0 commit comments