summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-07-08 21:32:17 (GMT)
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-07-08 21:32:17 (GMT)
commite4e9a8bd7d2dbbad62030c8f80513e3c81b32213 (patch)
tree08e242f8835e0688031e27305c5d58c24282f2e7 /test
parentd201456903f3ecae1f7794edfab0d5678e642265 (diff)
downloadgoogletest-e4e9a8bd7d2dbbad62030c8f80513e3c81b32213.zip
googletest-e4e9a8bd7d2dbbad62030c8f80513e3c81b32213.tar.gz
googletest-e4e9a8bd7d2dbbad62030c8f80513e3c81b32213.tar.bz2
Makes the autotools scripts work on Mac OS X. Also hopefully makes gtest compile on Windows CE.
Diffstat (limited to 'test')
-rwxr-xr-xtest/gtest_output_test.py2
-rw-r--r--test/gtest_output_test_golden_win.txt20
-rw-r--r--test/gtest_repeat_test.cc2
-rwxr-xr-xtest/gtest_uninitialized_test.py11
4 files changed, 22 insertions, 13 deletions
diff --git a/test/gtest_output_test.py b/test/gtest_output_test.py
index 0fea034..7ecb4d1 100755
--- a/test/gtest_output_test.py
+++ b/test/gtest_output_test.py
@@ -158,7 +158,7 @@ def GetCommandOutput(cmd):
"""
# Disables exception pop-ups on Windows.
- os.environ['GUNIT_CATCH_EXCEPTIONS'] = '1'
+ os.environ['GTEST_CATCH_EXCEPTIONS'] = '1'
return NormalizeOutput(GetShellCommandOutput(cmd, ''))
diff --git a/test/gtest_output_test_golden_win.txt b/test/gtest_output_test_golden_win.txt
index e72577d..87d1a6a 100644
--- a/test/gtest_output_test_golden_win.txt
+++ b/test/gtest_output_test_golden_win.txt
@@ -54,7 +54,7 @@ This failure is expected, and shouldn't have a trace.
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should have a trace.
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: Expected trace
gtest_output_test_.cc:#: Failure
Failed
@@ -66,13 +66,13 @@ gtest_output_test_.cc:#: Failure
Value of: n
Actual: 1
Expected: 2
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: i = 1
gtest_output_test_.cc:#: Failure
Value of: n
Actual: 2
Expected: 1
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: i = 2
[ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine
@@ -81,13 +81,13 @@ gtest_output_test_.cc:#: Failure
Value of: n
Actual: 1
Expected: 2
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: n = 1
gtest_output_test_.cc:#: Failure
Value of: n
Actual: 2
Expected: 1
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: n = 2
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested
@@ -96,7 +96,7 @@ gtest_output_test_.cc:#: Failure
Value of: n
Actual: 2
Expected: 1
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: n = 2
gtest_output_test_.cc:#:
[ FAILED ] SCOPED_TRACETest.CanBeNested
@@ -105,25 +105,25 @@ gtest_output_test_.cc:#:
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A.
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A and B.
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and C.
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: C
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
This failure is expected, and should contain trace point A, B, and D.
-gUnit trace:
+Google Test trace:
gtest_output_test_.cc:#: D
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
diff --git a/test/gtest_repeat_test.cc b/test/gtest_repeat_test.cc
index 056e6cc..fa52442 100644
--- a/test/gtest_repeat_test.cc
+++ b/test/gtest_repeat_test.cc
@@ -110,11 +110,13 @@ int g_death_test_count = 0;
TEST(BarDeathTest, ThreadSafeAndFast) {
g_death_test_count++;
+#ifdef GTEST_HAS_DEATH_TEST
GTEST_FLAG(death_test_style) = "threadsafe";
EXPECT_DEATH(abort(), "");
GTEST_FLAG(death_test_style) = "fast";
EXPECT_DEATH(abort(), "");
+#endif // GTEST_HAS_DEATH_TEST
}
// Resets the count for each test.
diff --git a/test/gtest_uninitialized_test.py b/test/gtest_uninitialized_test.py
index 1956a7b..d553bbf 100755
--- a/test/gtest_uninitialized_test.py
+++ b/test/gtest_uninitialized_test.py
@@ -80,8 +80,15 @@ def GetOutput(command):
def TestExitCodeAndOutput(command):
"""Runs the given command and verifies its exit code and output."""
- # 256 corresponds to return code 0.
- AssertEq(256, os.system(command))
+ # Verifies that 'command' exits with code 1.
+ if IS_WINDOWS:
+ # On Windows, os.system(command) returns the exit code of 'command'.
+ AssertEq(1, os.system(command))
+ else:
+ # On Unix-like system, os.system(command) returns 256 times the
+ # exit code of 'command'.
+ AssertEq(256, os.system(command))
+
output = GetOutput(command)
Assert('InitGoogleTest' in output)