Remove / from parameterized test names if base test name is empty

This is useful to let a subsystem generate test names based on parameterized tests
without exposing them as such to the user.

Signed-off-by: Knut Omang <knut.omang@oracle.com>
This commit is contained in:
Knut Omang
2018-01-29 14:09:34 +01:00
parent 84d986531e
commit b953e05bcf
3 changed files with 22 additions and 4 deletions

View File

@@ -96,6 +96,18 @@ INSTANTIATE_TEST_SUITE_P(PrintingFailingParams,
FailingParamTest,
testing::Values(2));
// Tests that an empty value for the test suite basename yields just
// the test name without any prior /
class EmptyBasenameParamInst : public testing::TestWithParam<int> {};
TEST_P(EmptyBasenameParamInst, Passes) {
EXPECT_EQ(1, GetParam());
}
INSTANTIATE_TEST_SUITE_P(,
EmptyBasenameParamInst,
testing::Values(1));
static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
TEST(NonfatalFailureTest, EscapesStringOperands) {