summaryrefslogtreecommitdiff
path: root/src/unit_tests.ads
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2020-05-19 15:22:55 +1000
committerJed Barber <jjbarber@y7mail.com>2020-05-19 15:22:55 +1000
commit196a1a2443b8a66784d293120ee64840ee87f02e (patch)
tree98f36e8d72aecd40be8fb5c767f915966d57fd8a /src/unit_tests.ads
Factored out and improved slightly from Packrat project
Diffstat (limited to 'src/unit_tests.ads')
-rw-r--r--src/unit_tests.ads66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/unit_tests.ads b/src/unit_tests.ads
new file mode 100644
index 0000000..473b828
--- /dev/null
+++ b/src/unit_tests.ads
@@ -0,0 +1,66 @@
+
+
+with
+
+ Ada.Strings.Unbounded;
+
+
+package Unit_Tests is
+
+
+ type Verbosity is (None, Weak, Strong);
+
+
+
+
+ type Test_Result is (Fail, Pass);
+
+ type Test_Function is access function return Test_Result;
+
+ type Test is record
+ Name : Ada.Strings.Unbounded.Unbounded_String;
+ Func : Test_Function;
+ end record;
+
+ type Test_Array is array (Positive range <>) of Test;
+
+ type Test_Result_Array is array (Positive range <>) of Test_Result;
+
+
+
+
+ function Run_Test
+ (To_Run : in Test;
+ Verbose : in Verbosity := Weak)
+ return Test_Result;
+
+ procedure Run_Test
+ (To_Run : in Test;
+ Verbose : in Verbosity := Weak);
+
+ function Run_Tests
+ (To_Run : in Test_Array;
+ Verbose : in Verbosity := Weak)
+ return Test_Result_Array;
+
+ procedure Run_Tests
+ (To_Run : in Test_Array;
+ Verbose : in Verbosity := Weak);
+
+
+
+
+ function "+"
+ (S : in String)
+ return Ada.Strings.Unbounded.Unbounded_String
+ renames Ada.Strings.Unbounded.To_Unbounded_String;
+
+ function "-"
+ (US : in Ada.Strings.Unbounded.Unbounded_String)
+ return String
+ renames Ada.Strings.Unbounded.To_String;
+
+
+end Unit_Tests;
+
+