Skip to content

Commit c13aff9

Browse files
authored
Remove redundant initializeTestModule_SingleInstance() methods (#1114)
* remove initializeTestModule_SingleInstance and all calls to that method.
1 parent db7458b commit c13aff9

19 files changed

+14
-321
lines changed

tests/testsuite_default_Checkpoint.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,11 @@
1717
from sst_unittest import *
1818
from sst_unittest_support import *
1919

20-
################################################################################
21-
# Code to support a single instance module initialize, must be called setUp method
22-
23-
module_init = 0
24-
module_sema = threading.Semaphore()
25-
26-
def initializeTestModule_SingleInstance(class_inst):
27-
global module_init
28-
global module_sema
29-
30-
module_sema.acquire()
31-
if module_init != 1:
32-
# Put your single instance Init Code Here
33-
module_init = 1
34-
module_sema.release()
35-
36-
################################################################################
3720

3821
class testcase_Checkpoint(SSTTestCase):
3922

4023
def setUp(self):
4124
super(type(self), self).setUp()
42-
initializeTestModule_SingleInstance(self)
4325
# Put test based setup code here. it is called once before every test
4426

4527
def tearDown(self):

tests/testsuite_default_Component.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,11 @@
1414
from sst_unittest import *
1515
from sst_unittest_support import *
1616

17-
################################################################################
18-
# Code to support a single instance module initialize, must be called setUp method
19-
20-
module_init = 0
21-
module_sema = threading.Semaphore()
22-
23-
def initializeTestModule_SingleInstance(class_inst):
24-
global module_init
25-
global module_sema
26-
27-
module_sema.acquire()
28-
if module_init != 1:
29-
# Put your single instance Init Code Here
30-
module_init = 1
31-
module_sema.release()
32-
33-
################################################################################
3417

3518
class testcase_Component(SSTTestCase):
3619

3720
def setUp(self):
3821
super(type(self), self).setUp()
39-
initializeTestModule_SingleInstance(self)
4022
# Put test based setup code here. it is called once before every test
4123

4224
def tearDown(self):

tests/testsuite_default_Links.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,11 @@
1414
from sst_unittest import *
1515
from sst_unittest_support import *
1616

17-
################################################################################
18-
# Code to support a single instance module initialize, must be called setUp method
19-
20-
module_init = 0
21-
module_sema = threading.Semaphore()
22-
23-
def initializeTestModule_SingleInstance(class_inst):
24-
global module_init
25-
global module_sema
26-
27-
module_sema.acquire()
28-
if module_init != 1:
29-
# Put your single instance Init Code Here
30-
module_init = 1
31-
module_sema.release()
32-
33-
################################################################################
3417

3518
class testcase_Links(SSTTestCase):
3619

3720
def setUp(self):
3821
super(type(self), self).setUp()
39-
initializeTestModule_SingleInstance(self)
4022
# Put test based setup code here. it is called once before every test
4123

4224
def tearDown(self):

tests/testsuite_default_MemPoolTest.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,11 @@
1717
from sst_unittest import *
1818
from sst_unittest_support import *
1919

20-
################################################################################
21-
# Code to support a single instance module initialize, must be called setUp method
22-
23-
module_init = 0
24-
module_sema = threading.Semaphore()
25-
26-
def initializeTestModule_SingleInstance(class_inst):
27-
global module_init
28-
global module_sema
29-
30-
module_sema.acquire()
31-
if module_init != 1:
32-
# Put your single instance Init Code Here
33-
module_init = 1
34-
module_sema.release()
35-
36-
################################################################################
3720

3821
class testcase_StatisticComponent(SSTTestCase):
3922

4023
def setUp(self):
4124
super(type(self), self).setUp()
42-
initializeTestModule_SingleInstance(self)
4325
# Put test based setup code here. it is called once before every test
4426

4527
def tearDown(self):

tests/testsuite_default_Module.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,11 @@
1717
from sst_unittest import *
1818
from sst_unittest_support import *
1919

20-
################################################################################
21-
# Code to support a single instance module initialize, must be called setUp method
22-
23-
module_init = 0
24-
module_sema = threading.Semaphore()
25-
26-
def initializeTestModule_SingleInstance(class_inst):
27-
global module_init
28-
global module_sema
29-
30-
module_sema.acquire()
31-
if module_init != 1:
32-
# Put your single instance Init Code Here
33-
module_init = 1
34-
module_sema.release()
35-
36-
################################################################################
3720

3821
class testcase_Module(SSTTestCase):
3922

4023
def setUp(self):
4124
super(type(self), self).setUp()
42-
initializeTestModule_SingleInstance(self)
4325
# Put test based setup code here. it is called once before every test
4426

4527
def tearDown(self):

tests/testsuite_default_Output.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,11 @@
1717
from sst_unittest import *
1818
from sst_unittest_support import *
1919

20-
################################################################################
21-
# Code to support a single instance module initialize, must be called setUp method
22-
23-
module_init = 0
24-
module_sema = threading.Semaphore()
25-
26-
def initializeTestModule_SingleInstance(class_inst):
27-
global module_init
28-
global module_sema
29-
30-
module_sema.acquire()
31-
if module_init != 1:
32-
# Put your single instance Init Code Here
33-
module_init = 1
34-
module_sema.release()
35-
36-
################################################################################
3720

3821
class testcase_Output(SSTTestCase):
3922

4023
def setUp(self):
4124
super(type(self), self).setUp()
42-
initializeTestModule_SingleInstance(self)
4325
# Put test based setup code here. it is called once before every test
4426

4527
def tearDown(self):

tests/testsuite_default_ParamComponent.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,11 @@
1414
from sst_unittest import *
1515
from sst_unittest_support import *
1616

17-
################################################################################
18-
# Code to support a single instance module initialize, must be called setUp method
19-
20-
module_init = 0
21-
module_sema = threading.Semaphore()
22-
23-
def initializeTestModule_SingleInstance(class_inst):
24-
global module_init
25-
global module_sema
26-
27-
module_sema.acquire()
28-
if module_init != 1:
29-
# Put your single instance Init Code Here
30-
module_init = 1
31-
module_sema.release()
32-
33-
################################################################################
3417

3518
class testcase_ParamComponent(SSTTestCase):
3619

3720
def setUp(self):
3821
super(type(self), self).setUp()
39-
initializeTestModule_SingleInstance(self)
4022
# Put test based setup code here. it is called once before every test
4123

4224
def tearDown(self):

tests/testsuite_default_PerfComponent.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,11 @@
1515
from sst_unittest import *
1616
from sst_unittest_support import *
1717

18-
################################################################################
19-
# Code to support a single instance module initialize, must be called setUp method
20-
21-
module_init = 0
22-
module_sema = threading.Semaphore()
23-
24-
def initializeTestModule_SingleInstance(class_inst):
25-
global module_init
26-
global module_sema
27-
28-
module_sema.acquire()
29-
if module_init != 1:
30-
# Put your single instance Init Code Here
31-
module_init = 1
32-
module_sema.release()
33-
34-
################################################################################
3518

3619
class testcase_PerfComponent(SSTTestCase):
3720

3821
def setUp(self):
3922
super(type(self), self).setUp()
40-
initializeTestModule_SingleInstance(self)
4123
# Put test based setup code here. it is called once before every test
4224

4325
def tearDown(self):

tests/testsuite_default_RNGComponent.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,11 @@
1717
from sst_unittest import *
1818
from sst_unittest_support import *
1919

20-
################################################################################
21-
# Code to support a single instance module initialize, must be called setUp method
22-
23-
module_init = 0
24-
module_sema = threading.Semaphore()
25-
26-
def initializeTestModule_SingleInstance(class_inst):
27-
global module_init
28-
global module_sema
29-
30-
module_sema.acquire()
31-
if module_init != 1:
32-
# Put your single instance Init Code Here
33-
module_init = 1
34-
module_sema.release()
35-
36-
################################################################################
3720

3821
class testcase_RNGComponent(SSTTestCase):
3922

4023
def setUp(self):
4124
super(type(self), self).setUp()
42-
initializeTestModule_SingleInstance(self)
4325
# Put test based setup code here. it is called once before every test
4426

4527
def tearDown(self):

tests/testsuite_default_RealTime.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from sst_unittest import *
1919
from sst_unittest_support import *
2020

21+
2122
################################################################################
2223
# These tests test the RealTime features of SST including:
2324
# - SIGUSR1 / SIGUSR2
@@ -28,6 +29,19 @@
2829

2930
class testcase_Signals(SSTTestCase):
3031

32+
def initializeClass(self, testName):
33+
super(type(self), self).initializeClass(testName)
34+
# Put test based setup code here. it is called before testing starts
35+
# NOTE: This method is called once for every test
36+
37+
def setUp(self):
38+
super(type(self), self).setUp()
39+
# Put test based setup code here. it is called once before every test
40+
41+
def tearDown(self):
42+
# Put test based teardown code here. it is called once after every test
43+
super(type(self), self).tearDown()
44+
3145
#####
3246
def test_RealTime_SIGUSR1(self):
3347
testsuitedir = self.get_testsuite_dir()

0 commit comments

Comments
 (0)