Menu

#510 Two regression-harness defects: TEST_PREFIX is inert, and a test's cases can be silently lost

open
nobody
None
5
6 days ago
6 days ago
No

Against trunk [r16743]. Two independent patches; either can be taken without the other.

0001 — TEST_PREFIX never selected anything. support/regression/Makefile.in computes the filtered stem list into TEST_STEMS_FILTERED___ and the recipe reads TEST_STEMS_FILTERED__ — one underscore short. The filter silently had no effect, so

make -C support/regression test-ucz80 TEST_PREFIX=tst_bug-3393

ran the whole suite regardless. The fix is one character.

0002 — a test's function list could be lost to its own comment. cases/mkdrv.py scans a test's leading comment for name: values substitution lines, and leaves header mode only on a line holding the closing */. It tests for the : first, so two shapes never leave header mode. The function scan then never runs and the generated driver has no cases at all — and a test with no cases reports

0 failed of 0 tests in 0 cases

which counts as a pass. The two shapes:

  • a comment line carrying both a : and the closing */, for example Origin: Hans-Peter Nilsson. */ in gte/20031201-1.c;
  • a test with no leading comment at all, so no line ever holds a */. Such a file also aborts the generator at the first line containing two colons, since re.split(':', line) then yields more values than the two being unpacked.

Fixed by checking for the end of the comment before treating a line as a substitution, entering header mode only when the file actually opens with a comment, and splitting a substitution line just once.

Effect on the suite

No test result changes. Six sources in the tree hit one of these shapes, and all six are already in the explicit GTE_SKIP_TESTS / TCC_SKIP_TESTS lists; gte, qct and tcc have their own inline driver rules in cases/Makefile.in and do not call mkdrv.py at all. For all 1565 sources the tst_% and m4_% rules do feed to it, the generated drivers are byte-identical before and after.

Limitations

  • The patch adds no coverage today, for the reason above. Its effect is that a future test matching either shape is counted rather than silently reporting zero cases.
  • 0002 changes only mkdrv.py's comment handling. It does not revisit the separate inline driver rules used by gte, qct and tcc, which have the same class of parsing to do and were not examined.
2 Attachments

Related

Commit: [r16743]

Discussion


Log in to post a comment.