You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously every invocation unconditionally enabled tracing to the
hardcoded "test86.log", which is both pure overhead when nobody's
reading it and actively broken under runall.sh -- all 32 parallel
workers raced to write the same file. -t now opts into tracing for
one-off single-file debugging; the parallel suite runtime dropped from
5.9s to 2.0s with it off by default. All 327 tests still pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
// Tracing is off by default: every parallel worker in runall.sh would otherwise
449
+
// enable it and race to write the same hardcoded "test86.log", which is both wasted
450
+
// I/O (nobody's reading it during a bulk run) and produces a corrupted/interleaved
451
+
// log anyway. Pass -t for one-off single-file debugging.
452
+
453
+
bool trace = false;
454
+
constchar * path = 0;
455
+
for ( int i = 1; i < argc; i++ )
456
+
{
457
+
if ( !strcmp( argv[ i ], "-t" ) )
458
+
trace = true;
459
+
elseif ( 0 == path )
460
+
path = argv[ i ];
461
+
else
462
+
path = 0; // too many non-flag arguments; fall through to the usage error below
463
+
}
464
+
465
+
if ( 0 == path )
466
+
fail( "usage: %s [-t] filename.json\n -t enable instruction tracing to test86.log (single-file runs only --\n don't use this under runall.sh, every parallel worker would race to\n write the same log)\n", argv[ 0 ] );
451
467
452
-
if ( 2 != argc )
453
-
fail( "usage: %s filename.json\n", argv[0] );
468
+
if ( trace )
469
+
{
470
+
tracer.Enable( true, "test86.log", true );
471
+
tracer.SetQuiet( true );
472
+
cpu.trace_instructions( true );
473
+
}
454
474
455
-
run_tests( argv[ 1 ] );
475
+
run_tests( path );
456
476
457
477
if ( 0 == tests_failed )
458
-
printf( "test86 completed %llu tests in %s with great success\n", tests_run, argv[ 1 ] );
478
+
printf( "test86 completed %llu tests in %s with great success\n", tests_run, path );
459
479
else
460
-
printf( "test86 completed %llu tests with %llu failures in %s\n", tests_run, tests_failed, argv[ 1 ] );
480
+
printf( "test86 completed %llu tests with %llu failures in %s\n", tests_run, tests_failed, path );
461
481
462
482
return ( 0 == tests_failed ) ? 0 : 1; // so callers can trust the exit code instead of having to parse stdout
0 commit comments