Files
i2p.i2p/tests/scripts/testjbigi.sh

56 lines
1.3 KiB
Bash
Raw Normal View History

#!/bin/sh
2011-05-27 16:12:10 +00:00
#
# Runs a test using each libjbigi-linux-*.so file
# Returns nonzero on failure, but it will always
# pass because NBI doesnt return an error code (yet).
# But when it does, it will fail all the time since
# your hardware probably can't run all versions.
#
# zzz 2011-05
# public domain
#
cd `dirname $0`/../../installer/lib/jbigi
TMP=/tmp/testjbigi$$
mkdir $TMP
2011-05-27 16:18:38 +00:00
echo "Testing 32 bit libcpuid ..."
ln -s $PWD/libjcpuid-x86-linux.so $TMP/libjcpuid.so
java -cp ../../../build/i2p.jar -Djava.library.path=$TMP freenet.support.CPUInformation.CPUID
rm -f $TMP/libjcpuid.so
echo
echo "Testing 64 bit libcpuid ..."
ln -s $PWD/libjcpuid-x86_64-linux.so $TMP/libjcpuid.so
java -cp ../../../build/i2p.jar -Djava.library.path=$TMP freenet.support.CPUInformation.CPUID
rm -f $TMP/libjcpuid.so
echo
2011-05-27 16:12:10 +00:00
for i in libjbigi-linux-*.so
do
echo "Testing $i ..."
ln -s $PWD/$i $TMP/libjbigi.so
java -cp ../../../build/i2p.jar -Djava.library.path=$TMP net.i2p.util.NativeBigInteger | \
egrep 'java|native|However'
if [ $? -ne 0 ]
then
echo "********* FAILED CHECK FOR $i *************"
FAIL=1
fi
2011-05-27 16:18:38 +00:00
rm -f $TMP/libjbigi.so
2011-05-27 16:12:10 +00:00
echo
done
if [ "$FAIL" != "" ]
then
echo "******** At least one file failed check *********"
else
echo "All files passed"
fi
rm -rf $TMP
exit $FAIL