[clfft] 03/06: Add autopkgtest testsuite.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Dec 1 15:42:10 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 clfft.
commit e30a8533d22c7c2a315056a7878a79c8eac3d0d3
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Wed Nov 25 12:26:48 2015 +0000
Add autopkgtest testsuite.
---
debian/control | 1 +
debian/tests/build-examples | 50 +++++++++++++++++++++++++++++++++++++++++++++
debian/tests/control | 7 +++++++
3 files changed, 58 insertions(+)
diff --git a/debian/control b/debian/control
index d71eaf2..c71243e 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.
Uploaders: Ghislain Antony Vaillant <ghisvail at gmail.com>,
Jerome Kieffer <jerome.kieffer at esrf.fr>
Section: science
+Testsuite: autopkgtest
Priority: optional
Build-Depends: cmake,
debhelper (>= 9),
diff --git a/debian/tests/build-examples b/debian/tests/build-examples
new file mode 100755
index 0000000..335c91c
--- /dev/null
+++ b/debian/tests/build-examples
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Copyright 2015 Ghislain Antony Vaillant
+#
+# This file is part of the autopkgtest testsuite for clFFT.
+
+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/libclfft-doc/examples/* "$ADTTMP"
+cd "$ADTTMP"
+
+# Create the CMake project.
+cat <<EOF > CMakeLists.txt
+cmake_minimum_required(VERSION 2.6)
+project(dummy)
+
+find_package(OpenCL REQUIRED)
+find_package(clFFT REQUIRED)
+include_directories(\${CLFFT_INCLUDE_DIRS})
+link_directories(\${CLFFT_LIBRARY_DIRS})
+
+file(GLOB EXAMPLE_FILES "*.c")
+set_source_files_properties(\${EXAMPLE_FILES} PROPERTIES LANGUAGE CXX)
+foreach(FILE \${EXAMPLE_FILES})
+ get_filename_component(EXAMPLE \${FILE} NAME_WE)
+ set(EXAMPLE_NAME example_\${EXAMPLE})
+ add_executable(\${EXAMPLE_NAME} \${FILE})
+ target_link_libraries(\${EXAMPLE_NAME}
+ \${CLFFT_LIBRARIES}
+ \${OpenCL_LIBRARIES}
+ \${CMAKE_DL_LIBS}
+ )
+endforeach()
+
+EOF
+
+# Configure and build.
+mkdir build && cd build
+cmake ./..
+echo "configure: OK"
+make
+echo "build: OK"
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..99ef511
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Tests: build-examples
+Depends: build-essential,
+ cmake,
+ libclfft-dev,
+ libclfft-doc,
+ ocl-icd-opencl-dev | opencl-dev
+Restrictions: allow-stderr
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/clfft.git
More information about the debian-science-commits
mailing list