#!/bin/sh
# Copyright (C) 2026 David Nichols
# SPDX-License-Identifier: MIT
set -eu
unset QORE_MODULE_DIR QORE_MODULE_DIR_ONLY QORE_INCLUDE_DIR LD_LIBRARY_PATH LD_PRELOAD LDAPCONF LDAPRC
export LC_ALL=C.UTF-8
cp -a test debian "$AUTOPKGTEST_TMP/"
cd "$AUTOPKGTEST_TMP"
module_dir=$(/usr/bin/qore --module-path | tr : '\n' | while IFS= read -r path; do
    if [ -f "$path/LdapHelper.qmod" ]; then printf '%s\n' "$path"; break; fi
done)
test -n "$module_dir"
export QORE_LDAP_TEST_MODULE_DIR="$module_dir" QORE_LDAP_TEST_QMOD_DIR="$module_dir" QORE_LDAP_TEST_BIN_DIR=/usr/bin
export QORE_MODULE_DIR="$(/usr/bin/qore --module-path)" QORE_MODULE_DIR_ONLY=1
exec debian/tests/with-server debian/tests/run-suites
