Skip to content

Enabling and Disabling Tests

Gavin Fielder edited this page Jun 16, 2020 · 10 revisions

I have provided scripts that make it easy to enable and disable tests. The scripts accept the same basic queries as the ./test executable.

Examples:

  • ./disable-test s All the tests that start with 's' are disabled
  • ./enable-test s_null_ All the tests that start with 's_null_' are enabled
  • ./disable-test 42 84 Tests 42 to 84 are disabled
  • ./disable-test && ./enable-test s Disables all tests except tests that start with 's'
  • ./disable-test "*zeropad" Disables all the tests that have 'zeropad' anywhere in the name

You can call ./enable-test (with no arguments) to enable all tests, but keep in mind that some tests are disabled by default because if you have not implemented certain bonuses, your ft_printf will segfault.

Options

-q: Quiet mode, example ./disable-test -q nocrash. Using -q disables output, never remakes PFT, or touches test history. This option is provided primarily to speed up compound commands.

Resetting to Default

You can reset the tests to default enabled/disabled state by using ./reset-to-default-enabled-tests

Enabling and Disabling by Test History Log Status

enable-test and disable-test also support the -[-|=|+][fnop] command line options to filter by test history. The filter determines which tests to perform the enable or disable action on.

Examples:

  • ./disable-test --f s All the tests that start with 's' are disabled, except tests that recently failed
  • ./disable-test -=p s All the tests that start with 's' and recently passed are disabled.