From deacb94c933307caa33e29717d232e8687ee12e0 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 24 Jan 2018 20:56:11 +0100 Subject: [PATCH] Force unit tests to depend on the executable creation time --- demos/unit_test/wscript | 4 ++-- waflib/Tools/waf_unit_test.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/demos/unit_test/wscript b/demos/unit_test/wscript index 2b7d9496..3f45c66b 100644 --- a/demos/unit_test/wscript +++ b/demos/unit_test/wscript @@ -58,8 +58,8 @@ def build(bld): # to execute all tests: # $ waf --alltests # to set this behaviour permanenly: - bld.options.all_tests = True - #bld.options.clear_failed_tests = True + #bld.options.all_tests = True + bld.options.clear_failed_tests = True # debugging zone: # $ waf --zones=ut diff --git a/waflib/Tools/waf_unit_test.py b/waflib/Tools/waf_unit_test.py index 90979a95..e60fc54f 100644 --- a/waflib/Tools/waf_unit_test.py +++ b/waflib/Tools/waf_unit_test.py @@ -231,6 +231,11 @@ class utest(Task.Task): def get_cwd(self): return getattr(self.generator, 'ut_cwd', self.inputs[0].parent) + def sig_explicit_deps(self): + lst = [os.stat(node.abspath()).st_mtime for node in self.inputs] + self.m.update(str(lst)) + return super(utest, self).sig_explicit_deps() + def summary(bld): """ Display an execution summary::