#!/bin/sh

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/libexec/paxtest
export LD_LIBRARY_PATH

cat <<__end__ | tee /usr/libexec/paxtest/paxtest.log
PaXtest - Copyright(c) 2003 by Peter Busser <peter@adamantix.org>
Released under the GNU Public Licence version 2 or later

__end__

echo 'It may take a while for the tests to complete'

for i in anonmap execbss execdata execheap execstack mprotanon mprotbss mprotdata mprotheap mprotshbss mprotshdata mprotstack randamap randheap1 randheap2 randmain1 randmain2 randshlib randstack1 randstack2 rettofunc1 rettofunc1x rettofunc2 rettofunc2x shlibbss shlibdata writetext
do
	/usr/libexec/paxtest/$i
done >> /usr/libexec/paxtest/paxtest.log 2>&1

echo "Test results:"
cat /usr/libexec/paxtest/paxtest.log
