aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-02 22:33:34 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-02-02 22:33:34 +0000
commit8d373310561a8d68d2a22ca7c6613deff5fa6e05 (patch)
tree1e9f5841133e353b24695fd8ca48a3353b35bfbe /include/gtest
parent81e1cc73c83265e54b2ec7edc17e77f4d1b89e86 (diff)
downloadgoogletest-8d373310561a8d68d2a22ca7c6613deff5fa6e05.tar.gz
googletest-8d373310561a8d68d2a22ca7c6613deff5fa6e05.tar.bz2
googletest-8d373310561a8d68d2a22ca7c6613deff5fa6e05.zip
Adds support for alternate path separator on Windows, and make all tests pass with CMake and VC++ 9 (by Manuel Klimek).
Diffstat (limited to 'include/gtest')
-rw-r--r--include/gtest/internal/gtest-filepath.h9
-rw-r--r--include/gtest/internal/gtest-port.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-filepath.h b/include/gtest/internal/gtest-filepath.h
index 1b2f5869..394f26ae 100644
--- a/include/gtest/internal/gtest-filepath.h
+++ b/include/gtest/internal/gtest-filepath.h
@@ -189,9 +189,18 @@ class FilePath {
// particular, RemoveTrailingPathSeparator() only removes one separator, and
// it is called in CreateDirectoriesRecursively() assuming that it will change
// a pathname from directory syntax (trailing separator) to filename syntax.
+ //
+ // On Windows this method also replaces the alternate path separator '/' with
+ // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
+ // "bar\\foo".
void Normalize();
+ // Returns a pointer to the last occurence of a valid path separator in
+ // the FilePath. On Windows, for example, both '/' and '\' are valid path
+ // separators. Returns NULL if no path separator was found.
+ const char* FindLastPathSeparator() const;
+
String pathname_;
}; // class FilePath
diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h
index d94c3797..d5e2e6bf 100644
--- a/include/gtest/internal/gtest-port.h
+++ b/include/gtest/internal/gtest-port.h
@@ -810,10 +810,12 @@ struct is_pointer<T*> : public true_type {};
#if GTEST_OS_WINDOWS
#define GTEST_PATH_SEP_ "\\"
+#define GTEST_HAS_ALT_PATH_SEP_ 1
// The biggest signed integer type the compiler supports.
typedef __int64 BiggestInt;
#else
#define GTEST_PATH_SEP_ "/"
+#define GTEST_HAS_ALT_PATH_SEP_ 0
typedef long long BiggestInt; // NOLINT
#endif // GTEST_OS_WINDOWS