package ortac-dune
Generate dune rules for other ortac plugins
Install
Dune Dependency
Authors
Maintainers
Sources
0.7.1.tar.gz
md5=de704f2acde11eb11a3a8f7155d1803c
sha512=060969ff333cd36d445a36ccbab4acf5269a4fae5720389e551fb90c303c09a25db23074b7b243634a507ded1e95a927f4a9af209b21924feda41a57140625b7
doc/src/ortac-dune.plugin/dune_rules.ml.html
Source file dune_rules.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
open Cmdliner module Plugin : sig val cmd : unit Cmd.t end = struct module Qcheck_stm : sig val cmd : unit Cmd.t end = struct let info = Cmd.info "qcheck-stm" ~doc:"Generate Dune rules for the qcheck-stm plugin." let interface_file = Arg.( required & pos 0 (some string) None & info [] ~doc:"Interface file containing Gospel specifications." ~docv:"INTERFACE") let config_file = Arg.( value & opt (some string) None & info [ "c"; "config" ] ~doc: "Configuration file for Ortac/QCheck-STM. Useful for generating \ multiple test files per module under test." ~absent: "concatenation of INTERFACE without the extension and \ \"_config.ml\"" ~docv:"CONFIG") let ocaml_output = Arg.( value & opt (some string) None & info [ "o"; "output" ] ~doc: "Filename for the generated tests. Useful for generating \ multiple test files per module under test." ~absent: "concatenation of INTERFACE without the file extension and \ \"_tests.ml\"" ~docv:"OCAML_OUTPUT") let library = Arg.( value & opt (some string) None & info [ "l"; "library" ] ~doc:"Name of the library the module under test belongs to." ~absent:"INTERFACE without the file extension" ~docv:"LIBRARY") let package_name = Arg.( value & opt (some string) None & info [ "p"; "package" ] ~doc:"Package name." ~docv:"PACKAGE") let with_stdout_to = Arg.( value & opt (some string) None & info [ "w"; "with-stdout-to" ] ~doc: "Filename for the generated dune rules. For use on the command \ line." ~docv:"DUNE_OUTPUT") let module_prefix = Arg.( value & opt (some string) None & info [ "m"; "module-prefix" ] ~doc: "Prefix for opening the module corresponding to FILE when it is \ part of a library that has MODULE_PREFIX as name." ~docv:"MODULE_PREFIX") let submodule = Arg.( value & opt (some string) None & info [ "s"; "submodule" ] ~doc:"Build the qcheck-stm tests for SUBMODULE inside FILE" ~docv:"SUBMODULE") let fork_timeout = Arg.( value & opt (some int) None & info [ "t"; "timeout" ] ~doc:"Timeout for each test." ~docv:"TIMEOUT") let main interface_file config_file ocaml_output library package_name dune_output module_prefix submodule fork_timeout = let open Qcheck_stm in let config = { interface_file; config_file; ocaml_output; library; package_name; dune_output; module_prefix; submodule; fork_timeout; } in let ppf = Registration.get_out_formatter dune_output in Qcheck_stm.gen_dune_rules ppf config let term = Term.( const main $ interface_file $ config_file $ ocaml_output $ library $ package_name $ with_stdout_to $ module_prefix $ submodule $ fork_timeout) let cmd = Cmd.v info term end module Wrapper : sig val cmd : unit Cmd.t end = struct let info = Cmd.info "wrapper" ~doc:"Generate Dune rules for the wrapper plugin." let interface_file = Arg.( required & pos 0 (some string) None & info [] ~doc:"Interface file containing Gospel specifications." ~docv:"INTERFACE") let ocaml_output = Arg.( value & opt (some string) None & info [ "o"; "output" ] ~doc: "Filename for the generated tests. Useful for generating \ multiple test files per module under test." ~absent: "concatenation of INTERFACE without the file extension and \ \"_tests.ml\"" ~docv:"OCAML_OUTPUT") let package_name = Arg.( value & opt (some string) None & info [ "p"; "package" ] ~doc:"Package name." ~docv:"PACKAGE") let with_stdout_to = Arg.( value & opt (some string) None & info [ "w"; "with-stdout-to" ] ~doc: "Filename for the generated dune rules. For use on the command \ line." ~docv:"DUNE_OUTPUT") let main interface_file package_name ocaml_output dune_output = let open Wrapper in let config = { interface_file; package_name; ocaml_output; dune_output } in let ppf = Registration.get_out_formatter dune_output in Wrapper.gen_dune_rules ppf config let term = Term.( const main $ interface_file $ package_name $ ocaml_output $ with_stdout_to) let cmd = Cmd.v info term end let cmd = let info = Cmd.info "dune" ~doc:"Generate Dune rule for ortac plugins." in Cmd.group info [ Qcheck_stm.cmd; Wrapper.cmd ] end (* let () = Stdlib.exit (Cmd.eval Plugin.cmd) *) let () = Registration.register Plugin.cmd
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>