]> git.cworth.org Git - fips/blob - test/fips-test
7f9435288269134c554bf6abd90712efee6eb630
[fips] / test / fips-test
1 #!/bin/sh
2
3 dir=$(dirname "$0")
4
5 tests=0
6 errors=0
7
8 test ()
9 {
10     script="$1"
11
12     tests=$((tests + 1))
13
14     if ./fips -v "${dir}/${script}" | grep -q "fips: terminating"; then
15         printf "PASS\n"
16     else
17         printf "FAIL\n"
18         errors=$((errors + 1))
19     fi
20 }
21
22 echo "Testing fips with programs using different window-system interfaces to"
23 echo "OpenGL, different linking mechanisms, and different symbol-lookup."
24 echo ""
25
26 printf "                Win-sys Link-mode       Lookup\n"
27 printf "                ------- -------------   -----------------\n"
28
29 printf "Testing         GLX     link to libGL   direct calls            ... "
30 test glx-link-call
31
32 printf "Testing         GLX     dlopen(libGL)   dlsym                   ... "
33 test glx-dlopen-dlsym
34
35 printf "Testing         GLX     dlopen(libGL)   glXGetProcAddress       ... "
36 test glx-dlopen-gpa
37
38 printf "Testing         GLX     dlopen(libGL)   glXGetProcAddressARB    ... "
39 test glx-dlopen-gpaa
40
41 echo ""
42
43 if [ $errors -gt 0 ]; then
44     echo "Error: $errors/$tests tests failed."
45     exit 1
46 else
47     echo "All $tests tests passed."
48     exit 0
49 fi
50