#!/bin/sh

testsdir="/usr/libexec/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/llama.cpp-tests/"

# Some of these tests need additional arguments and/or data that we still
# need to figure out
skip_tests="\
test-autorelease
test-chat
test-chat-template
test-gbnf-validator
test-model-load-cancel
test-state-restore-fragmented
test-thread-safety
test-tokenizer-0
test-tokenizer-1-bpe
test-tokenizer-1-spm"

# Any individual failure is overall failure
exitcode=0
for testname in "$testsdir"/test*; do
    if echo "$skip_tests" | grep -qx "$(basename "$testname")"; then
        echo "Skipping $testname"
        continue
    fi
	echo "$testname" >> /tmp/list

    $testname || exitcode=1
done
exit $exitcode
