From ea60220c5b2811fa24f3765e1d086436d112ac9a Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 6 Oct 2014 10:31:26 -0400 Subject: [PATCH] Enable parallel tests. Multiple tests were generating and removing test.log. This causes race conditions and test failures when running parallel ctests. --- test/hoomd_script/test_analyze_log.py | 10 +++++----- test/hoomd_script/test_analyze_msd.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/hoomd_script/test_analyze_log.py b/test/hoomd_script/test_analyze_log.py index a45ed669..07d51c16 100644 --- a/test/hoomd_script/test_analyze_log.py +++ b/test/hoomd_script/test_analyze_log.py @@ -15,12 +15,12 @@ class analyze_log_tests (unittest.TestCase): # tests basic creation of the analyzer def test(self): - analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test.log"); + analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test_analyze_log.log"); run(100); # test set_params def test_set_params(self): - ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test.log"); + ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test_analyze_log.log"); ana.set_params(quantities = ['test1']); run(100); ana.set_params(delimiter = ' '); @@ -30,12 +30,12 @@ class analyze_log_tests (unittest.TestCase): # test variable period def test_variable(self): - ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = lambda n: n*10, filename="test.log"); + ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = lambda n: n*10, filename="test_analyze_log.log"); run(100); # test the initialization checks def test_init_checks(self): - ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test.log"); + ana = analyze.log(quantities = ['test1', 'test2', 'test3'], period = 10, filename="test_analyze_log.log"); ana.cpp_analyzer = None; self.assertRaises(RuntimeError, ana.enable); @@ -44,7 +44,7 @@ class analyze_log_tests (unittest.TestCase): def tearDown(self): init.reset(); if (comm.get_rank()==0): - os.remove("test.log"); + os.remove("test_analyze_log.log"); if __name__ == '__main__': diff --git a/test/hoomd_script/test_analyze_msd.py b/test/hoomd_script/test_analyze_msd.py index 9f089c6e..82743921 100644 --- a/test/hoomd_script/test_analyze_msd.py +++ b/test/hoomd_script/test_analyze_msd.py @@ -15,28 +15,28 @@ class analyze_msd_tests (unittest.TestCase): # tests basic creation of the analyzer def test(self): - analyze.msd(period = 10, filename="test.log", groups=[group.all()]); + analyze.msd(period = 10, filename="test_analyze_msd.log", groups=[group.all()]); run(100); # test variable period def test_variable(self): - analyze.msd(period = lambda n: n*10, filename="test.log", groups=[group.all()]); + analyze.msd(period = lambda n: n*10, filename="test_analyze_msd.log", groups=[group.all()]); run(100); # test error if no groups defined def test_no_gropus(self): - self.assertRaises(RuntimeError, analyze.msd, period=10, filename="test.log", groups=[]); + self.assertRaises(RuntimeError, analyze.msd, period=10, filename="test_analyze_msd.log", groups=[]); # test set_params def test_set_params(self): - ana = analyze.msd(period = 10, filename="test.log", groups=[group.all()]); + ana = analyze.msd(period = 10, filename="test_analyze_msd.log", groups=[group.all()]); ana.set_params(delimiter = ' '); run(100); def tearDown(self): init.reset(); if comm.get_rank() == 0: - os.remove("test.log"); + os.remove("test_analyze_msd.log"); if __name__ == '__main__': unittest.main(argv = ['test.py', '-v']) -- 2.11.4.GIT