mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-31 07:58:43 +03:00
PRUSA 2.7.0
This commit is contained in:
@@ -18,6 +18,6 @@ if (WIN32)
|
||||
endif()
|
||||
|
||||
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
set(_catch_args "exclude:[NotWorking]")
|
||||
set(_catch_args "exclude:[NotWorking];-s")
|
||||
list(APPEND _catch_args "${CATCH_EXTRA_ARGS}")
|
||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${_catch_args})
|
||||
|
||||
@@ -20,6 +20,13 @@ struct Progress: Slic3r::ProgressIndicator {
|
||||
|
||||
using TestClasses = std::tuple< Slic3r::GUI::UIThreadWorker, Slic3r::GUI::BoostThreadWorker >;
|
||||
|
||||
TEMPLATE_LIST_TEST_CASE("Empty worker should not block when queried for idle", "[Jobs]", TestClasses) {
|
||||
TestType worker{std::make_unique<Progress>()};
|
||||
|
||||
worker.wait_for_idle();
|
||||
|
||||
REQUIRE(worker.is_idle());
|
||||
}
|
||||
TEMPLATE_LIST_TEST_CASE("Empty worker should not do anything", "[Jobs]", TestClasses) {
|
||||
TestType worker{std::make_unique<Progress>()};
|
||||
|
||||
@@ -49,6 +56,8 @@ TEMPLATE_LIST_TEST_CASE("State should not be idle while running a job", "[Jobs]"
|
||||
}).wait();
|
||||
});
|
||||
|
||||
// make sure that the job starts BEFORE the worker.wait_for_idle() is called
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
worker.wait_for_idle();
|
||||
|
||||
REQUIRE(worker.is_idle());
|
||||
@@ -85,7 +94,8 @@ TEMPLATE_LIST_TEST_CASE("Cancellation should be recognized be the worker", "[Job
|
||||
for (int s = 0; s <= 100; ++s) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
ctl.update_status(s, "Running");
|
||||
if (ctl.was_canceled()) break;
|
||||
if (ctl.was_canceled())
|
||||
break;
|
||||
}
|
||||
},
|
||||
[](bool cancelled, std::exception_ptr &) { // finalize
|
||||
|
||||
Reference in New Issue
Block a user