aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-filepath.h
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-09-12 04:01:37 +0000
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-09-12 04:01:37 +0000
commit019d19af978f05b774407e0d46a3bda2c18c67c6 (patch)
tree8522f2db6e168ee4e829c2e7f2cf6dfbaaab30c7 /include/gtest/internal/gtest-filepath.h
parent29d8235540f1983c3dbd53a23783530017be80e7 (diff)
downloadgoogletest-019d19af978f05b774407e0d46a3bda2c18c67c6.tar.gz
googletest-019d19af978f05b774407e0d46a3bda2c18c67c6.tar.bz2
googletest-019d19af978f05b774407e0d46a3bda2c18c67c6.zip
Improves thread-safe death tests by changing to the original working directory before they are executed; also fixes out-dated comments about death tests.
Diffstat (limited to 'include/gtest/internal/gtest-filepath.h')
-rw-r--r--include/gtest/internal/gtest-filepath.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-filepath.h b/include/gtest/internal/gtest-filepath.h
index 308a2c64..fecdddcc 100644
--- a/include/gtest/internal/gtest-filepath.h
+++ b/include/gtest/internal/gtest-filepath.h
@@ -70,6 +70,9 @@ class FilePath {
String ToString() const { return pathname_; }
const char* c_str() const { return pathname_.c_str(); }
+ // Returns the current working directory, or "" if unsuccessful.
+ static FilePath GetCurrentDir();
+
// Given directory = "dir", base_name = "test", number = 0,
// extension = "xml", returns "dir/test.xml". If number is greater
// than zero (e.g., 12), returns "dir/test_12.xml".
@@ -91,6 +94,9 @@ class FilePath {
const FilePath& base_name,
const char* extension);
+ // Returns true iff the path is NULL or "".
+ bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
+
// If input name has a trailing separator character, removes it and returns
// the name, otherwise return the name string unmodified.
// On Windows platform, uses \ as the separator, other platforms use /.