#!/bin/bash

# create temporary symlink to workaround missing oldfind
ln -s /usr/bin/find /tmp/oldfind
# make oldfind visible
export PATH="/tmp:${PATH}"

# Add findutils ptest directory to PATH for getlimits
export PATH="/usr/lib/findutils/ptest:${PATH}"

export built_programs="find xargs locate updatedb"

# this gets substituted by sed during build
export VERSION="__run_ptest_version__"

# Force ASCII quotes so exp vs err comparisons are stable across locales.
export LC_ALL=C

for f in tests/*/*.sh; do
	bash $f ;
	case $? in
		0 )
			echo -n "PASS";;
		77 )
			echo -n "SKIP";;
		* )
			echo -n "FAIL";;
	esac
	echo ": $f"
done

#remove symlink
rm -f /tmp/oldfind

echo
