jinxuan / googletest

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

pthread support is broken on platforms where pthread_t is a struct #363

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Build gtest on a system where pthread_t is a struct rather than an arithmetic 
type (e.g., MinGW 5.1.6).

Recent revision of the standard WRT pthreads allows pthread_t to be a struct 
(http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html, 
issue 6).

Original issue reported on code.google.com by vladlosev on 29 Mar 2011 at 9:34

GoogleCodeExporter commented 9 years ago
Both 1.5.0 & 1.6.0 versions of gtest & gmock don't work with MinGW.

Original comment by anberlin...@gmail.com on 15 Apr 2011 at 7:05

GoogleCodeExporter commented 9 years ago
Attached is a patch that fixes compilation problems on mingw.

This has been tested using CMake and the mingw from QtCreator 2.1.

Note: the patch does not apply on 1.5.0, I can work on this if you want.

I've run the automatic tests, but for instance in the first test
I got this :

1: [----------] 1 test from PopUpDeathTest
1: [ RUN      ] PopUpDeathTest.DoesNotShowPopUpOnAbort
1: This test should be considered failing if it shows any pop-up dialogs.
1: Running main() from gtest_main.cc
1: This test should be considered failing if it shows any pop-up dialogs.
1: [       OK ] PopUpDeathTest.DoesNotShowPopUpOnAbort (9395 ms)
1: [----------] 1 test from PopUpDeathTest (9395 ms total)

....
and I do have a pop up showing up.

This makes it annoying to run the entire test suite.

Is there something I'm missing ?

Original comment by yannickl...@gmail.com on 15 Apr 2011 at 12:54

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch.

Did you write it yourself or get it from someone else?  I'm asking as we need 
the author to sign a CLA 
(http://code.google.com/p/googletest/wiki/DevGuide#Contributor_License_Agreement
s) before we can accept the patch, and the patch contains:

"From: dmerejkowsky <dmerejkowsky@aldebaran-robotics.com>"

Original comment by w...@google.com on 15 Apr 2011 at 5:33

GoogleCodeExporter commented 9 years ago
@Zhanyong Wan : CLA sent by e-mail.

And yes, I did write this patch.

Original comment by yannickl...@gmail.com on 26 Apr 2011 at 9:57

GoogleCodeExporter commented 9 years ago
This patch works for me. Was is forgotten or is there something else preventing 
the patch from being applied?

Original comment by markdigitalchips on 18 Mar 2012 at 1:52

GoogleCodeExporter commented 9 years ago
@yannicklm1337

I see you mentioned emailing the signed CLA, but I don't have any record of it. 
Would you mind signing that and sending it over again? I'll make sure to note 
it in our file. Thanks.

http://code.google.com/p/googletest/wiki/DevGuide#Contributor_License_Agreements

Original comment by j...@google.com on 19 Mar 2012 at 5:07

GoogleCodeExporter commented 9 years ago
I just submitted http://code.google.com/p/googletest/source/detail?r=613, which 
adds support for platforms where pthread_t is a struct. This should address the 
original bug report. If there are still issues with MinGW as some folks have 
mentioned, that should be filed in a separate bug. I don't have mingw to test 
with right now.

Original comment by j...@google.com on 2 Apr 2012 at 5:44