2018-05-12 01:32:00 +02:00
|
|
|
#!/usr/bin/env python3
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
import unittest
|
|
|
|
|
import sys,os
|
|
|
|
|
sys.path.append(os.path.join(sys.path[0],".."))
|
|
|
|
|
import globals
|
|
|
|
|
|
|
|
|
|
(OPTS, args) = globals.parse_args()
|
|
|
|
|
del sys.argv[1:]
|
|
|
|
|
|
2018-01-30 01:59:29 +01:00
|
|
|
from testutils import header,openram_test
|
2016-11-15 17:57:06 +01:00
|
|
|
header(__file__, OPTS.tech_name)
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
# get a list of all files in the tests directory
|
|
|
|
|
files = os.listdir(sys.path[0])
|
|
|
|
|
|
|
|
|
|
# assume any file that ends in "test.py" in it is a regression test
|
|
|
|
|
nametest = re.compile("test\.py$", re.IGNORECASE)
|
2018-05-12 01:32:00 +02:00
|
|
|
tests = list(filter(nametest.search, files))
|
2016-11-08 18:57:35 +01:00
|
|
|
tests.sort()
|
|
|
|
|
|
|
|
|
|
# import all of the modules
|
|
|
|
|
filenameToModuleName = lambda f: os.path.splitext(f)[0]
|
|
|
|
|
moduleNames = map(filenameToModuleName, tests)
|
|
|
|
|
modules = map(__import__, moduleNames)
|
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
|
load = unittest.defaultTestLoader.loadTestsFromModule
|
|
|
|
|
suite.addTests(map(load, modules))
|
2018-07-11 01:39:32 +02:00
|
|
|
|
2018-07-11 18:51:28 +02:00
|
|
|
test_runner = unittest.TextTestRunner(verbosity=2,stream=sys.stderr)
|
|
|
|
|
test_result = test_runner.run(suite)
|
2018-07-11 20:59:24 +02:00
|
|
|
|
|
|
|
|
import verify
|
|
|
|
|
verify.print_drc_stats()
|
|
|
|
|
verify.print_lvs_stats()
|
|
|
|
|
verify.print_pex_stats()
|
|
|
|
|
|
2018-07-11 18:51:28 +02:00
|
|
|
sys.exit(not test_result.wasSuccessful())
|