[clblas] 02/02: Add autopkgtest testsuite.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Nov 25 17:23:53 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 clblas.

commit ce9e9edec9433a4d366439e38a52dde3a4d81b82
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Wed Nov 25 12:35:11 2015 +0000

    Add autopkgtest testsuite.
---
 debian/control              |  1 +
 debian/tests/build-examples | 51 +++++++++++++++++++++++++++++++++++++++++++++
 debian/tests/control        |  6 ++++++
 3 files changed, 58 insertions(+)

diff --git a/debian/control b/debian/control
index 1c95f9a..1161219 100644
--- a/debian/control
+++ b/debian/control
@@ -2,6 +2,7 @@ Source: clblas
 Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
 Uploaders: Ghislain Antony Vaillant <ghisvail at gmail.com>
 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..39ad16c
--- /dev/null
+++ b/debian/tests/build-examples
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Copyright 2015 Ghislain Antony Vaillant
+#
+# This file is part of the autopkgtest testsuite for clBLAS.
+
+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/libclblas-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)
+include_directories(\${OpenCL_INCLUDE_DIRS})
+find_package(clBLAS REQUIRED)
+include_directories(\${CLBLAS_INCLUDE_DIRS})
+link_directories(\${CLBLAS_LIBRARY_DIRS})
+
+file(GLOB EXAMPLE_FILES "*.c" ".cpp")
+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}
+    \${CLBLAS_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..396f3f9
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,6 @@
+Tests: build-examples
+Depends: build-essential,
+         cmake,
+         libclblas-dev,
+         libclblas-doc,
+         ocl-icd-opencl-dev | opencl-dev

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



More information about the debian-science-commits mailing list