Source file Msg_from_master.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(*
   Messages sent from the master process to a worker.
*)

open Printf

type t = Start_test of string

let of_string str =
  match String.split_on_char ' ' str with
  | [ "START_TEST"; test_id ] -> Start_test test_id
  | _ -> failwith (sprintf "Invalid message received from master: %S" str)

let to_string x =
  match x with
  | Start_test test_id -> sprintf "START_TEST %s" test_id