package ounit2

  1. Overview
  2. Docs

Module OUnitStateSource

Manipulate the state of OUnit runner.

Sourcetype 'worker next_test_case_t =
  1. | Not_enough_worker
  2. | Try_again
  3. | Next_test_case of OUnitTest.path * OUnitTest.test_fun * 'worker
  4. | Finished
Sourcetype time = float
Sourcetype 'worker test_running = {
  1. test_length : OUnitTest.test_length;
  2. deadline : time;
  3. next_health_check : time;
  4. worker : 'worker;
}
Sourcetype 'worker t = {
  1. tests_planned : (OUnitTest.path * (OUnitTest.test_length * OUnitTest.test_fun)) list;
  2. tests_running : (OUnitTest.path * 'worker test_running) list;
  3. tests_passed : (OUnitTest.result_full * OUnitTest.result_list) list;
  4. idle_workers : 'worker list;
  5. chooser : OUnitChooser.chooser;
  6. cache : OUnitCache.cache;
  7. health_check_interval : time;
}
Sourceval health_check_interval : float OUnitConf.var
Sourceval filter_out : 'a -> ('a * 'b) list -> ('a * 'b) list
Sourceval maybe_dump_cache : OUnitConf.conf -> 'a t -> 'a t
Sourceval add_test_results : OUnitConf.conf -> (OUnitTest.result_full * OUnitTest.result_list) -> 'a t -> 'a t
Sourceval test_finished : OUnitConf.conf -> (OUnitTest.result_full * OUnitTest.result_list) -> 'a -> 'a t -> 'a t
Sourceval add_worker : 'a -> 'a t -> 'a t
Sourceval remove_idle_worker : 'a -> 'a t -> 'a t
Sourceval count_worker : 'a t -> int
Sourceval count_tests_running : 'a t -> int
Sourceval get_workers : 'a t -> 'a list
Sourceval get_idle_workers : 'a t -> 'a list
Sourceval is_idle_worker : 'a -> 'a t -> bool
Sourceval get_tests_running : 'a t -> OUnitTest.path list
Sourceval get_results : 'a t -> OUnitTest.result_full list

Get all the results.

Sourceval get_worker_need_health_check : 'a t -> (OUnitTest.path option * 'a) list

Get all the workers that need to be checked for their health.

Sourceval update_test_activity : OUnitTest.path -> 'a t -> 'a t

Update the activity of a worker, this postpone the next health check.

Sourceval get_worker_timed_out : 'a t -> (OUnitTest.path * OUnitTest.test_length * 'a) list

Get all the workers that are timed out, i.e. that need to be stopped.

Sourceval timeout : 'a t -> float

Compute when is the next time, we should either run health check or timeout a test.

OCaml

Innovation. Community. Security.