Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
f6b0dc0b
Commit
f6b0dc0b
authored
Sep 18, 2008
by
shiqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes Google Test compile (and all tests pass) on cygwin (possibly on wingw too).
parent
9e672bd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
gtest.cc
src/gtest.cc
+5
-4
gtest_output_test.py
test/gtest_output_test.py
+19
-1
No files found.
src/gtest.cc
View file @
f6b0dc0b
...
@@ -1546,16 +1546,17 @@ bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
...
@@ -1546,16 +1546,17 @@ bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
#ifdef GTEST_OS_WINDOWS
#ifdef GTEST_OS_WINDOWS
return
_wcsicmp
(
lhs
,
rhs
)
==
0
;
return
_wcsicmp
(
lhs
,
rhs
)
==
0
;
#elif defined(GTEST_OS_MAC)
#elif defined(GTEST_OS_LINUX)
// Mac OS X doesn't define wcscasecmp.
return
wcscasecmp
(
lhs
,
rhs
)
==
0
;
#else
// Mac OS X and Cygwin don't define wcscasecmp. Other unknown OSes
// may not define it either.
wint_t
left
,
right
;
wint_t
left
,
right
;
do
{
do
{
left
=
towlower
(
*
lhs
++
);
left
=
towlower
(
*
lhs
++
);
right
=
towlower
(
*
rhs
++
);
right
=
towlower
(
*
rhs
++
);
}
while
(
left
&&
left
==
right
);
}
while
(
left
&&
left
==
right
);
return
left
==
right
;
return
left
==
right
;
#else
return
wcscasecmp
(
lhs
,
rhs
)
==
0
;
#endif // OS selector
#endif // OS selector
}
}
...
...
test/gtest_output_test.py
View file @
f6b0dc0b
...
@@ -104,6 +104,20 @@ def RemoveTime(output):
...
@@ -104,6 +104,20 @@ def RemoveTime(output):
return
re
.
sub
(
r'\(\d+ ms'
,
'(? ms'
,
output
)
return
re
.
sub
(
r'\(\d+ ms'
,
'(? ms'
,
output
)
def
RemoveTestCounts
(
output
):
"""Removes test counts from a Google Test program's output."""
output
=
re
.
sub
(
r'\d+ tests from \d+ test cases'
,
'? tests from ? test cases'
,
output
)
return
re
.
sub
(
r'\d+ tests\.'
,
'? tests.'
,
output
)
def
RemoveDeathTests
(
output
):
"""Removes death test information from a Google Test program's output."""
return
re
.
sub
(
r'\n.*DeathTest.*'
,
''
,
output
)
def
NormalizeOutput
(
output
):
def
NormalizeOutput
(
output
):
"""Normalizes output (the output of gtest_output_test_.exe)."""
"""Normalizes output (the output of gtest_output_test_.exe)."""
...
@@ -182,7 +196,11 @@ class GTestOutputTest(unittest.TestCase):
...
@@ -182,7 +196,11 @@ class GTestOutputTest(unittest.TestCase):
golden
=
golden_file
.
read
()
golden
=
golden_file
.
read
()
golden_file
.
close
()
golden_file
.
close
()
self
.
assertEquals
(
golden
,
output
)
# We want the test to pass regardless of death tests being
# supported or not.
self
.
assert_
(
output
==
golden
or
RemoveTestCounts
(
output
)
==
RemoveTestCounts
(
RemoveDeathTests
(
golden
)))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment