Skip to content

Commit

Permalink
RunTests.m: Automatically find all test files and report a summary of…
Browse files Browse the repository at this point in the history
… failed files at the end
  • Loading branch information
ianhinder committed Mar 18, 2014
1 parent a4bde23 commit cf8339c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/RunTests.m
Expand Up @@ -23,21 +23,21 @@

(* SetDebugLevel[DebugQuiet]; *)

alltests = {
"CodeGen",
"Kranc",
"McLachlan",
"Tiling"
};
alltests = FileBaseName/@FileNames["*.mt"];

args = Drop[$ScriptCommandLine, 1];

If[Length[args] > 0,
If[StringMatchQ[args[[1]], "*.mt"],
tests = {StringReplace[args[[1]], ".mt" -> ""]}],
tests = alltests];
tests = FileBaseName/@Select[args, StringMatchQ[#, "*.mt"] &],
tests = alltests];

(Print["\n"]; TestRun[#<>".mt", Loggers -> {VerbosePrintLogger[]}, TestRunTitle -> #]) & /@ tests;
results = (Print["\n"]; TestRun[#<>".mt", Loggers -> {VerbosePrintLogger[]}, TestRunTitle -> #]) & /@ tests;
Print[];
Print[];
MapThread[Print[If[#2,"P","F"]," ",#1] &, {tests, results}];
Print[];

If[And@@results, Print["All tests passed"],
Print["Tests failed in ", StringJoin@Riffle[Pick[tests, Not/@results],", "]]];

(* ReportFunctionCounts[]; *)

0 comments on commit cf8339c

Please sign in to comment.