Run dif tests on cargo test
This commit is contained in:
@@ -195,6 +195,15 @@ main :-
|
|||||||
show_failed(Failed),
|
show_failed(Failed),
|
||||||
halt.
|
halt.
|
||||||
|
|
||||||
|
main_quiet :-
|
||||||
|
findall(test(Name, Goal), test(Name, Goal), Tests),
|
||||||
|
run_tests_quiet(Tests, Failed),
|
||||||
|
( Failed = [] ->
|
||||||
|
format("All tests passed", [])
|
||||||
|
; format("Some tests failed", [])
|
||||||
|
),
|
||||||
|
halt.
|
||||||
|
|
||||||
portray_failed_([]) --> [].
|
portray_failed_([]) --> [].
|
||||||
portray_failed_([F|Fs]) -->
|
portray_failed_([F|Fs]) -->
|
||||||
"\"", F, "\"", "\n", portray_failed_(Fs).
|
"\"", F, "\"", "\n", portray_failed_(Fs).
|
||||||
@@ -217,6 +226,14 @@ run_tests([test(Name, Goal)|Tests], Failed) :-
|
|||||||
),
|
),
|
||||||
run_tests(Tests, Failed1).
|
run_tests(Tests, Failed1).
|
||||||
|
|
||||||
|
run_tests_quiet([], []).
|
||||||
|
run_tests_quiet([test(Name, Goal)|Tests], Failed) :-
|
||||||
|
( call(Goal) ->
|
||||||
|
Failed = Failed1
|
||||||
|
; Failed = [Name|Failed1]
|
||||||
|
),
|
||||||
|
run_tests_quiet(Tests, Failed1).
|
||||||
|
|
||||||
assert_p(A, B) :-
|
assert_p(A, B) :-
|
||||||
phrase(portray_clause_(A), Portrayed),
|
phrase(portray_clause_(A), Portrayed),
|
||||||
phrase((B, ".\n"), Portrayed).
|
phrase((B, ".\n"), Portrayed).
|
||||||
@@ -75,3 +75,12 @@ fn clpz_load() {
|
|||||||
fn iso_conformity_tests() {
|
fn iso_conformity_tests() {
|
||||||
load_module_test("tests-pl/iso-conformity-tests.pl", "All tests passed");
|
load_module_test("tests-pl/iso-conformity-tests.pl", "All tests passed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dif_tests() {
|
||||||
|
run_top_level_test_with_args(
|
||||||
|
&["src/tests/dif.pl", "-f", "-g", "main_quiet"],
|
||||||
|
"",
|
||||||
|
"All tests passed",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user