Skip to content

Commit b1d30a0

Browse files
committed
remove sst_core_config_include_file_get_value_*
Call get_sst_config_include_file_value() directly
1 parent 8799b8c commit b1d30a0

5 files changed

+18
-52
lines changed

src/sst/core/testingframework/sst_unittest_support.py

+6-48
Original file line numberDiff line numberDiff line change
@@ -377,48 +377,6 @@ def skip_on_sstsimulator_conf_empty_str(section, key, reason):
377377
return lambda func: func
378378
return unittest.skip(reason)
379379

380-
################################################################################
381-
# SST Core Configuration include file (sst_config.h.conf) Access Functions
382-
################################################################################
383-
384-
def sst_core_config_include_file_get_value_int(define, default=None, disable_warning = False):
385-
""" Retrieve a define from the SST Core Configuration Include File (sst_config.h)
386-
387-
Args:
388-
define (str): The define to look for
389-
default (int): Default Return if failure occurs
390-
disable_warning (bool): Disable logging the warning if define is not found
391-
392-
Returns:
393-
(int) The returned data or default if not found in the include file
394-
395-
Raises:
396-
SSTTestCaseException: if type is incorrect OR no data AND default
397-
is not provided
398-
"""
399-
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
400-
"sst_config.h", define, default, int, disable_warning)
401-
402-
###
403-
404-
def sst_core_config_include_file_get_value_str(define, default=None, disable_warning = False):
405-
""" Retrieve a define from the SST Core Configuration Include File (sst_config.h)
406-
407-
Args:
408-
define (str): The define to look for
409-
default (str): Default Return if failure occurs
410-
disable_warning (bool): Disable logging the warning if define is not found
411-
412-
Returns:
413-
(str) The returned data or default if not found in the include file
414-
415-
Raises:
416-
SSTTestCaseException: if type is incorrect OR no data AND default
417-
is not provided
418-
"""
419-
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
420-
"sst_config.h", define, default, str, disable_warning)
421-
422380
################################################################################
423381
# SST Elements Configuration include file (sst_element_config.h.conf) Access Functions
424382
################################################################################
@@ -438,8 +396,8 @@ def sst_elements_config_include_file_get_value_int(define, default=None, disable
438396
SSTTestCaseException: if type is incorrect OR no data AND default
439397
is not provided
440398
"""
441-
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
442-
"sst_element_config.h", define, default, int, disable_warning)
399+
return get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
400+
"sst_element_config.h", define, default, int, disable_warning)
443401

444402
###
445403

@@ -458,8 +416,8 @@ def sst_elements_config_include_file_get_value_str(define, default=None, disable
458416
SSTTestCaseException: if type is incorrect OR no data AND default
459417
is not provided
460418
"""
461-
return _get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
462-
"sst_element_config.h", define, default, str, disable_warning)
419+
return get_sst_config_include_file_value(test_engine_globals.TESTENGINE_ELEM_CONFINCLUDE_DICT,
420+
"sst_element_config.h", define, default, str, disable_warning)
463421

464422
################################################################################
465423
# SST Configuration file (sstsimulator.conf) Access Functions
@@ -1748,8 +1706,8 @@ def _get_linux_version(filepath, sep):
17481706
### Generic Internal Support Functions
17491707
################################################################################
17501708

1751-
def _get_sst_config_include_file_value(include_dict, include_source, define, default=None,
1752-
data_type=str, disable_warning = False):
1709+
def get_sst_config_include_file_value(include_dict, include_source, define, default=None,
1710+
data_type=str, disable_warning = False):
17531711
""" Retrieve a define from an SST Configuration Include File (sst_config.h or sst-element_config.h)
17541712
include_dict (dict): The dictionary to search for the define
17551713
include_source (str): The name of the include file we are searching

tests/testsuite_default_PerfComponent.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# distribution.
1313

1414
import os
15+
import test_engine_globals
1516
from sst_unittest import *
1617
from sst_unittest_support import *
1718

@@ -52,7 +53,8 @@ def perf_component_test_template(self, testtype):
5253
perfdata_sav = "{0}/PerfComponent_PerfData.out".format(outdir)
5354

5455
#if SST was built with SST_PERFORMANCE_INSTRUMENTING enabled, then we will also check that the counters are sane
55-
if(sst_core_config_include_file_get_value_int(define="SST_PERFORMANCE_INSTRUMENTING", default=0, disable_warning=True) > 0):
56+
if(get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
57+
"sst_config.h", "SST_PERFORMANCE_INSTRUMENTING", 0, int, True) > 0):
5658
if os.path.isfile(perfdata_out):
5759
os.system("mv {0} {1}".format(perfdata_out, perfdata_sav))
5860
else:

tests/testsuite_default_StatisticsComponent.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
import filecmp
1616
import subprocess
1717

18+
import test_engine_globals
1819
from sst_unittest import *
1920
from sst_unittest_support import *
2021

2122

22-
have_h5 = sst_core_config_include_file_get_value_int("HAVE_HDF5", default=0, disable_warning=True) == 1
23+
have_h5 = get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
24+
"sst_config.h", "HAVE_HDF5", 0, int, True) == 1
2325

2426

2527
class testcase_StatisticComponent(SSTTestCase):

tests/testsuite_default_config_input_output.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
import os
1515
import sys
1616

17+
import test_engine_globals
1718
from sst_unittest import *
1819
from sst_unittest_support import *
1920

2021

21-
have_mpi = sst_core_config_include_file_get_value_int("SST_CONFIG_HAVE_MPI", default=0, disable_warning=True) == 1
22+
have_mpi = get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
23+
"sst_config.h", "SST_CONFIG_HAVE_MPI", 0, int, True) == 1
2224

2325

2426
class testcase_Config_input_output(SSTTestCase):

tests/testsuite_default_sstinfo.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
# information, see the LICENSE file in the top level directory of the
1212
# distribution.
1313

14+
import test_engine_globals
1415
from sst_unittest import *
1516
from sst_unittest_support import *
1617

1718

18-
have_curses = sst_core_config_include_file_get_value_int("HAVE_CURSES", default=0, disable_warning=True) == 1
19+
have_curses = get_sst_config_include_file_value(test_engine_globals.TESTENGINE_CORE_CONFINCLUDE_DICT,
20+
"sst_config.h", "HAVE_CURSES", 0, int, True) == 1
1921

2022

2123
class testcase_sstinfo(SSTTestCase):

0 commit comments

Comments
 (0)