diff options
author | James Cowgill <james410@cowgill.org.uk> | 2016-06-28 19:28:12 +0100 |
---|---|---|
committer | James Cowgill <james410@cowgill.org.uk> | 2016-06-28 19:32:57 +0100 |
commit | 1f35e0adfae5e6e2e7b74cb372ae3e4493fed648 (patch) | |
tree | 451cc8297e546b167427085d3bdc8f9a9f20861d | |
parent | f4cad740a8ba3da71e5fc2dde949e875ec0d9421 (diff) |
autopkgtest: refactor sfml_test.cpp out of build script
-rw-r--r-- | debian/tests/build | 28 | ||||
-rw-r--r-- | debian/tests/sfml_test.cpp | 25 |
2 files changed, 26 insertions, 27 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/sfml_test.cpp b/debian/tests/sfml_test.cpp new file mode 100644 index 0000000..f4840c4 --- /dev/null +++ b/debian/tests/sfml_test.cpp @@ -0,0 +1,25 @@ +#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; +} |