aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChimrod <>2024-01-04 08:18:39 +0100
committerChimrod <>2024-01-04 08:18:39 +0100
commit0f9f5d50bd04e23956e3c84359042659ed25149f (patch)
treed469c462b2a4e5441d0b9878f154b485c98f7f6b
parent32cc150b5fc06e0c547b6d464cc6fa547ba874ba (diff)
Added return code to tell if everything is ok
-rw-r--r--bin/qsp_parser.ml16
-rw-r--r--readme.md4
2 files changed, 12 insertions, 8 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml
index 70f474e..1e897a0 100644
--- a/bin/qsp_parser.ml
+++ b/bin/qsp_parser.ml
@@ -149,11 +149,11 @@ let () =
with Qparser.Lexer.EOF -> ()
in
- let () =
- match (!ctx.error_nb, !ctx.warn_nb) with
- | 0, 0 -> print_endline "No errors found"
- | _ ->
- Printf.printf "Found %d error(s), %d warning(s)\n" !ctx.error_nb
- !ctx.warn_nb
- in
- ()
+ match (!ctx.error_nb, !ctx.warn_nb) with
+ | 0, 0 ->
+ print_endline "No errors found";
+ exit 0
+ | _ ->
+ Printf.printf "Found %d error(s), %d warning(s)\n" !ctx.error_nb
+ !ctx.warn_nb;
+ exit 1
diff --git a/readme.md b/readme.md
index e6efa88..ce0f022 100644
--- a/readme.md
+++ b/readme.md
@@ -36,6 +36,10 @@ results will be printed in the standard output:
]
Found 0 error(s), 2 warning(s)
+### Return code
+
+The application will return the code `0` when all the tests are passed without
+errors or warnings and `1` otherwise.
## Checks provided