build: Valgrind script now depends on unit test executable
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Wed, 23 Nov 2016 22:27:46 +0000 (23:27 +0100)
committerZiran Sun <ziran.sun@samsung.com>
Mon, 28 Nov 2016 11:43:20 +0000 (11:43 +0000)
This prevents Sporadic Valgrind Failures, caused by race conditions
Common error message is like:
  out/linux/x86_64/debug/resource/unittests/unittests: Permission denied

Bug: https://jira.iotivity.org/browse/IOT-1526
Change-Id: I49bfb21ee7cd934b965e132cb150d59c047ef383
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14705
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Nivedita Singhvi <niveditasinghvi@gmail.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
tools/scons/RunTest.py

index d10a177..91375e6 100644 (file)
@@ -63,5 +63,6 @@ def run_test(env, xml_file, test):
         # Set up to run the test under Valgrind.
         test_cmd = '%s valgrind --leak-check=full --suppressions=%s --xml=yes --xml-file=%s %s' % (valgrind_environment, suppression_file, xml_file, test_cmd)
 
+    env.Depends('ut' + test , os.path.join(build_dir, test))
     ut = env.Command('ut' + test, None, test_cmd)
     env.AlwaysBuild('ut' + test)