https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120591
Bug ID: 120591 Summary: sarif tests depend on (length of) directory name Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: testsuite Assignee: unassigned at gcc dot gnu.org Reporter: gjl at gcc dot gnu.org Target Milestone: --- When doing regression tests, I found that a sarif test depends on the directory name of builddir, which leads to extra extra noise in the testsuite results: # Comparing directories ## Dir1=/home/gjl/gnu/build/gcc-15-avr/gcc/testsuite/: 1 sum files ## Dir2=/home/gjl/gnu/build/gcc-15-x/gcc/testsuite/: 1 sum files # Comparing 1 common sum files ## /bin/sh /home/gjl/gnu/source/gcc-master/contrib/compare_tests /tmp/gxx-sum1.1055378 /tmp/gxx-sum2.1055378 New tests that FAIL (1 tests): atmega128-sim: gcc: gcc.dg/sarif-output/bad-pragma.c bad-pragma.py::test_messages_have_embedded_urls - assert "unknown opti...s.html)' .. Old tests that failed, that have disappeared (1 tests): (Eeek!) atmega128-sim: gcc: gcc.dg/sarif-output/bad-pragma.c bad-pragma.py::test_messages_have_embedded_urls - assert "unknown opti...s.html)' ki.. ## Differences found # 1 differences in 1 common sum files found Notice the trailing ".." vs. "ki.." in the output, which makes contrib/compare_tests to report changes in the testsuite results when there are acually none. The respective part of the diff of gcc.sum looks like this: $ diff ~/gnu/build/gcc-15-*/gcc/testsuite/gcc/gcc.sum 11c11 < Running /home/gjl/gnu/source/gcc-15/gcc/testsuite/gcc.dg/sarif-output/sarif-output.exp ... --- > Running > /home/gjl/gnu/source/gcc-15-x/gcc/testsuite/gcc.dg/sarif-output/sarif-output.exp > ... 15c15 < FAIL: gcc.dg/sarif-output/bad-pragma.c bad-pragma.py::test_messages_have_embedded_urls - assert "unknown opti...s.html)' ki.. --- > FAIL: gcc.dg/sarif-output/bad-pragma.c > bad-pragma.py::test_messages_have_embedded_urls - assert "unknown > opti...s.html)' .. A diagnostic should not depend on some directory names like builddir.