End-to-end test harness for the SpaceOS pipeline
at main 52 lines 1.6 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Thomas Gazagnaire. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** SpaceOS E2E test harness — types and reporting. 7 8 Pure logic for result tracking and report formatting. The actual E2E steps 9 (build, run, assert) live in the CLI binary. *) 10 11(** {1 Configuration} *) 12 13type config = { 14 build_file : string option; 15 run_file : string option; 16 kernel : string option; 17 output : string option; 18 min_frames : int; 19 timeout : float; 20} 21(** E2E test configuration. *) 22 23val default_config : config 24(** Default configuration: 10 frames, 60s timeout. *) 25 26(** {1 Step results} *) 27 28type step_result = 29 | Pass of string 30 | Fail of string (** Result of a single E2E step. *) 31 32val is_pass : step_result -> bool 33(** [is_pass r] is [true] if [r] is [Pass _]. *) 34 35val pp_result : Format.formatter -> step_result -> unit 36(** [pp_result ppf r] prints [r] as [PASS msg] or [FAIL msg]. *) 37 38(** {1 Reporting} *) 39 40val exit_code : step_result list -> int 41(** [exit_code results] is [0] if all results are [Pass], [1] otherwise. *) 42 43val report : step_result list -> int 44(** [report results] prints a summary to stdout and returns {!exit_code}. *) 45 46(** {1 Assertions} *) 47 48val check_frames : received:int -> target:int -> step_result 49(** [check_frames ~received ~target] is [Pass] if [received >= target]. *) 50 51val check_exit_code : int -> step_result 52(** [check_exit_code n] is [Pass] if [n = 0]. *)