[libsfml] 09/11: autopkgtest: add cmake test

James Cowgill jcowgill at moszumanska.debian.org
Tue Jun 28 20:11:20 UTC 2016


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

jcowgill pushed a commit to branch master
in repository libsfml.

commit 1094f40bc2246123a385eb78ca47173b3725f2a5
Author: James Cowgill <james410 at cowgill.org.uk>
Date:   Tue Jun 28 20:40:59 2016 +0100

    autopkgtest: add cmake test
---
 debian/tests/CMakeLists.txt | 13 +++++++++++++
 debian/tests/cmake          | 23 +++++++++++++++++++++++
 debian/tests/control        |  3 +++
 3 files changed, 39 insertions(+)

diff --git a/debian/tests/CMakeLists.txt b/debian/tests/CMakeLists.txt
new file mode 100644
index 0000000..d5683fa
--- /dev/null
+++ b/debian/tests/CMakeLists.txt
@@ -0,0 +1,13 @@
+# Test CMake project to ensure FindSFML.cmake works properly
+
+cmake_minimum_required(VERSION 2.8)
+project(SFMLTest CXX)
+
+# Try to find SFML using Debian modules directory
+list(APPEND CMAKE_MODULE_PATH "/usr/share/SFML/cmake/Modules")
+find_package(SFML 2 COMPONENTS network system REQUIRED MODULE)
+
+# Build the exexutable
+include_directories(${SFML_INCLUDE_DIR})
+add_executable(sfml_test sfml_test.cpp)
+target_link_libraries(sfml_test ${SFML_LIBRARIES})
diff --git a/debian/tests/cmake b/debian/tests/cmake
new file mode 100644
index 0000000..b949b54
--- /dev/null
+++ b/debian/tests/cmake
@@ -0,0 +1,23 @@
+#!/bin/sh
+# autopkgtest check: Build and run a simple program against SFML
+
+set -e
+
+# Require $ADTTMP for temporary build files
+if [ -z "$ADTTMP" ]
+then
+	echo "Required envvar \"$ADTTMP\"is not set" >&2
+	exit 1
+fi
+
+cp debian/tests/CMakeLists.txt debian/tests/sfml_test.cpp "$ADTTMP"
+cd "$ADTTMP"
+
+# Run CMake and build program
+CFLAGS='-Wall -Werror' cmake .
+make VERBOSE=1
+echo "build: OK"
+
+# Run it
+./sfml_test
+echo "run: OK"
diff --git a/debian/tests/control b/debian/tests/control
index 4f7c886..0043c7e 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: build
 Depends: g++, libsfml-dev
+
+Tests: cmake
+Depends: cmake, g++, libsfml-dev

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/libsfml.git



More information about the Pkg-games-commits mailing list