def nrtest_compare(path_test, path_ref, rtol, atol): ts_new = TestSuite.read_benchmark(path_test) ts_old = TestSuite.read_benchmark(path_ref) if not validate_testsuite(ts_new) or not validate_testsuite(ts_old): exit(1) try: logging.info('Found %i tests' % len(ts_new.tests)) compatible = compare_testsuite(ts_new, ts_old, rtol, atol) except KeyboardInterrupt: logging.warning('Process interrupted by user') compatible = False else: logging.info('Finished') # Non-zero exit code indicates failure exit(not compatible)
from nrtest.testsuite import TestSuite from nrtest.compare import compare_testsuite, validate_testsuite def nrtest_compare(path_test, path_ref, (comp_args)): ts_new = TestSuite.read_benchmark(path_test) ts_old = TestSuite.read_benchmark(path_ref) if not validate_testsuite(ts_new) or not validate_testsuite(ts_old): exit(1) try: # logging.info('Found %i tests' % len(ts_new.tests)) compatible = compare_testsuite(ts_new, ts_old, comp_args[0], comp_args[1]) except KeyboardInterrupt: # logging.warning('Process interrupted by user') compatible = False # else: # logging.info('Finished') # Non-zero exit code indicates failure exit(not compatible) def nrtest_execute(app_path, test_path, output_path): import logging import glob