diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-05 18:23:21 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-05 18:23:21 +0200 |
commit | 301d39f1a31f7bf091776d4132e18921020bfa4c (patch) | |
tree | 55cd58fba9cf718a71a32b3fbb360b69c332e622 | |
parent | 18b779d93b6f2a11ed1b45fcb9dc4f657abd969f (diff) |
Add beginnings of unit tests
Currently just the test runner and a simple test which calls CreateThorn with minimal arguments. You will need Wolfram Workbench installed, and my MUnitRunner package from https://bitbucket.org/ianhinder/munitrunner, and "math" on your path. Executing ./RunTests.m from the Tests directory will run the test. Generated thorn output is not yet stored in the repository as I don't know how large it will get. Differences are also not yet checked against any reference files.
-rw-r--r-- | Tests/Kranc.mt | 14 | ||||
-rwxr-xr-x | Tests/RunTests.m | 26 |
2 files changed, 40 insertions, 0 deletions
diff --git a/Tests/Kranc.mt b/Tests/Kranc.mt new file mode 100644 index 0000000..301f95e --- /dev/null +++ b/Tests/Kranc.mt @@ -0,0 +1,14 @@ + +(* Mathematica Test File *) + +(****************************************************************) +(* CreateThorn *) +(****************************************************************) + +Test[ + CreateKrancThornTT[{}, "TestThorns", "CreateThorn", Calculations -> {}] + , + Null + , + TestID->"CreateThorn" +] diff --git a/Tests/RunTests.m b/Tests/RunTests.m new file mode 100755 index 0000000..99cae33 --- /dev/null +++ b/Tests/RunTests.m @@ -0,0 +1,26 @@ +#!/usr/bin/env math -script + +SetOptions[ $Output, FormatType -> OutputForm ]; + +<< MUnitRunner`; + +(****************************************************************) +(* Initialise *) +(****************************************************************) + +Kranc`KrancDirectory = FileNameJoin[{Directory[],".."}]; + +$Path = Join[$Path, + {Kranc`KrancDirectory <> "/Tools/CodeGen", + Kranc`KrancDirectory <> "/Tools/MathematicaMisc", + Kranc`KrancDirectory <> "/Tools/PirahaPeg"}]; +Needs["Errors`"]; +Needs["KrancThorn`"]; +(* (\* Needs["Profile`"]; *\) *) + +tests = { + "Kranc" +}; + +(Print["\n"]; TestRun[#<>".mt", Loggers -> {VerbosePrintLogger[]}, TestRunTitle -> #]) & /@ tests; +Print[]; |