aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-12-19 11:03:34 -0800
committerXavier Claessens <xclaesse@gmail.com>2018-12-20 13:30:30 -0500
commitf9a35e08acd34173355fbaea391045373d931abb (patch)
treee61e5297ae6a1645b8b7129d3d05c60e6a714fdf /run_unittests.py
parent7838f9afc390a53d4097f3710b9f30cb52031be9 (diff)
downloadmeson-f9a35e08acd34173355fbaea391045373d931abb.zip
meson-f9a35e08acd34173355fbaea391045373d931abb.tar.gz
meson-f9a35e08acd34173355fbaea391045373d931abb.tar.bz2
msetup: Fix callig meson --wipe inside a build directory
This seems to be related to deleting the current working directory. Simply deleting all of the trees inside the build directory instead seems to fix it. This only appears with some combination of generated targets, running the test case against say "1 trivial" doesn't show the bug. See this mesa bug: https://bugs.freedesktop.org/show_bug.cgi?id=109071
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 743eb12..6a1f5df 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2922,11 +2922,7 @@ recommended as it is not supported on some platforms''')
self.wipe()
self.init(testdir, extra_args=['-Dstart_native=true'])
- def test_reconfigure(self):
- testdir = os.path.join(self.unit_test_dir, '46 reconfigure')
- self.init(testdir, extra_args=['-Dopt1=val1'])
- self.setconf('-Dopt2=val2')
-
+ def __reconfigure(self):
# Set an older version to force a reconfigure from scratch
filename = os.path.join(self.privatedir, 'coredata.dat')
with open(filename, 'rb') as f:
@@ -2935,6 +2931,13 @@ recommended as it is not supported on some platforms''')
with open(filename, 'wb') as f:
pickle.dump(obj, f)
+ def test_reconfigure(self):
+ testdir = os.path.join(self.unit_test_dir, '46 reconfigure')
+ self.init(testdir, extra_args=['-Dopt1=val1'])
+ self.setconf('-Dopt2=val2')
+
+ self.__reconfigure()
+
out = self.init(testdir, extra_args=['--reconfigure', '-Dopt3=val3'])
self.assertRegex(out, 'WARNING:.*Regenerating configuration from scratch')
self.assertRegex(out, 'opt1 val1')
@@ -2957,6 +2960,14 @@ recommended as it is not supported on some platforms''')
self.build()
self.run_tests()
+ def test_wipe_from_builddir(self):
+ testdir = os.path.join(self.common_test_dir, '162 custom target subdir depend files')
+ self.init(testdir)
+ self.__reconfigure()
+
+ with Path(self.builddir):
+ self.init(testdir, extra_args=['--wipe'])
+
def test_target_construct_id_from_path(self):
# This id is stable but not guessable.
# The test is supposed to prevent unintentional