MCPcopy Create free account
hub / github.com/boostorg/build / LocalTester

Class LocalTester

v2/test/configuration.py:72–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70""")
71
72 class LocalTester:
73 def __init__(self, tester):
74 self.__tester = tester
75 self.__test_ids = []
76
77 def __assertionFailure(self, message):
78 BoostBuild.annotation("failure", "Internal test assertion failure "
79 "- %s" % message)
80 self.__tester.fail_test(1)
81
82 def __call__(self, test_id, env, extra_args=None, *args, **kwargs):
83 if env == "" and not canSetEmptyEnvironmentVariable:
84 self.__assertionFailure("Can not set empty environment "
85 "variables on this platform.")
86 self.__registerTestId(str(test_id))
87 if extra_args is None:
88 extra_args = []
89 extra_args.append("---test-id---=%s" % test_id)
90 env_name = "BOOST_BUILD_USER_CONFIG"
91 previous_env = os.environ.get(env_name)
92 _env_set(env_name, env)
93 try:
94 self.__tester.run_build_system(extra_args, *args, **kwargs)
95 finally:
96 _env_set(env_name, previous_env)
97
98 def __registerTestId(self, test_id):
99 if test_id in self.__test_ids:
100 self.__assertionFailure("Multiple test cases encountered "
101 "using the same test id '%s'." % test_id)
102 self.__test_ids.append(test_id)
103
104 test = LocalTester(t)
105

Callers 1

test_user_configurationFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_user_configurationFunction · 0.68