Skip to content

Commit

Permalink
switch to dune
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon authored and gildor478 committed Sep 11, 2019
1 parent bca57e4 commit 739284f
Show file tree
Hide file tree
Showing 47 changed files with 165 additions and 424 deletions.
14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/_build/
/setup.data
/setup.log
/dist/
/test.byte
/log-html/
/junit.xml
/testFakeHTML.byte
/testFakeRunner.byte
/testFakeShared.byte
/api-ounit.docdir
_build/
*.merlin
*.install
6 changes: 0 additions & 6 deletions .merlin

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
- $HOME/.opam
env:
global:
- PACKAGE=ounit EXTRA_DEPS=oasis OUNIT_CI=true
- PACKAGE=ounit OUNIT_CI=true
matrix:
include:
- apt:
Expand Down
57 changes: 15 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,31 @@
# See LICENSE.txt for details. #
############################################################################

#TESTFLAGS=-only-test "OUnit:1"
#TESTFLAGS=-verbose true

default: test

# OASIS_START
# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)

SETUP = ocaml setup.ml
build:
dune build @install

build: setup.data
$(SETUP) -build $(BUILDFLAGS)
doc:
dune build @doc

doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)

test: setup.data build
$(SETUP) -test $(TESTFLAGS)
test:
dune runtest

all:
$(SETUP) -all $(ALLFLAGS)

install: setup.data
$(SETUP) -install $(INSTALLFLAGS)
dune build @all
dune runtest

uninstall: setup.data
$(SETUP) -uninstall $(UNINSTALLFLAGS)
install:
dune install

reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)
uninstall:
dune uninstall

clean:
$(SETUP) -clean $(CLEANFLAGS)

distclean:
$(SETUP) -distclean $(DISTCLEANFLAGS)

setup.data:
$(SETUP) -configure $(CONFIGUREFLAGS)

configure:
$(SETUP) -configure $(CONFIGUREFLAGS)

.PHONY: build doc test all install uninstall reinstall clean distclean configure
dune clean

# OASIS_STOP
.PHONY: build doc test all install uninstall clean

doc-test: doc
ocamldoc -g ../ocaml-tmp/odoc-extract-code/odoc_extract_code.cmo \
Expand All @@ -84,13 +63,7 @@ doc-test: doc

PRECOMMIT_ARGS= \
--exclude log-html \
--exclude myocamlbuild.ml \
--exclude setup.ml \
--exclude README.txt \
--exclude INSTALL.txt \
--exclude Makefile \
--exclude configure \
--exclude _tags
--exclude Makefile

precommit:
-@if command -v OCamlPrecommit > /dev/null; then \
Expand Down
115 changes: 0 additions & 115 deletions _oasis

This file was deleted.

5 changes: 0 additions & 5 deletions _tags

This file was deleted.

2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
FORK_USER: ocaml
FORK_BRANCH: master
CYG_ROOT: C:\cygwin64
EXTRA_DEPS: oasis
EXTRA_DEPS: dune
OUNIT_CI: true

install:
Expand Down
27 changes: 0 additions & 27 deletions configure

This file was deleted.

3 changes: 3 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(lang dune 1.11)
(name ounit)
(explicit_js_mode)
38 changes: 0 additions & 38 deletions myocamlbuild.ml

This file was deleted.

12 changes: 4 additions & 8 deletions ounit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ dev-repo: "git+https://github.com/gildor478/ounit.git"
doc: ["http://ounit.forge.ocamlcore.org/api-ounit/index.html"]
depends: [
"ocaml" {>= "3.11.0"}
"ocamlfind" {build}
"ocamlbuild" {build}
"dune" {build & >= "1.11.0"}
"base-bytes"
"stdlib-shims"
]
build: [
["ocaml" "setup.ml" "-configure" "--prefix" prefix]
["ocaml" "setup.ml" "-configure" "--enable-tests"] {with-test}
["ocaml" "setup.ml" "-build"]
["ocaml" "setup.ml" "-doc"] {with-doc}
["ocaml" "setup.ml" "-test"] {with-test}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name] {with-test}
["dune" "build" "@doc" "-p" name] {with-doc}
]
install: ["ocaml" "setup.ml" "-install"]
synopsis:
"Unit testing framework loosely based on HUnit. It is similar to JUnit, and other XUnit testing frameworks"
39 changes: 0 additions & 39 deletions setup.ml

This file was deleted.

19 changes: 19 additions & 0 deletions src/data_gen.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
let file_to_string f =
let chan = open_in f in
let len = in_channel_length chan in
let res = Bytes.create len in
really_input chan res 0 len;
close_in chan;
Bytes.to_string res

let _ =

let css = file_to_string "oUnit.css" in
let js = file_to_string "oUnit.js" in
let chan = open_out "oUnitLoggerHTMLData.ml" in
Printf.fprintf chan
"let oUnit_css = %S;;
let oUnit_js = %S;;"
css js;

close_out chan
Loading

0 comments on commit 739284f

Please sign in to comment.