For running all the tests under a target I use the command line command
bazel test //src/code_path:target_name
What should be additional parameters to run a test single_test
from the above target?
On Googletest with the following setup:
TEST(TestSuite, test1)
TEST(TestSuite, test2)
you can isolate test1 using
bazel test --test_arg=--gtest_filter=TestSuite.test $TEST_TARGET_PATH
See --gtest_filter
You'll want to use --test_filter
:
https://docs.bazel.build/versions/2.0.0/command-line-reference.html#flag--test_filter
The specific format of the value to the flag depends on the test runner.
--test_filter can be used:
For the following googletest test:
TEST(glog, log) {
LOG(INFO) << "an INFO log message";
VLOG(1) << "a vlog(1) message";
}
--test_filter=glog.log
can be used to pick it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With