Contrib: Make dg-extract-results.py tolerant of unparseable files for GDB.
The `dg-extract-results.py` script now handles malformed test output files gracefully, preventing data loss in parallel test runs.
The dg-extract-results.py script, used to consolidate test results, now tolerates unparseable files. Previously, a malformed test output file would cause the script to abort, resulting in the loss of all test results. The script now catches parsing errors, emits a warning, and continues processing remaining files, ensuring that valid results are preserved. This change primarily benefits GDB test runs, but the script resides in GCC’s contrib directory.
In Details
This commit modifies dg-extract-results.py, which is a script used in both GCC and GDB's test suites. The script aggregates results from individual test runs. The change adds a try/except block to handle potential parsing errors due to malformed test output files (e.g., from DejaGnu EILSEQ crashes). This prevents the script from aborting and losing all test data when encountering a single problematic file.
For Context
The contrib directory in GCC contains utility scripts and tools that are not part of the core compiler, but are used for development, testing, or other related tasks. The dg-extract-results.py script is used to consolidate the results of running a test suite. When tests are run in parallel, each test produces its own output file. This script merges these individual files into a comprehensive summary, making it easier to analyze the overall test results. This change improves the robustness of the test reporting process.