aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@coreduo.netfort.gr.jp>2007-06-23 19:35:55 +0900
committerJunichi Uekawa <dancer@coreduo.netfort.gr.jp>2007-06-23 19:35:55 +0900
commit697aeeb73f84864c8f24c05584274fef6672ef90 (patch)
tree801c7a9496d6676a1797cb724cde0edb1e8fd2d8 /examples
parentf2f1e1d3b7e0730be83e07b70ad3fa565c123290 (diff)
downloadpbuilder-697aeeb73f84864c8f24c05584274fef6672ef90.tar
pbuilder-697aeeb73f84864c8f24c05584274fef6672ef90.tar.gz
* Documentation, examples/pbuilder-test/: add sample scripts for
pbuilder-test, and add reference to it.
Diffstat (limited to 'examples')
-rw-r--r--examples/pbuilder-test/000_prepinstall15
-rw-r--r--examples/pbuilder-test/001_apprun14
-rw-r--r--examples/pbuilder-test/002_libfile9
-rw-r--r--examples/pbuilder-test/002_sample.c17
-rw-r--r--examples/pbuilder-test/003_makecheck4
-rw-r--r--examples/pbuilder-test/004_ldd6
-rw-r--r--examples/pbuilder-test/README2
7 files changed, 67 insertions, 0 deletions
diff --git a/examples/pbuilder-test/000_prepinstall b/examples/pbuilder-test/000_prepinstall
new file mode 100644
index 0000000..493bc59
--- /dev/null
+++ b/examples/pbuilder-test/000_prepinstall
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# prepare environment for further testing.
+
+apt-get update
+apt-get -y --force-yes install binfmtc sudo
+
+
+# add users if required.
+addgroup --gid 1555 user1
+addgroup --gid 1556 test1
+addgroup --gid 1557 test2
+adduser --uid 1555 --gid 1555 user1 --disabled-login --gecos ''
+adduser user1 test1
+adduser user1 test2
diff --git a/examples/pbuilder-test/001_apprun b/examples/pbuilder-test/001_apprun
new file mode 100644
index 0000000..470fa7b
--- /dev/null
+++ b/examples/pbuilder-test/001_apprun
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# run the program without parameters, or run it with --help parameter,
+# and check that it returns the expected return-code. Suitable test
+# for non-interactive non-GUI operation.
+
+set +e
+program
+case $? in
+ 1) exit 0;;
+ *) exit 1;;
+esac
+
+
diff --git a/examples/pbuilder-test/002_libfile b/examples/pbuilder-test/002_libfile
new file mode 100644
index 0000000..3973724
--- /dev/null
+++ b/examples/pbuilder-test/002_libfile
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# make sure test file compiles and links against the library, and
+# runs. the source file ends with '.c' which is excluded by
+# run-parts, because it contains '.'
+
+gcc debian/pbuilder-test/002_sample.c -o /tmp/002_sample.out $(libecasoundc-config --libs --cflags
+)
+/tmp/002_sample.out
diff --git a/examples/pbuilder-test/002_sample.c b/examples/pbuilder-test/002_sample.c
new file mode 100644
index 0000000..632dbb7
--- /dev/null
+++ b/examples/pbuilder-test/002_sample.c
@@ -0,0 +1,17 @@
+/*
+ This is a file used by 002_libfile example.
+
+ test code to test that libecasoundc can be compiled
+ */
+#include <stdio.h>
+#include <ecasoundc.h>
+
+int main()
+{
+ printf("hello world\n");
+ eci_init();
+ eci_command("engine-status");
+ printf("%s\n", eci_last_string());
+ eci_cleanup();
+ return 0;
+}
diff --git a/examples/pbuilder-test/003_makecheck b/examples/pbuilder-test/003_makecheck
new file mode 100644
index 0000000..1c80f73
--- /dev/null
+++ b/examples/pbuilder-test/003_makecheck
@@ -0,0 +1,4 @@
+#!/bin/bash
+# run upstream-provided make check.
+
+make check
diff --git a/examples/pbuilder-test/004_ldd b/examples/pbuilder-test/004_ldd
new file mode 100644
index 0000000..d0ed179
--- /dev/null
+++ b/examples/pbuilder-test/004_ldd
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# simple test to see that the program is installed in the correct
+# place and looks sane through ldd.
+
+ldd /usr/bin/program
diff --git a/examples/pbuilder-test/README b/examples/pbuilder-test/README
new file mode 100644
index 0000000..b786cdc
--- /dev/null
+++ b/examples/pbuilder-test/README
@@ -0,0 +1,2 @@
+This directory contains skeleton files for debian/pbuilder-test, which
+is used when examples/B92test-pkg hook is installed.