Browse Source

proper cram test with coverage

main
zapashcanon 1 year ago
parent
commit
bd115a6c80
Signed by: zapashcanon GPG Key ID: 8981C3C62D1D28F1
  1. 2
      .gitignore
  2. 46
      dune-project
  3. 34
      flambda.opam
  4. 2
      src/bisect.exclude
  5. 9
      src/dune
  6. 0
      src/flambda.ml
  7. 0
      test/cram/a.flambda1
  8. 4
      test/cram/a.t
  9. 0
      test/cram/b.flambda1
  10. 5
      test/cram/b.t
  11. 0
      test/cram/c.flambda1
  12. 6
      test/cram/c.t
  13. 2
      test/cram/dune

2
.gitignore

@ -1 +1,3 @@
_build
_coverage
*.coverage

46
dune-project

@ -1,4 +1,48 @@
(lang dune 3.0)
(using menhir 2.1)
(using mdx 0.2)
(cram enable)
(name flambda)
(license ISC)
(authors
"Léo Andrès <contact@ndrs.fr>")
(maintainers "Léo Andrès <contact@ndrs.fr>")
(source
(uri git+https://git.zapashcanon.fr/zapashcanon/paper-wasocaml.git))
(homepage https://git.zapashcanon.fr/zapashcanon/paper-wasocaml)
(bug_reports https://git.zapashcanon.fr/zapashcanon/paper-wasocaml/issues)
(documentation https://doc.zapashcanon.fr/paper-wasocaml)
(generate_opam_files true)
(package
(name flambda)
(synopsis
"Mini flambda")
(description
"Mini Flambda")
(tags
(ocaml webassembly wasm interpreter flambda))
(depends
(ocaml
(>= 4.13))
sedlex
(menhir
(and
:build
(>= 20220210)))
(bisect_ppx
(and
:with-test
(>= "2.5")
:dev))
(odoc :with-doc)))

34
flambda.opam

@ -0,0 +1,34 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Mini flambda"
description: "Mini Flambda"
maintainer: ["Léo Andrès <contact@ndrs.fr>"]
authors: ["Léo Andrès <contact@ndrs.fr>"]
license: "ISC"
tags: ["ocaml" "webassembly" "wasm" "interpreter" "flambda"]
homepage: "https://git.zapashcanon.fr/zapashcanon/paper-wasocaml"
doc: "https://doc.zapashcanon.fr/paper-wasocaml"
bug-reports: "https://git.zapashcanon.fr/zapashcanon/paper-wasocaml/issues"
depends: [
"dune" {>= "3.0"}
"ocaml" {>= "4.13"}
"sedlex"
"menhir" {build & >= "20220210"}
"bisect_ppx" {with-test & >= "2.5" & dev}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://git.zapashcanon.fr/zapashcanon/paper-wasocaml.git"

2
src/bisect.exclude

@ -0,0 +1,2 @@
file "src/menhir_parser.ml"
file "src/lexer.ml"

9
src/dune

@ -29,8 +29,8 @@
(run texfot xelatex -halt-on-error -shell-escape main.tex)))
(executable
(name main)
(modules main)
(public_name flambda)
(modules flambda)
(libraries wasocaml_core))
(library
@ -39,7 +39,10 @@
(private_modules menhir_parser lexer)
(libraries menhirLib sedlex)
(preprocess
(pps sedlex.ppx)))
(pps sedlex.ppx))
(instrumentation
(backend bisect_ppx --exclusions src/bisect.exclude)
(deps bisect.exclude)))
(menhir
(modules menhir_parser))

0
src/main.ml → src/flambda.ml

0
src/a.flambda1 → test/cram/a.flambda1

4
test/cram/a.t

@ -0,0 +1,4 @@
a.flambda1:
$ dune exec -- flambda a.flambda1
42
value 42

0
src/b.flambda1 → test/cram/b.flambda1

5
test/cram/b.t

@ -0,0 +1,5 @@
b.flambda1:
$ dune exec -- flambda b.flambda1
unhandled exception dumb_exn
Fatal error: exception File "src/interpret.ml", line 239, characters 4-10: Assertion failed
[2]

0
src/c.flambda1 → test/cram/c.flambda1

6
test/cram/c.t

@ -0,0 +1,6 @@
c.flambda1:
$ dune exec -- flambda c.flambda1
42
42
42
value 42

2
test/cram/dune

@ -0,0 +1,2 @@
(cram
(deps %{bin:flambda} a.flambda1 b.flambda1 c.flambda1))
Loading…
Cancel
Save