#!/bin/sh dir=$(dirname "$0") tests=0 errors=0 test () { script="$1" tests=$((tests + 1)) if ./fips -v "${dir}/${script}" | grep -q "fips: terminating"; then printf "PASS\n" else printf "FAIL\n" errors=$((errors + 1)) fi } echo "Testing fips with programs using different window-system interfaces to" echo "OpenGL, different linking mechanisms, and different symbol-lookup." echo "" 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 printf "Testing EGL/OpenGL link to libGL direct calls ... " test egl-opengl-link-call printf "Testing EGL/OpenGL link to libGL eglGetProcAddress ... " test egl-opengl-link-gpa printf "Testing EGL/OpenGL dlopen(libGL) dlsym ... " test egl-opengl-dlopen-dlsym printf "Testing EGL/OpenGL dlopen(libGL) eglGetProcAddress ... " test egl-opengl-dlopen-gpa printf "Testing EGL/GLESv2 link libGLESv2 direct calls ... " test egl-glesv2-link-call printf "Testing EGL/GLESv2 link libGLESv2 eglGetProcAddress ... " test egl-glesv2-link-gpa printf "Testing EGL/GLESv2 dlopen(GLESv2) dlsym ... " test egl-glesv2-dlopen-dlsym printf "Testing EGL/GLESv2 dlopen(GLESv2) eglGetProcAddress ... " test egl-glesv2-dlopen-gpa echo "" if [ $errors -gt 0 ]; then echo "Error: $errors/$tests tests failed." exit 1 else echo "All $tests tests passed." exit 0 fi