2018-03-27 14:30:46 -04:00
|
|
|
"""The unittest.TestCase for C++ integration tests."""
|
2017-06-14 20:44:52 -04:00
|
|
|
|
2020-06-17 17:41:54 +03:00
|
|
|
from buildscripts.resmokelib import core
|
|
|
|
|
from buildscripts.resmokelib import utils
|
|
|
|
|
from buildscripts.resmokelib.testing.testcases import interface
|
2017-06-14 20:44:52 -04:00
|
|
|
|
|
|
|
|
|
2018-03-06 16:28:23 -05:00
|
|
|
class CPPIntegrationTestCase(interface.ProcessTestCase):
|
2018-03-27 14:30:46 -04:00
|
|
|
"""A C++ integration test to execute."""
|
2017-06-14 20:44:52 -04:00
|
|
|
|
|
|
|
|
REGISTERED_NAME = "cpp_integration_test"
|
|
|
|
|
|
2018-03-26 11:25:04 -04:00
|
|
|
def __init__(self, logger, program_executable, program_options=None):
|
2018-03-27 14:30:46 -04:00
|
|
|
"""Initialize the CPPIntegrationTestCase with the executable to run."""
|
2017-06-14 20:44:52 -04:00
|
|
|
|
2018-03-06 16:28:23 -05:00
|
|
|
interface.ProcessTestCase.__init__(self, logger, "C++ integration test", program_executable)
|
2017-06-14 20:44:52 -04:00
|
|
|
|
|
|
|
|
self.program_executable = program_executable
|
|
|
|
|
self.program_options = utils.default_if_none(program_options, {}).copy()
|
|
|
|
|
|
|
|
|
|
def configure(self, fixture, *args, **kwargs):
|
2018-03-27 14:30:46 -04:00
|
|
|
"""Configure the test case."""
|
2018-03-07 11:54:58 -05:00
|
|
|
interface.ProcessTestCase.configure(self, fixture, *args, **kwargs)
|
2017-06-14 20:44:52 -04:00
|
|
|
|
2017-07-21 10:21:09 -04:00
|
|
|
self.program_options["connectionString"] = self.fixture.get_internal_connection_string()
|
2017-06-14 20:44:52 -04:00
|
|
|
|
|
|
|
|
def _make_process(self):
|
2018-03-26 11:25:04 -04:00
|
|
|
return core.programs.generic_program(self.logger, [self.program_executable],
|
2020-11-20 15:41:26 -05:00
|
|
|
self.fixture.job_num, test_id=self._id,
|
2017-06-14 20:44:52 -04:00
|
|
|
**self.program_options)
|