@@ -7,43 +7,49 @@ import {TestbedSpecification} from '../testbeds/TestbedSpecification';
77export interface Suite {
88 title : string ;
99 tests : TestScenario [ ] ;
10+ testees : Testee [ ] ;
1011}
1112
1213interface DependenceTree {
1314 test : TestScenario ;
1415 children : DependenceTree [ ] ;
1516}
1617
18+ export interface TesteeOptions {
19+ disabled ?: boolean ;
20+ timeout ?: number ;
21+ connectionTimout ?: number ;
22+ }
23+
1724export class Framework {
1825 private static implementation : Framework ;
1926
20- private testees : Testee [ ] = [ ] ;
21- private suites : Suite [ ] = [ ] ;
27+ private testSuites : Suite [ ] = [ ] ;
2228
2329 public runs : number = 1 ;
2430
2531 private constructor ( ) {
2632 }
2733
2834 private currentSuite ( ) : Suite {
29- return this . suites [ this . suites . length - 1 ] ;
35+ return this . testSuites [ this . testSuites . length - 1 ] ;
3036 }
3137
32- public testee ( name : string , specification : TestbedSpecification , scheduler : Scheduler = new HybridScheduler ( ) , disabled : boolean = false ) {
33- const testee = new Testee ( name , specification , scheduler ) ;
34- if ( disabled ) {
38+ public testee ( name : string , specification : TestbedSpecification , scheduler : Scheduler = new HybridScheduler ( ) , options : TesteeOptions = { } ) {
39+ const testee = new Testee ( name , specification , scheduler , options . timeout ?? 2000 , options . connectionTimout ?? 5000 ) ;
40+ if ( options . disabled ) {
3541 testee . skipall ( ) ;
3642 }
3743
38- this . testees . push ( testee ) ;
44+ this . currentSuite ( ) . testees . push ( testee ) ;
3945 }
4046
41- public platforms ( ) : Testee [ ] {
42- return this . testees ;
47+ public suites ( ) : Suite [ ] {
48+ return this . testSuites ;
4349 }
4450
4551 public suite ( title : string ) {
46- this . suites . push ( { title : title , tests : [ ] } ) ;
52+ this . testSuites . push ( { title : title , tests : [ ] , testees : [ ] } ) ;
4753 }
4854
4955 public test ( test : TestScenario ) {
@@ -55,8 +61,8 @@ export class Framework {
5561 }
5662
5763 public run ( cores : number = 1 ) { // todo remove cores
58- this . suites . forEach ( ( suite : Suite ) => {
59- this . testees . forEach ( ( testee : Testee ) => {
64+ this . testSuites . forEach ( ( suite : Suite ) => {
65+ suite . testees . forEach ( ( testee : Testee ) => {
6066 const order : TestScenario [ ] = testee . scheduler . schedule ( suite ) ;
6167 const first : TestScenario = order [ 0 ] ;
6268 before ( 'Initialize testbed' , async function ( ) {
0 commit comments