@@ -440,67 +440,128 @@ elapsed = canonicalize(Dates.CompoundPeriod(t1-t0))
440440println (" Testing finished in $elapsed " )
441441
442442# construct a testset to render the test results
443- o_ts = Test. DefaultTestSet (" Overall" )
444- Test. push_testset (o_ts)
445443completed_tests = Set {String} ()
446- for (testname, (resp,)) in results
447- push! (completed_tests, testname)
448- if isa (resp, Test. DefaultTestSet)
449- Test. push_testset (resp)
450- Test. record (o_ts, resp)
451- Test. pop_testset ()
452- elseif isa (resp, Tuple{Int,Int})
453- fake = Test. DefaultTestSet (testname)
454- for i in 1 : resp[1 ]
455- Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
456- end
457- for i in 1 : resp[2 ]
458- Test. record (fake, Test. Broken (:test , nothing ))
459- end
460- Test. push_testset (fake)
461- Test. record (o_ts, fake)
462- Test. pop_testset ()
463- elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
464- println (" Worker $(resp. pid) failed running test $(testname) :" )
465- Base. showerror (stdout , resp. captured)
466- println ()
467- fake = Test. DefaultTestSet (testname)
468- for i in 1 : resp. captured. ex. pass
469- Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
470- end
471- for i in 1 : resp. captured. ex. broken
472- Test. record (fake, Test. Broken (:test , nothing ))
444+ o_ts = Test. DefaultTestSet (" Overall" )
445+ @static if VERSION < v " 1.13.0-DEV.1044"
446+ Test. push_testset (o_ts)
447+ for (testname, (resp,)) in results
448+ push! (completed_tests, testname)
449+ if isa (resp, Test. DefaultTestSet)
450+ Test. push_testset (resp)
451+ Test. record (o_ts, resp)
452+ Test. pop_testset ()
453+ elseif isa (resp, Tuple{Int,Int})
454+ fake = Test. DefaultTestSet (testname)
455+ for i in 1 : resp[1 ]
456+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
457+ end
458+ for i in 1 : resp[2 ]
459+ Test. record (fake, Test. Broken (:test , nothing ))
460+ end
461+ Test. push_testset (fake)
462+ Test. record (o_ts, fake)
463+ Test. pop_testset ()
464+ elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
465+ println (" Worker $(resp. pid) failed running test $(testname) :" )
466+ Base. showerror (stdout , resp. captured)
467+ println ()
468+ fake = Test. DefaultTestSet (testname)
469+ for i in 1 : resp. captured. ex. pass
470+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
471+ end
472+ for i in 1 : resp. captured. ex. broken
473+ Test. record (fake, Test. Broken (:test , nothing ))
474+ end
475+ for t in resp. captured. ex. errors_and_fails
476+ Test. record (fake, t)
477+ end
478+ Test. push_testset (fake)
479+ Test. record (o_ts, fake)
480+ Test. pop_testset ()
481+ else
482+ if ! isa (resp, Exception)
483+ resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
484+ end
485+ # If this test raised an exception that is not a remote testset exception,
486+ # i.e. not a RemoteException capturing a TestSetException that means
487+ # the test runner itself had some problem, so we may have hit a segfault,
488+ # deserialization errors or something similar. Record this testset as Errored.
489+ fake = Test. DefaultTestSet (testname)
490+ Test. record (fake, Test. Error (:nontest_error , testname, nothing , Any[(resp, [])], LineNumberNode (1 )))
491+ Test. push_testset (fake)
492+ Test. record (o_ts, fake)
493+ Test. pop_testset ()
473494 end
474- for t in resp. captured. ex. errors_and_fails
475- Test. record (fake, t)
495+ end
496+ else
497+ Test. @with_testset o_ts begin
498+ for (testname, (resp,)) in results
499+ push! (completed_tests, testname)
500+ if isa (resp, Test. DefaultTestSet)
501+ Test. @with_testset resp begin
502+ Test. record (o_ts, resp)
503+ end
504+ elseif isa (resp, Tuple{Int,Int})
505+ fake = Test. DefaultTestSet (testname)
506+ for i in 1 : resp[1 ]
507+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
508+ end
509+ for i in 1 : resp[2 ]
510+ Test. record (fake, Test. Broken (:test , nothing ))
511+ end
512+ Test. @with_testset fake begin
513+ Test. record (o_ts, fake)
514+ end
515+ elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
516+ println (" Worker $(resp. pid) failed running test $(testname) :" )
517+ Base. showerror (stdout , resp. captured)
518+ println ()
519+ fake = Test. DefaultTestSet (testname)
520+ for i in 1 : resp. captured. ex. pass
521+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
522+ end
523+ for i in 1 : resp. captured. ex. broken
524+ Test. record (fake, Test. Broken (:test , nothing ))
525+ end
526+ for t in resp. captured. ex. errors_and_fails
527+ Test. record (fake, t)
528+ end
529+ Test. @with_testset fake begin
530+ Test. record (o_ts, fake)
531+ end
532+ else
533+ if ! isa (resp, Exception)
534+ resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
535+ end
536+ # If this test raised an exception that is not a remote testset exception,
537+ # i.e. not a RemoteException capturing a TestSetException that means
538+ # the test runner itself had some problem, so we may have hit a segfault,
539+ # deserialization errors or something similar. Record this testset as Errored.
540+ fake = Test. DefaultTestSet (testname)
541+ Test. record (fake, Test. Error (:nontest_error , testname, nothing , Base. ExceptionStack ([(exception= resp,backtrace= [])]), LineNumberNode (1 )))
542+ Test. @with_testset fake begin
543+ Test. record (o_ts, fake)
544+ end
545+ end
476546 end
547+ end
548+ end
549+ for test in tests
550+ (test in completed_tests) && continue
551+ fake = Test. DefaultTestSet (test)
552+ @static if VERSION < v " 1.13.0-DEV.1044"
553+ Test. record (fake, Test. Error (:test_interrupted , test, nothing ,
554+ [(" skipped" , [])], LineNumberNode (1 )))
477555 Test. push_testset (fake)
478556 Test. record (o_ts, fake)
479557 Test. pop_testset ()
480558 else
481- if ! isa (resp, Exception)
482- resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
559+ Test. record (fake, Test. Error (:test_interrupted , test, nothing , Base. ExceptionStack ([(exception= " skipped" ,backtrace= [])]), LineNumberNode (1 )))
560+ Test. @with_testset fake begin
561+ Test. record (o_ts, fake)
483562 end
484- # If this test raised an exception that is not a remote testset exception,
485- # i.e. not a RemoteException capturing a TestSetException that means
486- # the test runner itself had some problem, so we may have hit a segfault,
487- # deserialization errors or something similar. Record this testset as Errored.
488- fake = Test. DefaultTestSet (testname)
489- Test. record (fake, Test. Error (:nontest_error , testname, nothing , Any[(resp, [])], LineNumberNode (1 )))
490- Test. push_testset (fake)
491- Test. record (o_ts, fake)
492- Test. pop_testset ()
493563 end
494564end
495- for test in tests
496- (test in completed_tests) && continue
497- fake = Test. DefaultTestSet (test)
498- Test. record (fake, Test. Error (:test_interrupted , test, nothing ,
499- [(" skipped" , [])], LineNumberNode (1 )))
500- Test. push_testset (fake)
501- Test. record (o_ts, fake)
502- Test. pop_testset ()
503- end
504565println ()
505566Test. print_test_results (o_ts, 1 )
506567if ! o_ts. anynonpass
0 commit comments