summaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-options-test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2021-07-02 21:01:11 (GMT)
committerDerek Mauro <dmauro@google.com>2021-07-07 18:34:19 (GMT)
commit977cffc4423a2d6c0df3fc9a7b5253b8f79c3f18 (patch)
treef984ad508b34bbdfb1812efaffe5b62e35ab70ae /googletest/test/googletest-options-test.cc
parent4cfd14984fb0ae68ae434ae6e82d67b75986adec (diff)
downloadgoogletest-977cffc4423a2d6c0df3fc9a7b5253b8f79c3f18.zip
googletest-977cffc4423a2d6c0df3fc9a7b5253b8f79c3f18.tar.gz
googletest-977cffc4423a2d6c0df3fc9a7b5253b8f79c3f18.tar.bz2
Googletest export
Introduce GTEST_FLAG_GET and GTEST_FLAG_SET macros. PiperOrigin-RevId: 382808313
Diffstat (limited to 'googletest/test/googletest-options-test.cc')
-rw-r--r--googletest/test/googletest-options-test.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/googletest/test/googletest-options-test.cc b/googletest/test/googletest-options-test.cc
index 11fb1f2..cd386ff 100644
--- a/googletest/test/googletest-options-test.cc
+++ b/googletest/test/googletest-options-test.cc
@@ -61,29 +61,29 @@ FilePath GetAbsolutePathOf(const FilePath& relative_path) {
// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
TEST(XmlOutputTest, GetOutputFormatDefault) {
- GTEST_FLAG(output) = "";
+ GTEST_FLAG_SET(output, "");
EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
}
TEST(XmlOutputTest, GetOutputFormat) {
- GTEST_FLAG(output) = "xml:filename";
+ GTEST_FLAG_SET(output, "xml:filename");
EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
}
TEST(XmlOutputTest, GetOutputFileDefault) {
- GTEST_FLAG(output) = "";
+ GTEST_FLAG_SET(output, "");
EXPECT_EQ(GetAbsolutePathOf(FilePath("test_detail.xml")).string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
}
TEST(XmlOutputTest, GetOutputFileSingleFile) {
- GTEST_FLAG(output) = "xml:filename.abc";
+ GTEST_FLAG_SET(output, "xml:filename.abc");
EXPECT_EQ(GetAbsolutePathOf(FilePath("filename.abc")).string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
}
TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
- GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
+ GTEST_FLAG_SET(output, "xml:path" GTEST_PATH_SEP_);
const std::string expected_output_file =
GetAbsolutePathOf(
FilePath(std::string("path") + GTEST_PATH_SEP_ +
@@ -144,28 +144,28 @@ class XmlOutputChangeDirTest : public Test {
};
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
- GTEST_FLAG(output) = "";
+ GTEST_FLAG_SET(output, "");
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
FilePath("test_detail.xml")).string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
}
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
- GTEST_FLAG(output) = "xml";
+ GTEST_FLAG_SET(output, "xml");
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
FilePath("test_detail.xml")).string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
}
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
- GTEST_FLAG(output) = "xml:filename.abc";
+ GTEST_FLAG_SET(output, "xml:filename.abc");
EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
FilePath("filename.abc")).string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
}
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
- GTEST_FLAG(output) = "xml:path" GTEST_PATH_SEP_;
+ GTEST_FLAG_SET(output, "xml:path" GTEST_PATH_SEP_);
const std::string expected_output_file =
FilePath::ConcatPaths(
original_working_dir_,
@@ -182,11 +182,11 @@ TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
#if GTEST_OS_WINDOWS
- GTEST_FLAG(output) = "xml:c:\\tmp\\filename.abc";
+ GTEST_FLAG_SET(output, "xml:c:\\tmp\\filename.abc");
EXPECT_EQ(FilePath("c:\\tmp\\filename.abc").string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
#else
- GTEST_FLAG(output) ="xml:/tmp/filename.abc";
+ GTEST_FLAG_SET(output, "xml:/tmp/filename.abc");
EXPECT_EQ(FilePath("/tmp/filename.abc").string(),
UnitTestOptions::GetAbsolutePathToOutputFile());
#endif
@@ -199,7 +199,7 @@ TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
const std::string path = "/tmp/";
#endif
- GTEST_FLAG(output) = "xml:" + path;
+ GTEST_FLAG_SET(output, "xml:" + path);
const std::string expected_output_file =
path + GetCurrentExecutableName().string() + ".xml";
const std::string& output_file =