Unverified Commit dc49721f authored by boklm's avatar boklm
Browse files

Bug 29675: Make it possible to have errors in pre_tests

If the pre_tests function defines $tbbinfos->{pre_tests_error},
then the testsuite run is failed, and the tests are not run.

The content of $tbbinfos->{pre_tests_error} is shown in the tests
report.
parent cd35d96c
......@@ -226,6 +226,7 @@ sub test_start {
my %testsuite_infos = TBBTestSuite::TestSuites::testsuite_infos();
my $testsuite = $testsuite_infos{$tbbinfos->{type}};
$tbbinfos->pre_tests();
$tbbinfos->{tests} = [] if $tbbinfos->{pre_tests_error};
$tbbinfos->{start_time} = time;
run_tests($tbbinfos);
$tbbinfos->{finish_time} = time;
......@@ -233,7 +234,8 @@ sub test_start {
$tbbinfos->post_tests();
chdir $oldcwd;
check_known_issues($tbbinfos);
$tbbinfos->{success} = is_success($tbbinfos->{tests});
$tbbinfos->{success} = $tbbinfos->{pre_tests_error} ? 0
: is_success($tbbinfos->{tests});
$report->{tbbfiles}{$tbbinfos->{filename}} = $tbbinfos;
}
......
......@@ -136,6 +136,12 @@
[% END %]
<h1>Results</h1>
[% IF tbbfiles.$tbbfile.pre_tests_error %]
<h2>pre_tests error</h2>
<pre>
[% tbbfiles.$tbbfile.pre_tests_error %]
</pre>
[% END %]
[% FOREACH test IN tbbfiles.$tbbfile.tests %]
[% IF ! test.results; NEXT; END %]
<a href="javascript:togglecontent('test_[% test.name %]');">
......
......@@ -7,6 +7,12 @@ Bundle infos
sha256sum: [% tbbfiles.$tbbfile.sha256sum %]
Results
[% IF tbbfiles.$tbbfile.pre_tests_error -%]
pre_tests error:
[% FILTER indent(' ') -%]
[% tbbfiles.$tbbfile.pre_tests_error %]
[% END %]
[% END -%]
[% FOREACH test IN tbbfiles.$tbbfile.tests -%]
[% IF test.results -%]
[% test.name %]: [% test.results.success ? 'ok' : 'failed (' _ test.fail_type _ ')' %]
......
......@@ -4,6 +4,12 @@ Bundle infos
Results
[% IF tbbfiles.$tbbfile.pre_tests_error -%]
pre_tests error:
[% FILTER indent(' ') -%]
[% tbbfiles.$tbbfile.pre_tests_error %]
[% END %]
[% END -%]
[%
FOREACH test IN tbbfiles.$tbbfile.tests;
NEXT IF test.type != 'virustotal';
......
[% IF tbbfiles.$tbbfile.pre_tests_error -%]
pre_tests error:
[% FILTER indent(' ') -%]
[% tbbfiles.$tbbfile.pre_tests_error %]
[% END %]
[% END -%]
[% FOREACH test IN tbbfiles.$tbbfile.tests -%]
[% IF test.results -%]
[% test.name %]: [% test.results.success ? 'ok' : 'failed (' _ test.fail_type _ ')' %]
......
Results
[% IF tbbfiles.$tbbfile.pre_tests_error -%]
pre_tests error:
[% FILTER indent(' ') -%]
[% tbbfiles.$tbbfile.pre_tests_error %]
[% END %]
[% END -%]
[% FOREACH test IN tbbfiles.$tbbfile.tests -%]
[% IF test.results -%]
[% test.name %]: [% test.results.success ? 'ok' : 'failed (' _ test.fail_type _ ')' %]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment