Contrib: Make dg-extract-results.py tolerant of unparseable files
The `dg-extract-results.py` script now tolerates unparseable files, preventing testsuite failures from discarding valid results.
The dg-extract-results.py script, used for consolidating test results, now handles unparseable files more gracefully. Instead of aborting when encountering a malformed input file (e.g., due to a DejaGnu crash), it emits a warning and continues processing remaining files. This prevents a single failing test from causing the entire testsuite’s results to be discarded, improving the reliability of parallel testing.
In Details
This commit modifies dg-extract-results.py in the contrib directory, which is shared between binutils-gdb and GCC. The script aggregates test results, and this change makes it more robust against malformed input files by wrapping file parsing in a try/except block. Errors are now reported as warnings to stderr instead of causing the script to exit, ensuring that the consolidated output isn't lost due to a single unparseable file. This arose due to DejaGnu EILSEQ crashes during parallel make check.
For Context
This commit improves the reliability of the testing process for GCC and related tools like GDB. A script called dg-extract-results.py combines the results of individual tests into a summary. The change ensures that if one of the individual test result files is corrupted or unreadable, the script will continue processing the other files and still produce a partial summary, rather than failing completely and losing all the test results. This is especially important when running tests in parallel, where a single crashing test could otherwise invalidate the entire test run.