Commit ac223c4
t0000: clear GIT_SKIP_TESTS before running sub-tests
In t0000, we run several fake "sub-test" suites to verify the behavior
of the test suite. But because we don't clear the parent environment
completely, the sub-tests can be fooled by variables meant for the
parent. For example:
GIT_SKIP_TESTS=t1234 ./t0000-basic.sh
fails when a sub-test expects its fake t1234 to actually run. This
particular pattern is unlikely in practice; we're running a single
script, and there is no t1234 in the real test suite anyway (not yet, at
least). A more real-world example is:
GIT_SKIP_TESTS=t[^0]* make test
to run only the t0* tests.
The fix is conceptually simple: we should clear the GIT_SKIP_TESTS
variable when running the sub-tests, because its contents (if any) will
be meant for the main test suite. This is easy to do centrally in our
sub-test helper.
But there's a catch: some of our tests do set GIT_SKIP_TESTS
intentionally to test the feature. We need to allow them to continue to
set it, but clear it for all the other tests. And the sub-test helper
can't tell if the GIT_SKIP_TESTS it sees is from a test or not. We can
handle this by adding a new option to the helper to let callers specify
the skip list.
I considered adding a more general "--eval" option to let callers set up
the env for the sub-test however they like. That would cover this case
and possible future ones. But the quoting gets awkward for the callers
(since we're now 2 layers deep in evals!), so I went with the simpler
more specific solution.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent daab8a5 commit ac223c4
1 file changed
+29
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
73 | 90 | | |
74 | 91 | | |
| |||
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
| 111 | + | |
| 112 | + | |
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
| |||
319 | 338 | | |
320 | 339 | | |
321 | 340 | | |
322 | | - | |
323 | 341 | | |
324 | | - | |
| 342 | + | |
| 343 | + | |
325 | 344 | | |
326 | 345 | | |
327 | 346 | | |
| |||
340 | 359 | | |
341 | 360 | | |
342 | 361 | | |
343 | | - | |
344 | 362 | | |
345 | | - | |
| 363 | + | |
| 364 | + | |
346 | 365 | | |
347 | 366 | | |
348 | 367 | | |
| |||
364 | 383 | | |
365 | 384 | | |
366 | 385 | | |
367 | | - | |
368 | 386 | | |
369 | | - | |
| 387 | + | |
| 388 | + | |
370 | 389 | | |
371 | 390 | | |
372 | 391 | | |
| |||
388 | 407 | | |
389 | 408 | | |
390 | 409 | | |
391 | | - | |
392 | 410 | | |
393 | | - | |
| 411 | + | |
| 412 | + | |
394 | 413 | | |
395 | 414 | | |
396 | 415 | | |
| |||
405 | 424 | | |
406 | 425 | | |
407 | 426 | | |
408 | | - | |
409 | 427 | | |
410 | | - | |
| 428 | + | |
| 429 | + | |
411 | 430 | | |
412 | 431 | | |
413 | 432 | | |
| |||
0 commit comments