This is an archive of the discontinued LLVM Phabricator instance.

[dotest] Clean up test folder clean-up
ClosedPublic

Authored by labath on Mar 15 2018, 10:13 AM.

Details

Summary

This patch implements a unified way of cleaning the build folder of each
test. This is done by completely removing the build folder before each
test, in the respective setUp() method. Previously, we were using a
combination of several methods, each with it's own drawbacks:

  • nuking the entire build tree before running dotest: the issue here is that this did not take place if you ran dotest manually
  • running "make clean" before the main "make" target: this relied on the clean command being correctly implemented. This was usually true, but not always.
  • for files which were not produced by make, each python file was responsible for ensuring their deleting, using a variety of methods.

With this approach, the previous methods become redundant. I remove the
first two, since they are centralized. For the other various bits of
clean-up code in python files, I indend to delete it when I come
across it.

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Mar 15 2018, 10:13 AM
aprantl accepted this revision.Mar 15 2018, 10:38 AM

Thanks! I think this makes sense.

packages/Python/lldbsuite/test/lldbtest.py
707 ↗(On Diff #138579)

I was thinking whether this was necessary, since we could just rm -rf the entire --build-dir, but for running individual tests, doing it this way makes it easier.

test/CMakeLists.txt
9 ↗(On Diff #138579)

That comment is obsolete now?

This revision is now accepted and ready to land.Mar 15 2018, 10:38 AM
This revision was automatically updated to reflect the committed changes.

I would be nice to have the option to nuke each test build directory if the test passed. Can be an option that we specify. That way, the only folders left over could be the tests that are failing. The options doesn't need to default to true, but if anyone is in that code and would know how to do that, that would be a great option to have. This option could also clean up the log directory and remove any logs for tests that succeeded or were skipped. I alway have to go and nuke these files manually.

Greg

labath added a subscriber: aprantl.Mar 20 2018, 4:56 AM

Deleting the test build dir is fairly easy. I can whip up a patch for that,
but I'm not sure if that's the part that is bothering you the most here.
Dealing with the log files is a bot more complicated and there doesn't seem
to be a clear consensus on what to do with them. The last discussion about
the (Jan 17: Questions about the LLDB testsuite and improving its
reliability) ended without a clear conclusion. I personally, think it would
be nice to put the log files into the build dir, but I don't feel strongly
enough about it to go around and try to get people to change their habits.