diff --git a/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d b/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d index 33dc35f..324a982 100644 --- a/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d +++ b/test/issue_2051_running_unittests_from_dub_single_file_packages_fails.d @@ -20,24 +20,7 @@ writeln("\t", line); writeln("--- end of dub output"); - enforce(dub.status == 0, "couldn't build the project, see above"); - - return dub.output; -} - -/// check dub output to determine rebuild has not been triggered -auto checkUnittestsResult(string output) -{ - if (output.lineSplitter.any!(a=> a == "All unit tests have been run successfully.")) - { - writeln("\nOk. Unittest passed."); - return 0; - } - else - { - writeln("\nError. Unittests failed."); - return 1; - } + return dub.status; } int main() @@ -70,7 +53,11 @@ ` ); } - return text(dub, " test --single ", filename) - .executeCommand - .checkUnittestsResult; + const rc1 = text(dub, " test --single ", filename).executeCommand; + if (rc1) + writeln("\nError. Unittests failed."); + else + writeln("\nOk. Unittest passed."); + + return rc1; } \ No newline at end of file