[libsfml] 07/11: autopkgtest: refactor sfml_test.cpp out of build script
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 1f35e0adfae5e6e2e7b74cb372ae3e4493fed648
Author: James Cowgill <james410 at cowgill.org.uk>
Date: Tue Jun 28 19:28:12 2016 +0100
autopkgtest: refactor sfml_test.cpp out of build script
---
debian/tests/build | 28 +---------------------------
debian/tests/{build => sfml_test.cpp} | 27 ---------------------------
2 files changed, 1 insertion(+), 54 deletions(-)
diff --git a/debian/tests/build b/debian/tests/build
index 9f2f9f6..1709bd9 100644
--- a/debian/tests/build
+++ b/debian/tests/build
@@ -10,34 +10,8 @@ then
exit 1
fi
+cp debian/tests/sfml_test.cpp "$ADTTMP"
cd "$ADTTMP"
-cat <<EOF > sfml_test.cpp
-#include <iostream>
-#include <SFML/Audio.hpp>
-#include <SFML/Graphics.hpp>
-#include <SFML/Network.hpp>
-#include <SFML/OpenGL.hpp>
-#include <SFML/System.hpp>
-#include <SFML/Window.hpp>
-
-int main()
-{
- // The build test doesn't check any graphics since that would require a
- // display server. We just test some basic Network / System functionality.
- // However when building we can still include the other headers to ensure
- // they compile.
-
- // Print local IP
- std::cout << "Local IP = " << sf::IpAddress::getLocalAddress().toString()
- << std::endl;
-
- // Call some time functions from sfml-system
- if ((sf::seconds(5) + sf::milliseconds(1234)).asMilliseconds() != 6234)
- return 1;
-
- return 0;
-}
-EOF
# Build programs - once with raw libraries and once with pkg-config
g++ -Wall -Werror -o sfml_test1 sfml_test.cpp -lsfml-network -lsfml-system
diff --git a/debian/tests/build b/debian/tests/sfml_test.cpp
similarity index 55%
copy from debian/tests/build
copy to debian/tests/sfml_test.cpp
index 9f2f9f6..f4840c4 100644
--- a/debian/tests/build
+++ b/debian/tests/sfml_test.cpp
@@ -1,17 +1,3 @@
-#!/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
-
-cd "$ADTTMP"
-cat <<EOF > sfml_test.cpp
#include <iostream>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
@@ -37,16 +23,3 @@ int main()
return 0;
}
-EOF
-
-# Build programs - once with raw libraries and once with pkg-config
-g++ -Wall -Werror -o sfml_test1 sfml_test.cpp -lsfml-network -lsfml-system
-echo "build1: OK"
-g++ -Wall -Werror -o sfml_test2 sfml_test.cpp $(pkg-config --cflags --libs sfml-all)
-echo "build2: OK"
-
-# Run them
-./sfml_test1
-echo "run1: OK"
-./sfml_test2
-echo "run2: OK"
--
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