From: Carl Worth Date: Fri, 20 Sep 2013 22:38:11 +0000 (-0700) Subject: Add simple test suite runner for glfps X-Git-Url: https://git.cworth.org/git?p=glfps;a=commitdiff_plain;h=6f86ce127d3789cf4ce26c2d4132d6fa77bc62bc Add simple test suite runner for glfps This simply calls into the test suite of the fips project to take advantage of all of its test. --- diff --git a/glfps-test b/glfps-test new file mode 100755 index 0000000..f424686 --- /dev/null +++ b/glfps-test @@ -0,0 +1,64 @@ +#!/bin/sh + +FIPS_TEST_DIR=/home/cworth/src/fips/test + +if [ ! -d ${FIPS_TEST_DIR} ] ; then + echo "Failed to find fips test suite at: ${FIPS_TEST_DIR}" + echo "Please download fips and update this script to point to its test directory." + exit 1 +fi + +tests=0 +errors=0 + +test () +{ + script="$1" + + tests=$((tests + 1)) + + if ${FIPS_TEST_DIR}/${script} | grep -q "^glfps"; then + printf "PASS\n" + else + printf "FAIL\n" + errors=$((errors + 1)) + fi +} + +echo "Testing glfps with programs using different window-system interfaces to" +echo "OpenGL, different linking mechanisms, and different symbol-lookup." +echo "" + +export LD_PRELOAD=./libglfps.so + +printf " Window sys. Link-mode Lookup\n" +printf " ----------- ------------- -----------------\n" + +printf "Testing GLX link to libGL direct calls ... " +test glx-link-call + +printf "Testing GLX link to libGL glXGetProcAddress ... " +test glx-link-gpa + +printf "Testing GLX link to libGL glXGetProcAddressARB ... " +test glx-link-gpaa + +printf "Testing GLX dlopen(libGL) dlsym ... " +test glx-dlopen-dlsym + +printf "Testing GLX dlopen(libGL) glXGetProcAddress ... " +test glx-dlopen-gpa + +printf "Testing GLX dlopen(libGL) glXGetProcAddressARB ... " +test glx-dlopen-gpaa + +echo "" + +if [ $errors -gt 0 ]; then + echo "Error: $errors/$tests tests failed." + exit 1 +else + echo "All $tests tests passed." + exit 0 +fi +