source: tests/scripts/testjbigi.sh @ e3a3a99

Last change on this file since e3a3a99 was e3a3a99, checked in by zzz <zzz@…>, 9 years ago

add cpuid

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#
2# Runs a test using each libjbigi-linux-*.so file
3# Returns nonzero on failure, but it will always
4# pass because NBI doesnt return an error code (yet).
5# But when it does, it will fail all the time since
6# your hardware probably can't run all versions.
7#
8# zzz 2011-05
9# public domain
10#
11
12cd `dirname $0`/../../installer/lib/jbigi
13
14TMP=/tmp/testjbigi$$
15mkdir $TMP
16
17echo "Testing 32 bit libcpuid ..."
18ln -s $PWD/libjcpuid-x86-linux.so $TMP/libjcpuid.so
19java -cp ../../../build/i2p.jar -Djava.library.path=$TMP freenet.support.CPUInformation.CPUID
20rm -f $TMP/libjcpuid.so
21echo
22
23echo "Testing 64 bit libcpuid ..."
24ln -s $PWD/libjcpuid-x86_64-linux.so $TMP/libjcpuid.so
25java -cp ../../../build/i2p.jar -Djava.library.path=$TMP freenet.support.CPUInformation.CPUID
26rm -f $TMP/libjcpuid.so
27echo
28
29
30
31
32for i in libjbigi-linux-*.so
33do
34        echo "Testing $i ..."
35        ln -s $PWD/$i $TMP/libjbigi.so
36        java -cp ../../../build/i2p.jar -Djava.library.path=$TMP net.i2p.util.NativeBigInteger | \
37             egrep 'java|native|However'
38        if [ $? -ne 0 ]
39        then
40                echo "********* FAILED CHECK FOR $i *************"
41                FAIL=1
42        fi
43        rm -f $TMP/libjbigi.so
44        echo
45done
46
47if [ "$FAIL" != "" ]
48then
49        echo "******** At least one file failed check *********"
50else
51        echo "All files passed"
52fi
53rm -rf $TMP
54exit $FAIL
Note: See TracBrowser for help on using the repository browser.