tanghong123 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compilation of gtest-filepath_test fails on OpenBSD #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make distcheck on OpenBSD

What is the expected output? What do you see instead?
creating test/gtest_environment_test
depbase=`echo test/gtest-filepath_test.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
if g++ -DHAVE_CONFIG_H -I. -I.. -I./build-aux  -I.. -I../include   -g -O2
-MT test/gtest-filepath_test.o -MD -MP -MF "$depbase.Tpo" -c -o
test/gtest-filepath_test.o ../test/gtest-filepath_test.cc; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
../test/gtest-filepath_test.cc: In member function `virtual void 

testing::internal::<unnamed>::GetCurrentDirTest_ReturnsCurrentDir_Test::TestBody
()
   ':
../test/gtest-filepath_test.cc:101: error: `chdir' undeclared (first use this 
   function)
../test/gtest-filepath_test.cc:101: error: (Each undeclared identifier is 
   reported only once for each function it appears in.)
../test/gtest-filepath_test.cc: In member function `virtual void 
   testing::internal::<unnamed>::DirectoryCreationTest::SetUp()':
../test/gtest-filepath_test.cc:379: error: `rmdir' undeclared (first use this 
   function)
../test/gtest-filepath_test.cc: In member function `virtual void 
   testing::internal::<unnamed>::DirectoryCreationTest::TearDown()':
../test/gtest-filepath_test.cc:390: error: `rmdir' undeclared (first use this 
   function)
gmake[2]: *** [test/gtest-filepath_test.o] Error 1

What version of the product are you using? On what operating system?
OpenBSD 4.0 GENERIC#1107 i386
g++ (GCC) 3.3.5 (propolice)

Please provide any additional information below.
The fix is trivial:
Index: test/gtest-filepath_test.cc
===================================================================
--- test/gtest-filepath_test.cc (revision 164)
+++ test/gtest-filepath_test.cc (working copy)
@@ -58,6 +58,7 @@
 #endif  // _WIN32_WCE
 #define PATH_SEP "\\"
 #else
+#include <unistd.h>
 #define PATH_SEP "/"
 #endif  // GTEST_OS_WINDOWS

Original issue reported on code.google.com by tsuna...@gmail.com on 11 Dec 2008 at 5:45

GoogleCodeExporter commented 9 years ago
Forgot to say, I found this in tags/release-1.2.1

Original comment by tsuna...@gmail.com on 11 Dec 2008 at 5:46

GoogleCodeExporter commented 9 years ago

Original comment by shiq...@gmail.com on 16 Dec 2008 at 4:22

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 22 Feb 2009 at 5:50

GoogleCodeExporter commented 9 years ago
The code has changed drastically.  We now have a POSIX portability layer, which
should take care of it.  Please re-open the issue if you still see the problem 
in the
trunk.

Original comment by w...@google.com on 10 Dec 2009 at 6:07