Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
45
hw1/bin/main.ml
Normal file
45
hw1/bin/main.ml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
(* CIS341 main test harness *)
|
||||
(* Author: Steve Zdancewic *)
|
||||
|
||||
(* Do NOT modify this file -- we will overwrite it with our *)
|
||||
(* own version when we test your homework. *)
|
||||
|
||||
open Util.Assert
|
||||
open Arg
|
||||
|
||||
exception Ran_tests
|
||||
|
||||
let worklist = ref []
|
||||
|
||||
let suite = ref (Studenttests.student_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)
|
||||
"CIS341 main test harness \n" ;
|
||||
match !worklist with
|
||||
| [] ->
|
||||
print_endline "* Nothing to do"
|
||||
| _ ->
|
||||
List.iter do_one_file !worklist
|
||||
with
|
||||
| Ran_tests ->
|
||||
()
|
||||
Loading…
Add table
Add a link
Reference in a new issue