Tear down tests in reverse order from setting them up.
Tests derive from TestBase, which derives from Base. In the test setUp() methods, we always call TestBase.setUp() first and then call implementation-specific setup. Tear down needs to do the reverse. This was causing over 20 failures on Windows, and was the culprit behind about 80% of the files not being cleaned up after test run. TestBase.tearDown() is responsible for deleting all targets created during the test run and without this step, on Windows files will be locked and cannot be deleted. But TestBase.tearDown() was calling Base.tearDown() before its own cleanup (i.e. deleting the targets) and in some cases one of the teardown hooks would be to call make clean. So make clean would be run before the targets had been deleted, and fail to remove the files, and subsequently result in a failed test as well. llvm-svn: 233284
Loading
Please register or sign in to comment