[shark] 18/24: Add autopkgtest testsuite.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Dec 10 19:50:05 UTC 2015


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

ghisvail-guest pushed a commit to branch debian/sid
in repository shark.

commit 4881f94439c1a4df43eeb7b7f2df88fee2d1f5d0
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Tue Nov 24 14:54:06 2015 +0000

    Add autopkgtest testsuite.
---
 debian/tests/build-examples | 43 +++++++++++++++++++++++++++++++++++++++++++
 debian/tests/control        |  5 +++++
 2 files changed, 48 insertions(+)

diff --git a/debian/tests/build-examples b/debian/tests/build-examples
new file mode 100755
index 0000000..f054afd
--- /dev/null
+++ b/debian/tests/build-examples
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright 2015 Ghislain Antony Vaillant
+#
+# This file is part of the autopkgtest testsuite for Shark.
+
+set -e
+
+# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
+# can avoid duplicating the effort (signal handling, etc.) here.
+if [ -z "$ADTTMP" ]
+then
+	echo "Required envvar \"$ADTTMP\"is not set" >&2
+	exit 1
+fi
+
+# Copy example source code.
+cp -a /usr/share/doc/libshark-doc/examples/* "$ADTTMP"
+cd "$ADTTMP"
+
+# Create the CMake project.
+cat <<EOF > CMakeLists.txt
+cmake_minimum_required(VERSION 2.6.2)
+project(dummy)
+
+find_package(Shark REQUIRED)
+include(\${SHARK_USE_FILE})
+
+file(GLOB_RECURSE EXAMPLE_FILES \${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
+foreach(FILE \${EXAMPLE_FILES})
+        get_filename_component(TARGET_NAME \${FILE} NAME_WE)
+        add_executable(\${TARGET_NAME} \${FILE})
+        target_link_libraries(\${TARGET_NAME} \${SHARK_LIBRARIES})
+endforeach()
+
+EOF
+
+# Configure and build.
+mkdir build
+cd build
+cmake ./..
+echo "configure: OK"
+make -j$(nproc)
+echo "build: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..e7aae5e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: build-examples
+Depends: build-essential,
+         cmake,
+         libshark-dev,
+         libshark-doc

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/shark.git



More information about the debian-science-commits mailing list