PRUSA 2.7.0

This commit is contained in:
sunsets
2023-12-27 18:02:35 +08:00
parent b33112327f
commit 0a3c63dcb1
488 changed files with 92371 additions and 29443 deletions

View File

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