X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Ftests.pm;fp=src%2Ftests%2Ftests.pm;h=e167cf5d835d9604421e7aab4c24869da9e81fdc;hb=9750868b9c1fc53f2ac25bd7fe0f6152cc55ff03;hp=74b69054936205970c150197bcfd1f023f45f79a;hpb=7bdfa163281617e45add7058dfb9b1a27d064a1f;p=pintos-anon diff --git a/src/tests/tests.pm b/src/tests/tests.pm index 74b6905..e167cf5 100644 --- a/src/tests/tests.pm +++ b/src/tests/tests.pm @@ -149,10 +149,22 @@ sub compare_output { my (@output) = get_core_output ($run, @$output); fail "\u$run didn't produce any output" if !@output; - if (exists $options{IGNORE_EXIT_CODES}) { + my $ignore_exit_codes = exists $options{IGNORE_EXIT_CODES}; + if ($ignore_exit_codes) { delete $options{IGNORE_EXIT_CODES}; @output = grep (!/^[a-zA-Z0-9-_]+: exit\(\d+\)$/, @output); } + my $ignore_user_faults = exists $options{IGNORE_USER_FAULTS}; + if ($ignore_user_faults) { + delete $options{IGNORE_USER_FAULTS}; + @output = grep (!/^Page fault at.*in user context\.$/ + && !/: dying due to interrupt 0x0e \(.*\).$/ + && !/^Interrupt 0x0e \(.*\) at eip=/ + && !/^ cr2=.* error=.*/ + && !/^ eax=.* ebx=.* ecx=.* edx=.*/ + && !/^ esi=.* edi=.* esp=.* ebp=.*/ + && !/^ cs=.* ds=.* es=.* ss=.*/, @output); + } die "unknown option " . (keys (%options))[0] . "\n" if %options; my ($msg); @@ -196,6 +208,10 @@ sub compare_output { } # Failed to match. Report failure. + $msg .= "\n(Process exit codes are excluded for matching purposes.)\n" + if $ignore_exit_codes; + $msg .= "\n(User fault messages are excluded for matching purposes.)\n" + if $ignore_user_faults; fail "Test output failed to match any acceptable form.\n\n$msg"; }