-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Google Test support #203
Open
ngie-eign
wants to merge
6
commits into
freebsd:master
Choose a base branch
from
ngie-eign:add-googletest-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on May 9, 2024
-
This change adds fine grained execution of Google Test test programs. First, the Google Test test is executed with `--gtest_list_tests`. Next, based on the output from `--gtest_list_tests`, the testcases are run individually. 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 [here](https://github.com/ngie-eign/scratch/tree/master/programming/c%2B%2B/gtest). This support is a very rough cut to provide an initial working integration effort. 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 environment variables. This support adds additional tests for verifying pass, fail, skip (will be available in version 1.9.0 and is available in FreeBSD base's version of Google Test), and disabled result determination, using mock output and a mock test program (`engine/googletest_helpers`), for parity with other test formats (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.cpp` needed to support optional reasons provided with skip results. While it's bad form to omit test results with tests, providing a reason is optional with Google Test, 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 when `GTEST_SKIP()` is called from SetUp test fixtures. 1. https://github.com/google/googletest/blob/master/googletest/docs/primer.md 2. https://github.com/google/googletest/blob/master/googletest/docs/advanced.md 3. google/googletest#2208 Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b92dc4b - Browse repository at this point
Copy the full SHA b92dc4bView commit details -
Address some of @jmmv's comments in freebsd#203
This change does the following things: * Leverages utils/cmdline/*, instead of reinventing the wheel. * Consolidates googletest_results tests/setting for clarity. * Eliminates an unnecessary variable/comments. * Removes some duplicative TODOs/fixes TODO comment formatting. * Inlines temporary variables where possible/sensible. * Moves global variables into the anonymous global namespace. * Localizes the variable initialization near its use. * Adds more helpful comments above potentially obfuscated code. * Use list/set initialization instead of using the equivalent unrolled version with `.insert()`/`.push_back()`. * Fix indentation. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 45aa670 - Browse repository at this point
Copy the full SHA 45aa670View commit details -
Fix "make check-api-docs" with Travis CI
Document parameters moved into the anonymous namespace in 6e171b0 . Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3e53074 - Browse repository at this point
Copy the full SHA 3e53074View commit details -
Address more concerns made by @jmmv in freebsd#203
* Use initializer with std::map instead of initializing by hand. * Fix method definition indentation. * const poison some variables and inline where possible, eliminating need for unnecessary intermediate values. * Eliminate obfuscated proposed solution in `engine::googletest_result::apply` and deduplicate code by using a lambda to check the failed vs !failed case when checking the exit status. * Remove superfluous parentheses. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3c15e28 - Browse repository at this point
Copy the full SHA 3c15e28View commit details -
Provide a bogus result (a newline) when a skipped result has no context
This allows kyua to function in a backwards compatible manner, allowing previous versions to read databases from newer versions. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 85ee53f - Browse repository at this point
Copy the full SHA 85ee53fView commit details -
The version of Doxygen used by Travis CI thinks that the global `std::regex` variables need to have a `\return` type annotation (they don't). Make them local to the function again and add a TODO. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b99bf61 - Browse repository at this point
Copy the full SHA b99bf61View commit details
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.