From 3d091950107a86b505eb4177a8ea0b37364fd64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Fri, 11 Nov 2016 23:20:06 +0100 Subject: [PATCH] Saving changes to python scripts These are intermediate changes, just pushing them to access from home. --- .../tests/continuous_testing_py/autotest.py | 22 ++++++- .../continuous_testing_py/baseconfig.xml | 57 +++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 DRAMSys/tests/continuous_testing_py/baseconfig.xml diff --git a/DRAMSys/tests/continuous_testing_py/autotest.py b/DRAMSys/tests/continuous_testing_py/autotest.py index c413794a..ffd146df 100644 --- a/DRAMSys/tests/continuous_testing_py/autotest.py +++ b/DRAMSys/tests/continuous_testing_py/autotest.py @@ -44,18 +44,20 @@ from memutil import * devnull = None # If you want to change the standard output and/or standard error output do -# that in the Top-level script environment (the '__main__' at the very bottom +# that in the top-level script environment (the '__main__' at the very bottom # of this file. out = None errout = None rootdir = '../../..' -tempfile.tempdir = os.getcwd() + '/' + rootdir +workingdir = os.getcwd() +tempfile.tempdir = workingdir + '/' + rootdir builddir = tempfile.mkdtemp() simdir = builddir + '/simulator' mcConfigPath = rootdir + '/DRAMSys/simulator/resources/configs/mcconfigs' memSpecsPath = rootdir + '/DRAMSys/simulator/resources/configs/memspecs' +baseConfig = workingdir + '/baseconfig.xml' def build_project(): @@ -70,6 +72,7 @@ def build_project(): return ret +@unittest.skip("skipping this") class TestBuild(unittest.TestCase): def test_build_project(self): """ The project's build process should succeed """ @@ -79,6 +82,7 @@ class TestBuild(unittest.TestCase): shutil.rmtree(builddir) +@unittest.skip("skipping this") class TestOutput(unittest.TestCase): def setUp(self): build_project() @@ -88,13 +92,24 @@ class TestOutput(unittest.TestCase): os.chdir(simdir) self.assertEqual(subprocess.call(['./dramSys'], stdout=out), 0) + def test_run_with_base_config(self): + """ running dramSys with base config file output match reference """ + os.chdir(simdir) + self.assertEqual(subprocess.call(['./dramSys', baseConfig], + stdout=out), 0) + def tearDown(self): shutil.rmtree(builddir) -@unittest.skip("skipping this") +# This is an example that shows how to skip a test. +# @unittest.skip("skipping this") class TestDummy(unittest.TestCase): + def setUp(self): + os.chdir(workingdir) + def test_list_files(self): + print('Current working directory is {0}'.format(os.getcwd())) for file in os.listdir(mcConfigPath): if file.endswith(".xml"): print(file) @@ -109,4 +124,5 @@ if __name__ == '__main__': errout = devnull # out = sys.stdout # errout = sys.stderr + print('Base configuration file is {0}'.format(baseConfig)) unittest.main() diff --git a/DRAMSys/tests/continuous_testing_py/baseconfig.xml b/DRAMSys/tests/continuous_testing_py/baseconfig.xml new file mode 100644 index 00000000..0608f201 --- /dev/null +++ b/DRAMSys/tests/continuous_testing_py/baseconfig.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ddr3_example.stl + + + + +