[Pkg-ocaml-maint-commits] [ppx-deriving] 06/10: add as-installed package test

Ralf Treinen treinen at moszumanska.debian.org
Tue Mar 20 20:50:38 UTC 2018


This is an automated email from the git hooks/post-receive script.

treinen pushed a commit to branch master
in repository ppx-deriving.

commit d6beab33ed216f634fc185724b19ccd2300137c2
Author: Ralf Treinen <treinen at debian.org>
Date:   Tue Mar 20 21:09:04 2018 +0100

    add as-installed package test
---
 debian/changelog           |  3 ++-
 debian/tests/control       |  2 ++
 debian/tests/show          | 19 +++++++++++++++++++
 debian/tests/show.expected |  1 +
 debian/tests/show.ml       |  9 +++++++++
 5 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 218be76..e347415 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,9 @@ ppx-deriving (4.2.1-1) unstable; urgency=medium
     libppx-tools-ocaml-dev according to upstream's opam fil. 
   * Standards-Version 4.1.3:
     - d/copyright: use https in format specifier.
+  * Add dep8-style package test
 
- -- Ralf Treinen <treinen at debian.org>  Mon, 19 Mar 2018 21:39:16 +0100
+ -- Ralf Treinen <treinen at debian.org>  Tue, 20 Mar 2018 21:07:20 +0100
 
 ppx-deriving (4.1-1.1) unstable; urgency=medium
 
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..54c6d0b
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: show
+Depends: @, ocaml-nox, libfindlib-ocaml, ocamlbuild
diff --git a/debian/tests/show b/debian/tests/show
new file mode 100755
index 0000000..80e0743
--- /dev/null
+++ b/debian/tests/show
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+
+this=show
+indir=debian/tests
+outdir=${ADT_ARTIFACTS:-/tmp}/${this}
+mkdir -p ${outdir}
+
+ppx='ppx_deriving.show'
+cp ${indir}/${this}.ml ${indir}/${this}.expected ${outdir}
+cd ${outdir}
+ocamlbuild -quiet -use-ocamlfind -pkgs ${ppx} ${this}.byte
+./${this}.byte > result
+diff result ${this}.expected
+
+if [ -x /usr/bin/ocamlopt ]
+then ocamlbuild -quiet -use-ocamlfind -pkgs ${ppx} ${this}.native;
+     ./${this}.native > result
+     diff result ${this}.expected
+fi
diff --git a/debian/tests/show.expected b/debian/tests/show.expected
new file mode 100644
index 0000000..51de5b9
--- /dev/null
+++ b/debian/tests/show.expected
@@ -0,0 +1 @@
+tree: (Show.Node [(Show.Leaf 17); (Show.Leaf 42); (Show.Leaf 73)])
diff --git a/debian/tests/show.ml b/debian/tests/show.ml
new file mode 100644
index 0000000..2031e07
--- /dev/null
+++ b/debian/tests/show.ml
@@ -0,0 +1,9 @@
+type t =
+  | Leaf of int
+  | Node of t list
+  [@@deriving show]
+
+let my_tree = (Node [(Leaf 17); (Leaf 42); (Leaf 73)]);;
+            
+Format.printf "tree: %a at ." pp my_tree
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ppx-deriving.git



More information about the Pkg-ocaml-maint-commits mailing list