Add actual test suite for configurator

This commit is contained in:
Rudi Grinberg 2018-04-05 12:12:59 +08:00
parent e832b7230d
commit ab9b278304
4 changed files with 23 additions and 0 deletions

View File

@ -459,3 +459,13 @@
(progn
(run ${exe:cram.exe} run.t)
(diff? run.t run.t.corrected))))))
(alias
((name runtest)
(deps ((package jbuilder)
(files_recursively_in test-cases/configurator)))
(action
(chdir test-cases/configurator
(progn
(run ${exe:cram.exe} run.t)
(diff? run.t run.t.corrected))))))

View File

@ -0,0 +1,5 @@
(jbuild_version 1)
(executable
((name run)
(libraries (jbuilder.configurator))))

View File

@ -0,0 +1,6 @@
let () =
Configurator.main ~name:"config" (fun t ->
match Configurator.ocaml_config_var t "version" with
| None -> failwith "version is absent"
| Some _ -> print_endline "version is present"
)

View File

@ -0,0 +1,2 @@
$ jbuilder exec config/run.exe
version is present