Skip to content

Commit

Permalink
Merge pull request sstsimulator#1186 from sstsimulator/devel
Browse files Browse the repository at this point in the history
Automatically Merged using SST Master Branch Merger
  • Loading branch information
sst-autotester authored Dec 18, 2024
2 parents bdaa8f3 + efc8de4 commit 744bb94
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/sst/core/model/xmlToPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def printTree(indent: int, node: ET.Element) -> None:

def processString(string: str) -> str:
"""Process a string, replacing variables and env. vars with their values"""
def replaceSSTVar(matchobj: re.Match) -> str:
def replaceSSTVar(matchobj: re.Match[str]) -> str:
varname = matchobj.group(1)
return sstVars[varname]

def replaceEnvVar(matchobj: re.Match) -> str:
def replaceEnvVar(matchobj: re.Match[str]) -> str:
varname = matchobj.group(1)
var = os.getenv(varname)
assert var is not None
Expand Down
6 changes: 3 additions & 3 deletions src/sst/core/testingframework/sst_test_engine_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def startup_and_run(sst_core_bin_dir: str, test_mode: int) -> None:
sys.exit(1)

t_e = test_engine.TestEngine(sst_core_bin_dir, test_mode)
t_e.discover_and_run_tests()
sys.exit(t_e.discover_and_run_tests())

except Exception as exc_e:
# NOTE: This is a generic catchall handler for any unhandled exception
_generic_exception_handler(exc_e)

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

def _generic_exception_handler(exc_e):
def _generic_exception_handler(exc_e: Exception) -> None:

# Dump Exception info to the a log file
log_filename = "./sst_test_frameworks_crashreport.log"
Expand All @@ -91,7 +91,7 @@ def _generic_exception_handler(exc_e):
log_handler = RotatingFileHandler(log_filename, mode='a',
maxBytes=10*1024*1024,
backupCount=10,
encoding=None, delay=0)
encoding=None, delay=False)
log_handler.setFormatter(log_formatter)
crashlogger.addHandler(log_handler)
crashlogger.setLevel(logging.DEBUG)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# type: ignore
# -*- coding: utf-8 -*-
##
##Unless stated otherwise in the source files, all code is copyright 2010 David
Expand Down
10 changes: 5 additions & 5 deletions src/sst/core/testingframework/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __init__(self, sst_core_bin_dir: str, test_mode: int) -> None:

####

def discover_and_run_tests(self):
def discover_and_run_tests(self) -> int:
""" Create the output directories, then discover the tests, and then
run them using pythons unittest module
Expand Down Expand Up @@ -183,17 +183,17 @@ def discover_and_run_tests(self):
sst_tests_results = test_runner.run(self._sst_full_test_suite)

if not test_runner.did_tests_pass(sst_tests_results):
exit(1)
exit(0)
return 1
return 0

# Handlers of unittest.TestRunner exceptions
except KeyboardInterrupt:
log_fatal("TESTING TERMINATED DUE TO KEYBOARD INTERRUPT...")
exit(2)
return 2

####

def _build_tests_list_helper(self, suite):
def _build_tests_list_helper(self, suite: SSTTestSuite) -> List[Any]:
"""
A helper function to split the tests for the ConcurrentTestSuite into
some number of concurrently executing sub-suites. _build_tests_list_helper
Expand Down

0 comments on commit 744bb94

Please sign in to comment.