#!/bin/sh

cd $(dirname $0)/test

for test in *.sh; do
    [ -x "$test" ] || continue
    
    # Skip tests for tools with known issues or missing tools
    case "$test" in
        *tiffcrop*)
            # tiffcrop has known security issues and is disabled by default since 4.6.0
            echo "SKIP: ${test%.sh} (tiffcrop has known issues)"
            continue
            ;;
        *jbig*)
            # Skip JBIG tests if not supported
            echo "SKIP: ${test%.sh} (JBIG not supported)"
            continue
            ;;
        *thumbnail*)
            # thumbnail tool may not be built by default
            if [ ! -x ../tools/thumbnail ]; then
                echo "SKIP: ${test%.sh} (thumbnail tool not available)"
                continue
            fi
            ;;
    esac
    
    if ./"$test" >/dev/null 2>&1; then
        echo "PASS: ${test%.sh}"
    else
        echo "FAIL: ${test%.sh}"
    fi
done
