@@ -276,75 +276,149 @@ t1 = now()
276
276
elapsed = canonicalize (Dates. CompoundPeriod (t1- t0))
277
277
println (" Testing finished in $elapsed " )
278
278
279
- # construct a testset to render the test results
280
- o_ts = Test. DefaultTestSet (" Overall" )
281
- Test. push_testset (o_ts)
282
- completed_tests = Set {String} ()
283
- for (testname, (resp,)) in results
284
- push! (completed_tests, testname)
285
- if isa (resp, Test. DefaultTestSet)
286
- Test. push_testset (resp)
287
- Test. record (o_ts, resp)
288
- Test. pop_testset ()
289
- elseif isa (resp, Tuple{Int,Int})
290
- fake = Test. DefaultTestSet (testname)
291
- for i in 1 : resp[1 ]
292
- Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
293
- end
294
- for i in 1 : resp[2 ]
295
- Test. record (fake, Test. Broken (:test , nothing ))
279
+ @static if VERSION < v " 1.13.0-DEV.1044"
280
+ # construct a testset to render the test results
281
+ o_ts = Test. DefaultTestSet (" Overall" )
282
+ Test. push_testset (o_ts)
283
+ completed_tests = Set {String} ()
284
+ for (testname, (resp,)) in results
285
+ push! (completed_tests, testname)
286
+ if isa (resp, Test. DefaultTestSet)
287
+ Test. push_testset (resp)
288
+ Test. record (o_ts, resp)
289
+ Test. pop_testset ()
290
+ elseif isa (resp, Tuple{Int,Int})
291
+ fake = Test. DefaultTestSet (testname)
292
+ for i in 1 : resp[1 ]
293
+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
294
+ end
295
+ for i in 1 : resp[2 ]
296
+ Test. record (fake, Test. Broken (:test , nothing ))
297
+ end
298
+ Test. push_testset (fake)
299
+ Test. record (o_ts, fake)
300
+ Test. pop_testset ()
301
+ elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
302
+ println (" Worker $(resp. pid) failed running test $(testname) :" )
303
+ Base. showerror (stdout , resp. captured)
304
+ println ()
305
+ fake = Test. DefaultTestSet (testname)
306
+ for i in 1 : resp. captured. ex. pass
307
+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
308
+ end
309
+ for i in 1 : resp. captured. ex. broken
310
+ Test. record (fake, Test. Broken (:test , nothing ))
311
+ end
312
+ for t in resp. captured. ex. errors_and_fails
313
+ Test. record (fake, t)
314
+ end
315
+ Test. push_testset (fake)
316
+ Test. record (o_ts, fake)
317
+ Test. pop_testset ()
318
+ else
319
+ if ! isa (resp, Exception)
320
+ resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
321
+ end
322
+ # If this test raised an exception that is not a remote testset exception,
323
+ # i.e. not a RemoteException capturing a TestSetException that means
324
+ # the test runner itself had some problem, so we may have hit a segfault,
325
+ # deserialization errors or something similar. Record this testset as Errored.
326
+ fake = Test. DefaultTestSet (testname)
327
+ Test. record (fake, Test. Error (:nontest_error , testname, nothing , Any[(resp, [])], LineNumberNode (1 )))
328
+ Test. push_testset (fake)
329
+ Test. record (o_ts, fake)
330
+ Test. pop_testset ()
296
331
end
332
+ end
333
+ for test in all_tests
334
+ (test in completed_tests) && continue
335
+ fake = Test. DefaultTestSet (test)
336
+ Test. record (fake, Test. Error (:test_interrupted , test, nothing ,
337
+ [(" skipped" , [])], LineNumberNode (1 )))
297
338
Test. push_testset (fake)
298
339
Test. record (o_ts, fake)
299
340
Test. pop_testset ()
300
- elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
301
- println (" Worker $(resp. pid) failed running test $(testname) :" )
302
- Base. showerror (stdout , resp. captured)
303
- println ()
304
- fake = Test. DefaultTestSet (testname)
305
- for i in 1 : resp. captured. ex. pass
306
- Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
307
- end
308
- for i in 1 : resp. captured. ex. broken
309
- Test. record (fake, Test. Broken (:test , nothing ))
341
+ end
342
+ println ()
343
+ Test. print_test_results (o_ts, 1 )
344
+ if ! o_ts. anynonpass
345
+ println (" \0 33[32;1mSUCCESS\0 33[0m" )
346
+ else
347
+ println (" \0 33[31;1mFAILURE\0 33[0m\n " )
348
+ Test. print_test_errors (o_ts)
349
+ throw (Test. FallbackTestSetException (" Test run finished with errors" ))
350
+ end
351
+ else
352
+ # construct a testset to render the test results
353
+ o_ts = Test. DefaultTestSet (" Overall" )
354
+ Test. @with_testset o_ts begin
355
+ completed_tests = Set {String} ()
356
+ for (testname, (resp,)) in results
357
+ push! (completed_tests, testname)
358
+ if isa (resp, Test. DefaultTestSet)
359
+ Test. @with_testset resp begin
360
+ Test. record (o_ts, resp)
361
+ end
362
+ elseif isa (resp, Tuple{Int,Int})
363
+ fake = Test. DefaultTestSet (testname)
364
+ for i in 1 : resp[1 ]
365
+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
366
+ end
367
+ for i in 1 : resp[2 ]
368
+ Test. record (fake, Test. Broken (:test , nothing ))
369
+ end
370
+ Test. @with_testset fake begin
371
+ Test. record (o_ts, fake)
372
+ end
373
+ elseif isa (resp, RemoteException) && isa (resp. captured. ex, Test. TestSetException)
374
+ println (" Worker $(resp. pid) failed running test $(testname) :" )
375
+ Base. showerror (stdout , resp. captured)
376
+ println ()
377
+ fake = Test. DefaultTestSet (testname)
378
+ for i in 1 : resp. captured. ex. pass
379
+ Test. record (fake, Test. Pass (:test , nothing , nothing , nothing , nothing ))
380
+ end
381
+ for i in 1 : resp. captured. ex. broken
382
+ Test. record (fake, Test. Broken (:test , nothing ))
383
+ end
384
+ for t in resp. captured. ex. errors_and_fails
385
+ Test. record (fake, t)
386
+ end
387
+ Test. @with_testset fake begin
388
+ Test. record (o_ts, fake)
389
+ end
390
+ else
391
+ if ! isa (resp, Exception)
392
+ resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
393
+ end
394
+ # If this test raised an exception that is not a remote testset exception,
395
+ # i.e. not a RemoteException capturing a TestSetException that means
396
+ # the test runner itself had some problem, so we may have hit a segfault,
397
+ # deserialization errors or something similar. Record this testset as Errored.
398
+ fake = Test. DefaultTestSet (testname)
399
+ Test. record (fake, Test. Error (:nontest_error , testname, nothing , Base. ExceptionStack ([(exception= resp,backtrace= [])]), LineNumberNode (1 )))
400
+ Test. @with_testset fake begin
401
+ Test. record (o_ts, fake)
402
+ end
403
+ end
310
404
end
311
- for t in resp. captured. ex. errors_and_fails
312
- Test. record (fake, t)
405
+ end
406
+ for test in all_tests
407
+ (test in completed_tests) && continue
408
+ fake = Test. DefaultTestSet (test)
409
+ Test. record (fake, Test. Error (:test_interrupted , test, nothing , Base. ExceptionStack ([(exception= " skipped" ,backtrace= [])]), LineNumberNode (1 )))
410
+ Test. @with_testset fake begin
411
+ Test. record (o_ts, fake)
313
412
end
314
- Test. push_testset (fake)
315
- Test. record (o_ts, fake)
316
- Test. pop_testset ()
413
+ end
414
+ println ()
415
+ Test. print_test_results (o_ts, 1 )
416
+ if ! o_ts. anynonpass
417
+ println (" \0 33[32;1mSUCCESS\0 33[0m" )
317
418
else
318
- if ! isa (resp, Exception)
319
- resp = ErrorException (string (" Unknown result type : " , typeof (resp)))
320
- end
321
- # If this test raised an exception that is not a remote testset exception,
322
- # i.e. not a RemoteException capturing a TestSetException that means
323
- # the test runner itself had some problem, so we may have hit a segfault,
324
- # deserialization errors or something similar. Record this testset as Errored.
325
- fake = Test. DefaultTestSet (testname)
326
- Test. record (fake, Test. Error (:nontest_error , testname, nothing , Any[(resp, [])], LineNumberNode (1 )))
327
- Test. push_testset (fake)
328
- Test. record (o_ts, fake)
329
- Test. pop_testset ()
419
+ println (" \0 33[31;1mFAILURE\0 33[0m\n " )
420
+ Test. print_test_errors (o_ts)
421
+ throw (Test. FallbackTestSetException (" Test run finished with errors" ))
330
422
end
331
423
end
332
- for test in all_tests
333
- (test in completed_tests) && continue
334
- fake = Test. DefaultTestSet (test)
335
- Test. record (fake, Test. Error (:test_interrupted , test, nothing ,
336
- [(" skipped" , [])], LineNumberNode (1 )))
337
- Test. push_testset (fake)
338
- Test. record (o_ts, fake)
339
- Test. pop_testset ()
340
- end
341
- println ()
342
- Test. print_test_results (o_ts, 1 )
343
- if ! o_ts. anynonpass
344
- println (" \0 33[32;1mSUCCESS\0 33[0m" )
345
- else
346
- println (" \0 33[31;1mFAILURE\0 33[0m\n " )
347
- Test. print_test_errors (o_ts)
348
- throw (Test. FallbackTestSetException (" Test run finished with errors" ))
349
- end
350
424
0 commit comments