This repository was archived by the owner on Jan 17, 2024. It is now read-only.
Add GoogleTest support #11
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds fine grained execution of GoogleTest framework-based test
programs.
First, the GoogleTest test is executed with
--gtest_list_tests. Next,based on the output from
--gtest_list_tests, the testcases are runindividually. Finally, the output from each unique testcase is scraped
and digested by Kyua in a format that Kyua supports.
The output from each unique testcase is based on the standard output it
provides, per the test output protocol defined in the GoogleTest docs on
github [1], [2], and instrumented via various demo programs I created,
which can be found on GitHub in my scratch repo.
This is initial framework integration. There're additional improvements that
can be made by leveraging either the JSON or XML structured output format,
instead of scraping standard output using beginning and ending sentinels to
search for regular expressions. In order to do that though without reinventing
the wheel, Kyua would need to rely on an external JSON or XML library.
This test interface supports fine grained execution of test programs
like the ATF test interface, but matches behavior of plain/TAP interfaces by
instead supporting metadata passing via
$TEST_ENV_prefixed environmentvariables.
This support adds additional tests for verifying pass, fail, skip (available in
GoogleTest 1.9.0+), and disabled result determination, using mock output and a
mock test program (
engine/googletest_helpers), for parity with other testformats (ATF, plain, TAP). The helper test program purposely avoids relying on
getopt_long*for portability reasons, and the GoogleTest test infrastructure,in order to limit Kyua's dependencies.
As part of this change,
store/read_transaction.cppneeded to supportoptional reasons provided with skip results. While it's bad form to omit
test results with tests, providing a reason is optional with GoogleTest, and
unfortunately not all portions of the test framework output a reason when
GTEST_SKIP()is called. See the issue in [3] for one such example issue whenGTEST_SKIP()is called from SetUp test fixtures.GTEST_SKIP() << {message}doesn't output message when executed from SetUp() fixtures google/googletest#2208Signed-off-by: Enji Cooper [email protected]