FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for Cygwin by ptheta · Pull Request #166 · unittest-cpp/unittest-cpp · GitHub

Add support for Cygwin - #166

Open
ptheta wants to merge 1 commit into
unittest-cpp:masterfrom
ptheta:cygwin1
Open

Add support for Cygwin#166
ptheta wants to merge 1 commit into
unittest-cpp:masterfrom
ptheta:cygwin1

Conversation

ptheta commented Dec 27, 2017

Copy link
Copy Markdown

Add UNITTEST_CYGWIN directive and use it to:
include Posix/TimeHelpers.h for Cygwin,
exclude the signal handling in SignalTranslator.h/.cpp as Cygwin does not have
the necessary Posix signal handling support, i.e. sigjmp_buf or siglongjmp.

Reimplement SleepMs in TimeHelpers.cpp using C++11 rather than usleep as that
is not present on Cygwin.

Update CMakeLists.txt to exclude SignalTranslator.h/.cpp from the build.

Add UNITTEST_CYGWIN directive and use it to:
include Posix/TimeHelpers.h for Cygwin,
exclude the signal handling in SignalTranslator.h/.cpp as Cygwin does not have
the necessary Posix signal handling support, i.e. sigjmp_buf or siglongjmp.

Reimplement SleepMs in TimeHelpers.cpp using C++11 rather than usleep as that
is not present on Cygwin.

Update CMakeLists.txt to exclude SignalTranslator.h/.cpp from the build.

ptheta commented Dec 28, 2017

Copy link
Copy Markdown
Author

I don't think the Travis failure is related to my changes. I checked out the current master branch ( bc5d87f) and I see a failure there like so:
[100%] Linking CXX executable TestUnitTest++
Running unit tests
*** Error in `./TestUnitTest++': free(): invalid pointer: 0x00007ffc7bfe7f98 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7908b)[0x7f4927b2708b]
/lib/x86_64-linux-gnu/libc.so.6(+0x82c3a)[0x7f4927b30c3a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f4927b34d2c]
./TestUnitTest++(_ZN8UnitTest11ExecuteTestINS_4TestEEEvRT_RKNS_11TestDetailsEb+0x4b)[0x4b8d4b]
./TestUnitTest++[0x489497]
./TestUnitTest++(_ZN8UnitTest11ExecuteTestINS_4TestEEEvRT_RKNS_11TestDetailsEb+0x4b)[0x4b8d4b]
./TestUnitTest++(_ZNK8UnitTest10TestRunner7RunTestEPNS_11TestResultsEPNS_4TestEi+0x55)[0x4b9475]
./TestUnitTest++(_ZN8UnitTest11RunAllTestsEv+0x4d)[0x4b91ed]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f4927ace3f1]
./TestUnitTest++(_start+0x2a)[0x40cfda]

pjohnmeyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@ptheta I'm not sure these changes are necessary. On Cygwin, just use the Win32 platform.

Happy to discuss? Also would need to make the changes C++98 compatible (for now).

void TimeHelpers::SleepMs(int ms)
{
usleep(static_cast<useconds_t>(ms * 1000));
std::this_thread::sleep_for(std::chrono::microseconds(ms * 1000));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We can't use <chrono> in UnitTest++ at this time. UnitTest++ does not require a modern compiler.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL