]> git.cworth.org Git - glfps/blob - glfps-test
Add a license to the glfps.c file
[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 glaze --wrapper=libglfps.so ${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 printf "        Window sys.     Link-mode       Lookup\n"
33 printf "        -----------     -------------   -----------------\n"
34
35 printf "Testing GLX             link to libGL   direct calls            ... "
36 test glx-link-call
37
38 printf "Testing GLX             link to libGL   glXGetProcAddress       ... "
39 test glx-link-gpa
40
41 printf "Testing GLX             link to libGL   glXGetProcAddressARB    ... "
42 test glx-link-gpaa
43
44 printf "Testing GLX             dlopen(libGL)   dlsym                   ... "
45 test glx-dlopen-dlsym
46
47 printf "Testing GLX             dlopen(libGL)   glXGetProcAddress       ... "
48 test glx-dlopen-gpa
49
50 printf "Testing GLX             dlopen(libGL)   glXGetProcAddressARB    ... "
51 test glx-dlopen-gpaa
52
53 echo ""
54
55 if [ $errors -gt 0 ]; then
56     echo "Error: $errors/$tests tests failed."
57     exit 1
58 else
59     echo "All $tests tests passed."
60     exit 0
61 fi
62