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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 4 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ endif(WIN32)

file(GLOB platformHeaders_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/${platformDir_}/*.h)
file(GLOB platformSources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/${platformDir_}/*.cpp)
if(CYGWIN)
list(REMOVE_ITEM platformHeaders_ UnitTest++/${platformDir_}/SignalTranslator.h)
list(REMOVE_ITEM platformSources_ UnitTest++/${platformDir_}/SignalTranslator.cpp)
endif()
source_group(${platformDir_} FILES ${platformHeaders_} ${platformSources_})

# create the lib
Expand Down
6 changes: 6 additions & 0 deletions 6 UnitTest++/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@
#define UNITTEST_WIN32
#endif

#ifndef __CYGWIN__
#if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \
defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) \
|| defined (__HAIKU__)
#define UNITTEST_POSIX
#endif
#endif

#if defined(__CYGWIN__)
#define UNITTEST_CYGWIN
#endif

#if defined(__MINGW32__)
#define UNITTEST_MINGW
Expand Down
4 changes: 3 additions & 1 deletion 4 UnitTest++/Posix/TimeHelpers.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "TimeHelpers.h"
#include <chrono>
#include <thread>
#include <unistd.h>

namespace UnitTest {
Expand Down Expand Up @@ -27,7 +29,7 @@ namespace UnitTest {

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.

}

}
2 changes: 1 addition & 1 deletion 2 UnitTest++/TimeHelpers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Config.h"

#if defined UNITTEST_POSIX
#if defined(UNITTEST_POSIX) || defined(UNITTEST_CYGWIN)
#include "Posix/TimeHelpers.h"
#else
#include "Win32/TimeHelpers.h"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.