[GHC] #9543: Testsuite driver: replace "extra_clean" by "git clean -X"

#9543: Testsuite driver: replace "extra_clean" by "git clean -X" -------------------------------------+------------------------------------- Reporter: thomie | Owner: thomie Type: task | Status: new Priority: normal | Milestone: Component: Test Suite | Version: Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- 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 [wiki:Building/Using lndir]). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9543 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9543: Testsuite driver: replace "extra_clean" by "git clean -X" -------------------------------------+------------------------------------- Reporter: thomie | Owner: thomie Type: task | Status: new Priority: normal | Milestone: Component: Test Suite | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): This approach doesn't quite work, because it should also be possible to delete only the files that a single test generates. A simpler solution: enforce the rule that all files which a test generates go into a single subdirectory. The directory could have the same name as the test. test('T1234', normal, ..., ...) can only create files in the directory 'T1234'. Then 'make CLEANUP=1' just removes that directory afterwards. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9543#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9543: Testsuite driver: replace "extra_clean" by "git clean -X" -------------------------------------+------------------------------------- Reporter: thomie | Owner: thomie Type: task | Status: closed Priority: normal | Milestone: Component: Test Suite | Version: Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => wontfix Comment: Superseded by #11980. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9543#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC