Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add support for Cygwin#166

Open
ptheta wants to merge 1 commit into
unittest-cpp:masterunittest-cpp/unittest-cpp:masterfrom
ptheta:cygwin1ptheta/unittest-cpp:cygwin1Copy head branch name to clipboard
Open

Add support for Cygwin#166
ptheta wants to merge 1 commit into
unittest-cpp:masterunittest-cpp/unittest-cpp:masterfrom
ptheta:cygwin1ptheta/unittest-cpp:cygwin1Copy head branch name to clipboard

Conversation

@ptheta

@ptheta 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

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 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.

@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.

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

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.