|
| 1 | +// This test is intended to ensure that we have no trackers marked as XFAIL |
| 2 | +// without a tracker information added to a test. |
| 3 | +// |
| 4 | +// The format we check is: |
| 5 | +// XFAIL: lit,features |
| 6 | +// XFAIL-TRACKER: [GitHub issue URL|Internal tracker ID] |
| 7 | +// |
| 8 | +// GitHub issue URL format: |
| 9 | +// https://github.com/owner/repo/issues/12345 |
| 10 | +// |
| 11 | +// Internal tracker ID format: |
| 12 | +// PROJECT-123456 |
| 13 | +// |
| 14 | +// REQUIRES: linux |
| 15 | +// |
| 16 | +// Explanation of the command: |
| 17 | +// - search for all "XFAIL" occurrences, display line with match and the next one |
| 18 | +// -I, --include to drop binary files and other unrelated files |
| 19 | +// - in the result, search for "XFAIL" again, but invert the result - this |
| 20 | +// allows us to get the line *after* XFAIL |
| 21 | +// - in those lines, check that XFAIL-TRACKER is present and correct. Once |
| 22 | +// again, invert the search to get all "bad" lines |
| 23 | +// - make a final count of how many ill-formatted directives there are and |
| 24 | +// verify that against the reference |
| 25 | +// |
| 26 | +// RUN: grep -rI "XFAIL:" %S -A 1 --include=*.c --include=*.cpp \ |
| 27 | +// RUN: --no-group-separator | \ |
| 28 | +// RUN: grep -v "XFAIL:" | \ |
| 29 | +// RUN: grep -Pv "XFAIL-TRACKER:\s+(?:https://github.com/[\w\d-]+/[\w\d-]+/issues/[\d]+)|(?:[\w]+-[\d]+)" | \ |
| 30 | +// RUN: wc -l | FileCheck %s --check-prefix NUMBER-OF-XFAIL-WITHOUT-TRACKER |
| 31 | +// |
| 32 | +// The number below is a number of tests which are *improperly* XFAIL-ed, i.e. |
| 33 | +// we either don't have a tracker associated with a failure listed in those |
| 34 | +// tests, or it is listed in a wrong format. |
| 35 | +// Note: strictly speaking, that is not amount of files, but amount of XFAIL |
| 36 | +// directives. If a test contains several XFAIL directives, some of them may be |
| 37 | +// valid and other may not. |
| 38 | +// |
| 39 | +// That number *must not* increase. Any PR which causes this number to grow |
| 40 | +// should be rejected and it should be updated to either keep the number as-is |
| 41 | +// or have it reduced (preferrably, down to zero). |
| 42 | +// |
| 43 | +// If you see this test failed for your patch, it means that you either |
| 44 | +// introduced XFAIL directive to a test improperly, or broke the format of an |
| 45 | +// existing XFAIL-ed tests. |
| 46 | +// Another possibility (and that is a good option) is that you updated some |
| 47 | +// tests to match the required format and in that case you should just update |
| 48 | +// (i.e. reduce) the number below. |
| 49 | +// |
| 50 | +// NUMBER-OF-XFAIL-WITHOUT-TRACKER: 187 |
0 commit comments