Skip to content

Commit

Permalink
Merge branch 'fix-saving' into editor-output
Browse files Browse the repository at this point in the history
  • Loading branch information
Negabinary committed Nov 1, 2024
2 parents 88ea076 + 0b4eb93 commit 8726b1c
Show file tree
Hide file tree
Showing 33 changed files with 1,581 additions and 192 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ setup.log

# Backup of opam lock file
hazel.opam.locked.old

# Code coverage
_coverage/
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ setup-student:

dev-helper:
dune fmt --auto-promote || true
dune build @src/fmt --auto-promote src --profile dev
dune build @ocaml-index @src/fmt --auto-promote src --profile dev

dev: setup-instructor dev-helper

Expand All @@ -35,7 +35,7 @@ fmt:
dune fmt --auto-promote

watch: setup-instructor
dune build @src/fmt --auto-promote src --profile dev --watch
dune build @ocaml-index @src/fmt --auto-promote src --profile dev --watch

watch-release: setup-instructor
dune build @src/fmt --auto-promote src --profile release --watch
Expand All @@ -60,11 +60,19 @@ repl:

test:
dune fmt --auto-promote || true
dune build @src/fmt @test/fmt --auto-promote src test --profile dev
dune build @ocaml-index @src/fmt @test/fmt --auto-promote src test --profile dev
node $(TEST_DIR)/haz3ltest.bc.js

watch-test:
dune build @fmt @runtest --auto-promote --watch
dune build @ocaml-index @fmt @runtest --auto-promote --watch

coverage:
dune build @src/fmt @test/fmt --auto-promote src test --profile dev
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report summary

generate-coverage-html:
bisect-ppx-report html

clean:
dune clean
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ You can run all of the unit tests located in `test` by running `make test`.

Unit tests are written using the [Alcotest framework](https://github.com/mirage/alcotest).

#### Coverage
Code coverage is provided by [bisect_ppx](https://github.com/aantron/bisect_ppx). To collect coverage statistics from tests run `make coverage`. After coverage statistics are generated, running `make generate-coverage-html` will generate a local webpage at `_coverage/index.html` that can be viewed to see line coverage per module.

### Continuous Integration

When you push your branch to the main `hazelgrove/hazel` repository, we
Expand Down
7 changes: 4 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
(menhir
(>= 2.0))
yojson
reason
(reason (>= 3.12.0))
ppx_yojson_conv_lib
ppx_yojson_conv
incr_dom
bisect_ppx
(omd (>= 2.0.0~alpha4))
ezjs_idb
virtual_dom
bonsai
ppx_deriving
ptmap
uuidm
(uuidm (= 0.9.8)) ; 0.9.9 has breaking deprecated changes
unionFind
ocamlformat
(junit_alcotest :with-test)
Expand Down
10 changes: 10 additions & 0 deletions dune-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(lang dune 3.16)

; List of warning codes found at https://ocaml.org/manual/5.2/comp.html#s:comp-options
(env
(dev
(flags
(:standard -warn-error +A-26-27-K-58))) ; Disable some unused warnings.
(release
(flags
(:standard -warn-error +A-58))))
8 changes: 4 additions & 4 deletions hazel.opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 79 additions & 28 deletions hazel.opam.locked

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/haz3lcore/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
(name haz3lcore)
(libraries util sexplib unionFind uuidm virtual_dom yojson core)
(js_of_ocaml)
(instrumentation
(backend bisect_ppx))
(preprocess
(pps
ppx_yojson_conv
Expand Down
1 change: 1 addition & 0 deletions src/haz3lcore/dynamics/Evaluator.re
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module EvaluatorEVMode: {
| (BoxedReady, Constructor) => (BoxedValue, c)
| (IndetReady, Constructor) => (Indet, c)
| (IndetBlocked, _) => (Indet, c)
| (_, Value) => (BoxedValue, c)
| (_, Indet) => (Indet, c)
};
};
Expand Down
2 changes: 2 additions & 0 deletions src/haz3lcore/dynamics/EvaluatorStep.re
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ module Decompose = {
| (undo, Result.BoxedValue, env, v) =>
switch (rl(v)) {
| Constructor => Result.BoxedValue
| Value => Result.BoxedValue
| Indet => Result.Indet
| Step(s) => Result.Step([EvalObj.mk(Mark, env, undo, s.kind)])
// TODO: Actually show these exceptions to the user!
Expand Down Expand Up @@ -366,6 +367,7 @@ module TakeStep = {
state_update();
Some(expr);
| Constructor
| Value
| Indet => None
};

Expand Down
Loading

0 comments on commit 8726b1c

Please sign in to comment.