Skip to content

Commit

Permalink
feat: flag to enable/disable warn-error in the generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Apr 5, 2021
1 parent aa9c272 commit 77ce69d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/qtest_bin.mll
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@ let extract_from pathin = Lexing.(
close_in chanin
)

let _keep_warn_error = ref false

(** Generate the test suite from files list on currently selected output *)
let generate paths =
if not !quiet then eps "Extraction : "; List.iter extract_from paths;
if not !_keep_warn_error then out "[@@@ocaml.warnerror \"-a\"]\n";
out "let ___tests = ref []\nlet ___add test = ___tests := test::!___tests\n";
out hard_coded_preamble;
out (Buffer.contents global_preamble);
Expand Down Expand Up @@ -277,6 +279,9 @@ Add code to the tests preamble; typically this will be an instruction of the for
Add the contents of the given file to the tests preamble\n\
";

"--keep-warn-error", Arg.Set _keep_warn_error,
" <bool> keep/disable warn-error in the generated code";

"--run-only", Arg.String (fun s->Core._run_only := Some s),
" <function name> \
Only generate tests pertaining to this function, as indicated by the test header\
Expand Down

0 comments on commit 77ce69d

Please sign in to comment.