Skip to content

Testsuite driver: replace "extra_clean" by "git clean -X"

When adding a new test that creates extra files, one also has to do some bookkeeping:

  1. Supply an extra_clean argument to the test function in all.T.
  2. Add an entry in testsuite/.gitignore

Step number 1 is often forgotten. Currently there are over 200 uncleaned files and directories left behind in the testsuite, after running validate and then make clean (checked with git clean -X -d -n | wc -l).

I propose to replace the functionality that extra_clean provides, namely to remove these extra files when one calls make clean, by doing the equivalent of git clean -X -d:

    -X 
        Remove only files ignored by Git.

    -d 
        Remove untracked directories in addition to untracked files. ...

That is: use the information from the .ignore files to figure out which files to delete on make clean.

The advantages of making this change are:

  1. Less manual bookkeeping, less work, less code
  2. A more thorough make clean

Implementation detail: we can not just call git clean directly, since this should also work when we are not in a git directory (for example a build directory created with lndir).

Trac metadata
Trac field Value
Version
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Test Suite
Test case
Differential revisions
BlockedBy
Related
Blocking
CC thoughtpolice
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information