File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,14 @@ static void die() {
84
84
85
85
bool Harness::set_scheduler (const utest_v1_scheduler_t scheduler)
86
86
{
87
- if (!scheduler.post || !scheduler.cancel )
87
+ if (!scheduler.init || !scheduler. post || !scheduler.cancel || !scheduler. run )
88
88
return false ;
89
89
90
90
::scheduler = scheduler;
91
91
return true ;
92
92
}
93
93
94
- bool Harness::run (const Specification& specification, std:: size_t )
94
+ bool Harness::run (const Specification& specification, size_t )
95
95
{
96
96
return run (specification);
97
97
}
@@ -102,7 +102,10 @@ bool Harness::run(const Specification& specification)
102
102
if (is_busy ())
103
103
return false ;
104
104
105
- if (!scheduler.post || !scheduler.cancel )
105
+ if (!scheduler.init || !scheduler.post || !scheduler.cancel || !scheduler.run )
106
+ return false ;
107
+
108
+ if (scheduler.init () != 0 )
106
109
return false ;
107
110
108
111
test_cases = specification.cases ;
@@ -143,6 +146,14 @@ bool Harness::run(const Specification& specification)
143
146
case_current = &test_cases[case_index];
144
147
145
148
scheduler.post (run_next_case, 0 );
149
+ if (scheduler.run () != 0 ) {
150
+ failure.reason = REASON_SCHEDULER;
151
+ if (handlers.test_failure ) handlers.test_failure (failure);
152
+ if (handlers.test_teardown ) handlers.test_teardown (0 , 0 , failure);
153
+ test_cases = NULL ;
154
+ exit (1 );
155
+ return true ;
156
+ }
146
157
return true ;
147
158
}
148
159
You can’t perform that action at this time.
0 commit comments