Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/onqtam/doctest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvage <29021710+Saalvage@users.noreply.github.com>2022-10-09 04:56:22 +0300
committerSalvage <29021710+Saalvage@users.noreply.github.com>2022-10-09 04:56:22 +0300
commita36f5ad9baad85800f4866dfd798563f7d4021c1 (patch)
treec75d949b003415de333616a93b91b6aefc59659d
parentdb88ddd02420166245b399db6e290720fdf386f2 (diff)
Different sleep impl
-rw-r--r--examples/all_features/test_cases_and_suites.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/examples/all_features/test_cases_and_suites.cpp b/examples/all_features/test_cases_and_suites.cpp
index 87dd64a5..492c904e 100644
--- a/examples/all_features/test_cases_and_suites.cpp
+++ b/examples/all_features/test_cases_and_suites.cpp
@@ -45,18 +45,20 @@ TEST_CASE_FIXTURE(SomeFixture, "fixtured test - not part of a test suite") {
}
DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
-DOCTEST_CLANG_SUPPRESS_WARNING_PUSH
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wreserved-id-macro")
-DOCTEST_CLANG_SUPPRESS_WARNING("-Wunused-macros")
-#define __mulodi4(a, b, c) a * b
-DOCTEST_CLANG_SUPPRESS_WARNING_POP
-#include <chrono>
-#include <thread>
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif // _WIN32_CLEAN_FROM_WARNINGS_ON_WALL_END
DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
TEST_CASE("normal test in a test suite from a decorator" * doctest::test_suite("ts1") *
doctest::timeout(0.000001)) {
- std::this_thread::sleep_for(std::chrono::nanoseconds(1000000));
+#ifdef _WIN32
+ Sleep(1000);
+#else
+ usleep(1000000);
+#endif // _WIN32
MESSAGE("failing because of the timeout decorator!");
}