forked from Kappa-Dev/ExtentionBases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ml
64 lines (61 loc) · 1.84 KB
/
test.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
open Lib.Util
let test input debug mode =
match input with
0 ->
begin
if mode=1 then
Shape.KappaShape.simple_tests debug
else
if mode=2 then
Shape.KappaShape.generate_tests debug
else
Shape.KappaShape.interactive_tests debug ;
print_string "done\n"
end
| 1 ->
begin
if mode=1 then
Shape.SimpleShape.simple_tests debug
else
if mode=2 then
Shape.SimpleShape.generate_tests debug
else
Shape.SimpleShape.interactive_tests debug ;
print_string "done\n" ;
end
| 2 ->
begin
if mode=1 then
Shape.DegreeShape.simple_tests debug
else
if mode=2 then
Shape.DegreeShape.generate_tests debug
else
Shape.DegreeShape.interactive_tests debug ;
print_string "done\n" ;
end
| _ -> failwith "Invalid argument"
let () =
if Array.length Sys.argv > 1 && Sys.argv.(1) = "auto" then
test 0 false 2
else
let input = ask_until "[kappa|simple|degree] (kappa)\n"
(function "kappa" -> (true,0)
| "simple" -> (true,1)
| "degree" -> (true,2)
| _ -> (true,0)
)
in
let debug = ask_until "Debug mode y/n (n)? \n"
(function "y" -> (true,true)
| "n" -> (true,false)
| _ -> (true,false)
)
in
let mode = ask_until "Interactive, Simple or complete test (i/s/c)? (i)\n"
(function "s" -> (true,1)
| "c" -> (true,2)
| "i" -> (true,0)
| _ -> (true,0)
)
in test input debug mode