[compute] 10/14: Add autopkgtest testsuite.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Dec 18 17:56:58 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 compute.

commit 63d816a168c17bb50c64f08f61d3dc5c1063b68b
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date:   Wed Dec 2 12:42:46 2015 +0000

    Add autopkgtest testsuite.
---
 debian/control              |  1 +
 debian/tests/build-examples | 80 +++++++++++++++++++++++++++++++++++++++++++++
 debian/tests/control        |  7 ++++
 3 files changed, 88 insertions(+)

diff --git a/debian/control b/debian/control
index 07febee..a722e5e 100644
--- a/debian/control
+++ b/debian/control
@@ -2,6 +2,7 @@ Source: compute
 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 100644
index 0000000..0384a87
--- /dev/null
+++ b/debian/tests/build-examples
@@ -0,0 +1,80 @@
+#!/bin/sh
+# Copyright 2015 Ghislain Antony Vaillant
+#
+# This file is part of the autopkgtest testsuite for Boost.Compute.
+
+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/libcompute-doc/examples/* "$ADTTMP"
+cd "$ADTTMP"
+
+# Create the CMake project.
+cat <<EOF > CMakeLists.txt
+# ---------------------------------------------------------------------------
+#  Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz at gmail.com>
+#
+#  Distributed under the Boost Software License, Version 1.0
+#  See accompanying file LICENSE_1_0.txt or copy at
+#  http://www.boost.org/LICENSE_1_0.txt
+#
+# ---------------------------------------------------------------------------
+cmake_minimum_required(VERSION 2.6)
+project(dummy)
+
+find_package(BoostCompute REQUIRED)
+include_directories(\${BoostCompute_INCLUDE_DIRS})
+
+find_package(OpenCL REQUIRED)
+include_directories(\${OpenCL_INCLUDE_DIRS})
+
+set(EXAMPLES
+  amd_cpp_kernel
+  black_scholes
+  copy_data
+  fizz_buzz
+  hello_world
+  host_sort
+  inline_ptx
+  longest_vector
+  list_devices
+  mapped_view
+  memory_limits
+  monte_carlo
+  point_centroid
+  price_cross
+  print_vector
+  sort_vector
+  simple_kernel
+  time_copy
+  transform_sqrt
+  vector_addition
+  simple_moving_average
+  matrix_transpose
+)
+
+# boost library link dependencies
+find_package(Boost 1.48 REQUIRED COMPONENTS program_options)
+include_directories(SYSTEM \${Boost_INCLUDE_DIRS})
+
+foreach(EXAMPLE \${EXAMPLES})
+  add_executable(\${EXAMPLE} \${EXAMPLE}.cpp)
+  target_link_libraries(\${EXAMPLE} \${OpenCL_LIBRARIES} \${Boost_LIBRARIES})
+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..cf2aabf
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Tests: build-examples
+Depends: build-essential,
+         cmake,
+         libboost-program-options-dev,
+         libcompute-dev,
+         libcompute-doc
+Restrictions: allow-stderr

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



More information about the debian-science-commits mailing list