Skip to content

Commit

Permalink
tests in dune, fixup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mgree committed Dec 19, 2023
1 parent 893b1f2 commit f823f48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ jobs:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install OCaml bindings
run: opam install .
run: dune install

- name: Test OCaml bindings
run: opam exec -- make -C ocaml test
run: dune test

# we don't reuse the wheels so that all of the CI runs can happen concurrently
- name: Install Python directly
Expand Down
10 changes: 10 additions & 0 deletions ocaml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@
(run sed -i -e "/type char = Libdash.Ast.char/d" ast_atd_j.mli)
(run mv ast_atd_j.ml ast_json.ml)
(run mv ast_atd_j.mli ast_json.mli))))

(rule
(alias runtest)
(deps (glob_files ../test/tests/*) (glob_files ../test/pash_tests/*) rt.sh %{bin:json_to_shell} %{bin:shell_to_json})
(action
(setenv
JSON_TO_SHELL %{bin:json_to_shell}
(setenv
SHELL_TO_JSON %{bin:shell_to_json}
(bash "{ find ../test/tests ../test/pash_tests -type f | while read f; do ../test/round_trip.sh ./rt.sh \"$f\"; done | egrep '^[A-Z0-9_]+:' | cut -d ':' -f 1 | sort | uniq -c | grep ':' ; } && echo FAILED && exit 1 || exit 0")))))

0 comments on commit f823f48

Please sign in to comment.