|
13 | 13 | *) |
14 | 14 | (** Simulation environment and set of unit tests for the domain memory balancer. *) |
15 | 15 |
|
16 | | -open Squeeze |
| 16 | +module D = Debug.Make (struct let name = "squeeze_test" end) |
| 17 | + |
| 18 | +open D |
| 19 | +open! Squeeze |
17 | 20 |
|
18 | 21 | (** Computes the memory_actual delta for a VM assuming the balloon driver |
19 | 22 | responds at a given speed. Warning: make sure the balloon_rate * time_passed |
@@ -433,7 +436,6 @@ let simulate scenario = |
433 | 436 | let out_filename = Printf.sprintf "%s.out" scenario.name in |
434 | 437 | let dat_oc = open_out dat_filename in |
435 | 438 | let out_oc = open_out out_filename in |
436 | | - debug_oc := out_oc ; |
437 | 439 | let cols = [Gnuplot.Memory_actual; Gnuplot.Target] in |
438 | 440 | Gnuplot.write_header dat_oc cols ; |
439 | 441 | let i = ref 0 in |
@@ -487,7 +489,6 @@ let simulate scenario = |
487 | 489 | (fun () -> |
488 | 490 | close_out dat_oc ; |
489 | 491 | close_out out_oc ; |
490 | | - debug_oc := stderr ; |
491 | 492 | Gnuplot.write_gp scenario.name (make_host ()) cols |
492 | 493 | ) |
493 | 494 |
|
@@ -519,11 +520,13 @@ let run_test scenario = |
519 | 520 | List.iter Xapi_stdext_unix.Unixext.unlink_safe |
520 | 521 | (files_created_by_scenario scenario) |
521 | 522 |
|
| 523 | +let prepare_tests scenarios = |
| 524 | + let prepare_test scenario = |
| 525 | + (scenario.description, `Quick, fun () -> run_test scenario) |
| 526 | + in |
| 527 | + List.map prepare_test scenarios |
| 528 | + |
522 | 529 | let go () = |
523 | | - List.iter run_test all_scenarios ; |
524 | | - debug "%d tests executed; %d unexpected results" |
525 | | - (List.length all_scenarios) |
526 | | - (List.length !failed_scenarios) ; |
527 | | - List.iter |
528 | | - (fun (scenario, error) -> debug "%s: %s" scenario.name error) |
529 | | - !scenario_error_table |
| 530 | + let suite = [("squeeze test", prepare_tests all_scenarios)] in |
| 531 | + Debug.log_to_stdout () ; |
| 532 | + Alcotest.run "squeeze suite" suite |
0 commit comments