diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-18 19:22:31 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-19 00:03:37 +0300 |
commit | ac6041e1107f97e156ff4314a31d909ce0c404ea (patch) | |
tree | 175199982a17ad281788ccf1536fd78d8654d7dc | |
parent | 021d242f9ce8e6cd804af0c1eb4179b8c83fd470 (diff) | |
download | meson-ac6041e1107f97e156ff4314a31d909ce0c404ea.zip meson-ac6041e1107f97e156ff4314a31d909ce0c404ea.tar.gz meson-ac6041e1107f97e156ff4314a31d909ce0c404ea.tar.bz2 |
Add delays to test for timestamp issues on mac.
-rwxr-xr-x | run_unittests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 03cd82b..97bdad9 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -3328,6 +3328,15 @@ int main(int argc, char **argv) { self.setconf("-Dfree_array_opt=['a,b', 'c,d']", will_build=False) self.opt_has('free_array_opt', ['a,b', 'c,d']) + # When running under Travis Mac CI, the file updates seem to happen + # too fast so the timestamps do not get properly updated. + # Call this method before file operations in appropriate places + # to make things work. + def mac_ci_delay(self): + if is_osx() and is_ci(): + import time + time.sleep(1) + def test_options_with_choices_changing(self) -> None: """Detect when options like arrays or combos have their choices change.""" testdir = Path(os.path.join(self.unit_test_dir, '84 change option choices')) @@ -3340,6 +3349,7 @@ int main(int argc, char **argv) { shutil.copy(options1, real_options) self.init(str(testdir)) + self.mac_ci_delay() shutil.copy(options2, real_options) self.build() @@ -3353,10 +3363,12 @@ int main(int argc, char **argv) { self.assertEqual(item['choices'], ['b', 'c', 'd']) self.wipe() + self.mac_ci_delay() # When the old options are valid they should remain shutil.copy(options1, real_options) self.init(str(testdir), extra_args=['-Dcombo=c', '-Darray=b,c']) + self.mac_ci_delay() shutil.copy(options2, real_options) self.build() opts = self.introspect('--buildoptions') |