-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ml
executable file
·40 lines (27 loc) · 970 Bytes
/
main.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(* CIS515 Fall 2014 main test harness *)
(* Author: Prof. Santosh Nagarakatte *)
(* Do NOT modify this file -- we will overwrite it with our *)
(* own version when we test your homework. *)
open Assert
open Arg
exception Ran_tests
let worklist = ref []
let suite = ref (Providedtests.provided_tests @ Gradedtests.graded_tests)
let exec_tests () =
let o = run_suite !suite in
Printf.printf "%s\n" (outcome_to_string o);
raise Ran_tests
let do_one_file fn =
let _ = Printf.printf "Processing: %s\n" fn in ()
(* Use the --test option to run unit tests and the quit the program. *)
let argspec = [
("--test", Unit exec_tests, "run the test suite, ignoring other inputs");
]
let _ =
try
Arg.parse argspec (fun f -> worklist := f :: !worklist)
"Fall 2014 CS 515 main test harness \n";
match !worklist with
| [] -> print_endline "* Nothing to do"
| _ -> List.iter do_one_file !worklist
with Ran_tests -> ()