summaryrefslogtreecommitdiff
path: root/test/test_main.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2020-05-20 01:21:51 +1000
committerJed Barber <jjbarber@y7mail.com>2020-05-20 01:21:51 +1000
commitd07979218ea80c58e64148d9638ed3e6195ff6ed (patch)
treedef34d24f16923e8a05fc652e847240d8eb16865 /test/test_main.adb
parent65c9afbdc7daf588aaff505b2c148c4218f231d5 (diff)
Initial unit tests
Diffstat (limited to 'test/test_main.adb')
-rw-r--r--test/test_main.adb64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/test_main.adb b/test/test_main.adb
new file mode 100644
index 0000000..e116720
--- /dev/null
+++ b/test/test_main.adb
@@ -0,0 +1,64 @@
+
+
+with
+
+ Ada.Text_IO,
+ Ada.Command_Line,
+ Ada.Characters.Latin_1,
+ Unit_Tests,
+ Graph_Tests.Basic;
+
+
+use
+
+ Ada.Text_IO,
+ Unit_Tests;
+
+
+procedure Test_Main is
+
+
+ package Latin renames Ada.Characters.Latin_1;
+
+
+ Help_String : String :=
+ "Runs unit tests on the Ada Directed Graph library." & Latin.LF &
+ "Usage: graphtest [switches]" & Latin.LF &
+ Latin.LF &
+ "Valid switches:" & Latin.LF &
+ "--help" & Latin.HT & Latin.HT & "Shows this information" & Latin.LF &
+ "--verbose" & Latin.HT & "Enables extra verbosity" & Latin.LF &
+ Latin.LF &
+ "All other command line input will be ignored.";
+
+
+ How_Verbose : Verbosity := Weak;
+
+
+begin
+
+
+ for N in 1 .. Ada.Command_Line.Argument_Count loop
+ if Ada.Command_Line.Argument (N) = "--help" then
+ Put_Line (Help_String);
+ return;
+ end if;
+ end loop;
+
+
+ for N in 1 .. Ada.Command_Line.Argument_Count loop
+ if Ada.Command_Line.Argument (N) = "--verbose" then
+ How_Verbose := Strong;
+ exit;
+ end if;
+ end loop;
+
+
+ Put_Line ("Running basic construction and inspection tests...");
+ Run_Tests (Graph_Tests.Basic.Tests, How_Verbose);
+ -- New_Line;
+
+
+end Test_Main;
+
+