[libcsfml] 06/09: autopkgtest: refactor csfml_test.c out of build script

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


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

jcowgill pushed a commit to branch master
in repository libcsfml.

commit aba0c5bc94ae9415e84b85e537ca22241199cb4b
Author: James Cowgill <james410 at cowgill.org.uk>
Date:   Tue Jun 28 19:23:19 2016 +0100

    autopkgtest: refactor csfml_test.c out of build script
---
 debian/tests/build                   | 32 +-------------------------------
 debian/tests/{build => csfml_test.c} | 23 -----------------------
 2 files changed, 1 insertion(+), 54 deletions(-)

diff --git a/debian/tests/build b/debian/tests/build
index 7190d7c..4c1ba89 100644
--- a/debian/tests/build
+++ b/debian/tests/build
@@ -10,38 +10,8 @@ then
 	exit 1
 fi
 
+cp debian/tests/csfml_test.c "$ADTTMP"
 cd "$ADTTMP"
-cat <<EOF > csfml_test.c
-#include <stdio.h>
-#include <SFML/Audio.h>
-#include <SFML/Graphics.h>
-#include <SFML/Network.h>
-#include <SFML/OpenGL.h>
-#include <SFML/System.h>
-#include <SFML/Window.h>
-
-int main(void)
-{
-    // 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.
-
-    char buf[16];
-    sfIpAddress local_addr;
-
-    // Print local IP
-    local_addr = sfIpAddress_getLocalAddress();
-    sfIpAddress_toString(local_addr, buf);
-    printf("Local IP = %s\n", buf);
-
-    // Call some time functions from sfml-system
-    if (sfTime_asMilliseconds(sfSeconds(5)) != 5000)
-        return 1;
-
-    return 0;
-}
-EOF
 
 # Build program
 gcc -Wall -Werror -o csfml_test csfml_test.c -lcsfml-graphics -lcsfml-window -lcsfml-audio -lcsfml-network -lcsfml-system
diff --git a/debian/tests/build b/debian/tests/csfml_test.c
similarity index 63%
copy from debian/tests/build
copy to debian/tests/csfml_test.c
index 7190d7c..dd97e33 100644
--- a/debian/tests/build
+++ b/debian/tests/csfml_test.c
@@ -1,17 +1,3 @@
-#!/bin/sh
-# autopkgtest check: Build and run a simple program against CSFML
-
-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 > csfml_test.c
 #include <stdio.h>
 #include <SFML/Audio.h>
 #include <SFML/Graphics.h>
@@ -41,12 +27,3 @@ int main(void)
 
     return 0;
 }
-EOF
-
-# Build program
-gcc -Wall -Werror -o csfml_test csfml_test.c -lcsfml-graphics -lcsfml-window -lcsfml-audio -lcsfml-network -lcsfml-system
-echo "build: OK"
-
-# Run it
-./csfml_test
-echo "run: OK"

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



More information about the Pkg-games-commits mailing list