This change adds the ability to generate stacktraces in Google Test on
both failures of assertions/expectations and on crashes. The
stacktrace support is conditionally available only when using Abseil
with Google Test.
To use this support, run the test under Bazel with a command like this:
bazel test --define absl=1 --test_env=GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1 //path/to/your:test
The "--define absl=1" part enables stacktraces on assertion/expectation
failures.
The "--test_env=GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" part enables
the signal handler that logs a stacktrace in the event of a crash
(this also requires the "--define absl=1" part). This is not the
default since it may interfere with existing tests.
non-ASCII charactors are interpreted as Shift-JIS on the environment.
But the charators in the files are non Shift-JIS charactors and the compiler
stops compiling with C4819.
To fix the errors, remove non-ASCII charactors.
GTEST_TEST_FILTER_ENV_VAR_ was used to specify an environment variable to obtain
the default test filter from. By default it was unset which broke
"--test_filter" for bazel. This CL eliminates GTEST_TEST_FILTER_ENV_VAR_ and
explicitly obtains the default test filter from the environment variable
TESTBRIDGE_TEST_ONLY if it exists.
When we do parallel test execution with a process for a test,
initialization of gtest become performance bottleneck when the test
binary contains many testcases.
Especially, some parameterlized test in chromium browser affected by
largely when address sanitizer is enabled.
Address sanitizer does not allow using optimized strcmp function and
test addition in parameterized test require lookup of test case using
strcmp.
This patch reduces the number of strcmp, it is called when registering
parameterized test. Using reverse iterator improves the time to find
registered tests in such case.
Some tests for chromium browser using address sanitizer finished 2x
faster with this patch.