]> git.cworth.org Git - glfps/blob - glfps-test
Add a 32-bit target to the Makefile as well
[glfps] / glfps-test
1 #!/bin/sh
2
3 FIPS_TEST_DIR=/home/cworth/src/fips/test
4
5 if [ ! -d ${FIPS_TEST_DIR} ] ; then
6    echo "Failed to find fips test suite at: ${FIPS_TEST_DIR}"
7    echo "Please download fips and update this script to point to its test directory."
8    exit 1
9 fi
10
11 tests=0
12 errors=0
13
14 test ()
15 {
16     script="$1"
17
18     tests=$((tests + 1))
19
20     if ${FIPS_TEST_DIR}/${script} | grep -q "^glfps"; then
21         printf "PASS\n"
22     else
23         printf "FAIL\n"
24         errors=$((errors + 1))
25     fi
26 }
27
28 echo "Testing glfps with programs using different window-system interfaces to"
29 echo "OpenGL, different linking mechanisms, and different symbol-lookup."
30 echo ""
31
32 export LD_PRELOAD=./libglfps.so
33
34 printf "        Window sys.     Link-mode       Lookup\n"
35 printf "        -----------     -------------   -----------------\n"
36
37 printf "Testing GLX             link to libGL   direct calls            ... "
38 test glx-link-call
39
40 printf "Testing GLX             link to libGL   glXGetProcAddress       ... "
41 test glx-link-gpa
42
43 printf "Testing GLX             link to libGL   glXGetProcAddressARB    ... "
44 test glx-link-gpaa
45
46 printf "Testing GLX             dlopen(libGL)   dlsym                   ... "
47 test glx-dlopen-dlsym
48
49 printf "Testing GLX             dlopen(libGL)   glXGetProcAddress       ... "
50 test glx-dlopen-gpa
51
52 printf "Testing GLX             dlopen(libGL)   glXGetProcAddressARB    ... "
53 test glx-dlopen-gpaa
54
55 echo ""
56
57 if [ $errors -gt 0 ]; then
58     echo "Error: $errors/$tests tests failed."
59     exit 1
60 else
61     echo "All $tests tests passed."
62     exit 0
63 fi
64