[education/rkward] rkward/autotests: Check whether order of test cases is related to failures
Thomas Friedrichsmeier
null at kde.org
Sun Oct 2 17:07:21 BST 2022
Git commit e7d27f6314b7f9c6e607d89d0b59e19e1e6480e3 by Thomas Friedrichsmeier.
Committed on 02/10/2022 at 16:07.
Pushed by tfry into branch 'master'.
Check whether order of test cases is related to failures
M +15 -15 rkward/autotests/core_test.cpp
https://invent.kde.org/education/rkward/commit/e7d27f6314b7f9c6e607d89d0b59e19e1e6480e3
diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 59ba318e..2863f4b4 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -209,6 +209,21 @@ private slots:
cleanGlobalenv();
}
+ void priorityCommandTest() {
+ bool priority_command_done = false;
+ runCommandAsync(new RCommand("Sys.sleep(5)", RCommand::User), nullptr, [&priority_command_done](RCommand *command) {
+ QVERIFY(priority_command_done);
+ QVERIFY(command->failed());
+ QVERIFY(command->wasCanceled());
+ });
+ auto priority_command = new RCommand("cat(\"something\\n\")", RCommand::PriorityCommand | RCommand::App);
+ runCommandAsync(priority_command, nullptr, [&priority_command_done](RCommand *) {
+ priority_command_done = true;
+ RInterface::instance()->cancelAll();
+ });
+ waitForAllFinished(); // priority_command_done must remain in scope until done
+ }
+
void commandOrderAndOutputTest() {
// commands shall run in the order 1, 3, 2, 5, 4, but also, of course, all different types of output shall be captured
QStringList output;
@@ -266,21 +281,6 @@ private slots:
testLog("%d out of %d commands were actually cancelled", cancelled_commands, commands_out);
}
- void priorityCommandTest() {
- bool priority_command_done = false;
- runCommandAsync(new RCommand("Sys.sleep(5)", RCommand::User), nullptr, [&priority_command_done](RCommand *command) {
- QVERIFY(priority_command_done);
- QVERIFY(command->failed());
- QVERIFY(command->wasCanceled());
- });
- auto priority_command = new RCommand("cat(\"something\\n\")", RCommand::PriorityCommand | RCommand::App);
- runCommandAsync(priority_command, nullptr, [&priority_command_done](RCommand *) {
- priority_command_done = true;
- RInterface::instance()->cancelAll();
- });
- waitForAllFinished(); // priority_command_done must remain in scope until done
- }
-
void restartRBackend() {
auto restart_action = RKWardMainWindow::getMain()->actionCollection()->action("restart_r");
QVERIFY(restart_action != nullptr);
More information about the rkward-tracker
mailing list