From d07979218ea80c58e64148d9638ed3e6195ff6ed Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Wed, 20 May 2020 01:21:51 +1000 Subject: Initial unit tests --- test/test_main.adb | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 test/test_main.adb (limited to 'test/test_main.adb') 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; + + -- cgit