Skip to content

Commit

Permalink
Add skeleton unit test suite
Browse files Browse the repository at this point in the history
No tests yet, but should make adding tests easier in future.

Signed-off-by: John Else <[email protected]>
  • Loading branch information
johnelse committed Jul 15, 2016
1 parent 5d90085 commit 67c1f89
Show file tree
Hide file tree
Showing 6 changed files with 317 additions and 13 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.PHONY: all clean install build reinstall uninstall distclean
.PHONY: all clean install build test reinstall uninstall distclean
all: build

NAME=xenops
J=4

ENABLE_TESTS=--enable-tests

clean:
@rm -f setup.data setup.log setup.bin lib/version.ml
@rm -rf _build
Expand All @@ -22,7 +24,7 @@ setup.bin: setup.ml
@rm -f setup.cmx setup.cmi setup.o setup.cmo

setup.data: setup.bin
@./setup.bin -configure $(ENABLE_XEN) $(ENABLE_XENLIGHT) $(ENABLE_LIBVIRT) $(ENABLE_XENGUESTBIN)
@./setup.bin -configure $(ENABLE_TESTS) $(ENABLE_XEN) $(ENABLE_XENLIGHT) $(ENABLE_LIBVIRT) $(ENABLE_XENGUESTBIN)

build: setup.data setup.bin version.ml
@./setup.bin -build -j $(J)
Expand All @@ -39,6 +41,9 @@ endif
ln -s ./xenops_xc_main.native xenopsd-xc || true
./xenopsd-xc --help=groff > xenopsd-xc.1

test: build
@./setup.bin -test

version.ml: VERSION
echo "let version = \"$(shell cat VERSION)\"" > lib/version.ml

Expand Down
11 changes: 11 additions & 0 deletions _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,14 @@ Executable xenopsd_xenlight_main
profiling
CSources: fsync_stubs.c, poll_stubs.c

Executable xenopsd_test
CompiledObject: best
Path: test
MainIs: xenopsd_test.ml
Install: false
BuildDepends: oUnit, xenopsd

Test xenopsd_test
Run$: flag(tests)
Command: $xenopsd_test
WorkingDirectory: .
49 changes: 48 additions & 1 deletion _tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 75c8d08bbb53d180415f0183181b9cf1)
# DO NOT EDIT (digest: 109e0ec543651aed62733bb129a75555)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand Down Expand Up @@ -496,6 +496,53 @@ true: annot, bin_annot
"xl/poll_stubs.c": use_profiling
"xl/poll_stubs.c": use_xenopsd
<xl/xenops_xl_main.{native,byte}>: custom
# Executable xenopsd_test
<test/xenopsd_test.{native,byte}>: pkg_cohttp
<test/xenopsd_test.{native,byte}>: pkg_fd-send-recv
<test/xenopsd_test.{native,byte}>: pkg_forkexec
<test/xenopsd_test.{native,byte}>: pkg_oUnit
<test/xenopsd_test.{native,byte}>: pkg_oclock
<test/xenopsd_test.{native,byte}>: pkg_rpclib
<test/xenopsd_test.{native,byte}>: pkg_rpclib.syntax
<test/xenopsd_test.{native,byte}>: pkg_sexplib
<test/xenopsd_test.{native,byte}>: pkg_sexplib.syntax
<test/xenopsd_test.{native,byte}>: pkg_threads
<test/xenopsd_test.{native,byte}>: pkg_threads.posix
<test/xenopsd_test.{native,byte}>: pkg_uri
<test/xenopsd_test.{native,byte}>: pkg_uuidm
<test/xenopsd_test.{native,byte}>: pkg_uutf
<test/xenopsd_test.{native,byte}>: pkg_xcp
<test/xenopsd_test.{native,byte}>: pkg_xcp.storage
<test/xenopsd_test.{native,byte}>: pkg_xcp.xen
<test/xenopsd_test.{native,byte}>: pkg_xenstore
<test/xenopsd_test.{native,byte}>: pkg_xenstore.unix
<test/xenopsd_test.{native,byte}>: pkg_xenstore_transport
<test/xenopsd_test.{native,byte}>: pkg_xenstore_transport.unix
<test/xenopsd_test.{native,byte}>: pkg_xmlm
<test/xenopsd_test.{native,byte}>: use_xenopsd
<test/*.ml{,i,y}>: pkg_cohttp
<test/*.ml{,i,y}>: pkg_fd-send-recv
<test/*.ml{,i,y}>: pkg_forkexec
<test/*.ml{,i,y}>: pkg_oUnit
<test/*.ml{,i,y}>: pkg_oclock
<test/*.ml{,i,y}>: pkg_rpclib
<test/*.ml{,i,y}>: pkg_rpclib.syntax
<test/*.ml{,i,y}>: pkg_sexplib
<test/*.ml{,i,y}>: pkg_sexplib.syntax
<test/*.ml{,i,y}>: pkg_threads
<test/*.ml{,i,y}>: pkg_threads.posix
<test/*.ml{,i,y}>: pkg_uri
<test/*.ml{,i,y}>: pkg_uuidm
<test/*.ml{,i,y}>: pkg_uutf
<test/*.ml{,i,y}>: pkg_xcp
<test/*.ml{,i,y}>: pkg_xcp.storage
<test/*.ml{,i,y}>: pkg_xcp.xen
<test/*.ml{,i,y}>: pkg_xenstore
<test/*.ml{,i,y}>: pkg_xenstore.unix
<test/*.ml{,i,y}>: pkg_xenstore_transport
<test/*.ml{,i,y}>: pkg_xenstore_transport.unix
<test/*.ml{,i,y}>: pkg_xmlm
<test/*.ml{,i,y}>: use_xenopsd
# OASIS_STOP
<lib/updates.ml>: syntax_camlp4o, pkg_rpc.syntax
<lib/scheduler.ml>: syntax_camlp4o, pkg_rpc.syntax
Expand Down
5 changes: 3 additions & 2 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 28a98a80b057607577ddf2e46a295148) *)
(* DO NOT EDIT (digest: 2bdc97604dd4b22615e2baab247559f1) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -1059,6 +1059,7 @@ let package_default =
("xl", ["lib"; "profiling"]);
("xc", ["lib"; "profiling"]);
("tools", ["profiling"]);
("test", ["lib"]);
("simulator", ["lib"; "profiling"]);
("libvirt", ["lib"; "profiling"]);
("lib", ["profiling"])
Expand All @@ -1070,6 +1071,6 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}

let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;

# 1074 "myocamlbuild.ml"
# 1075 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
Loading

0 comments on commit 67c1f89

Please sign in to comment.