Skip to content

Commit

Permalink
remove initializeTestModule_SingleInstance() ...
Browse files Browse the repository at this point in the history
from subclasses.  The implementations are basically identical.
  • Loading branch information
jmlapre committed Jul 31, 2024
1 parent 83e4f9d commit a7a90c4
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 338 deletions.
21 changes: 2 additions & 19 deletions tests/testsuite_default_Checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Checkpoint(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down Expand Up @@ -168,7 +151,7 @@ def checkpoint_test_template(self, testtype, cptfreq, cptrestart, subcomp=False,
sdlfile_generate = "{0}/subcomponent_tests/test_{1}.py".format(testsuitedir, testtype)
else:
sdlfile_generate = "{0}/test_{1}.py".format(testsuitedir,testtype)
outfile_generate = "{0}/test_Checkpoint_{1}_generate.out".format(outdir, outstr)
outfile_generate = "{0}/test_Checkpoint_{1}_generate.out".format(outdir, teststr)
options_checkpoint="--checkpoint-sim-period={0} --checkpoint-prefix={1} --model-options='{2}'".format(cptfreq,teststr,modelparams)
self.run_sst(sdlfile_generate, outfile_generate, other_args=options_checkpoint)

Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_Component.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Component(SSTTestCase):

Expand All @@ -41,7 +24,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_Links.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Links(SSTTestCase):

Expand All @@ -41,7 +24,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_MemPoolTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_StatisticComponent(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_Module.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Module(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_Output.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Output(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_ParamComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_ParamComponent(SSTTestCase):

Expand All @@ -41,7 +24,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_PerfComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_PerfComponent(SSTTestCase):

Expand All @@ -42,7 +25,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_RNGComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_RNGComponent(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
17 changes: 1 addition & 16 deletions tests/testsuite_default_RealTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################
# These tests test the RealTime features of SST including:
Expand All @@ -51,7 +36,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
19 changes: 1 addition & 18 deletions tests/testsuite_default_Serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,6 @@
from sst_unittest import *
from sst_unittest_support import *

################################################################################
# Code to support a single instance module initialize, must be called setUp method

module_init = 0
module_sema = threading.Semaphore()

def initializeTestModule_SingleInstance(class_inst):
global module_init
global module_sema

module_sema.acquire()
if module_init != 1:
# Put your single instance Init Code Here
module_init = 1
module_sema.release()

################################################################################

class testcase_Serialization(SSTTestCase):

Expand All @@ -44,7 +27,7 @@ def initializeClass(self, testName):

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

def tearDown(self):
Expand Down
Loading

0 comments on commit a7a90c4

Please sign in to comment.