Skip to content

Commit

Permalink
Add test script
Browse files Browse the repository at this point in the history
  • Loading branch information
jondy committed Jul 17, 2020
1 parent 19a80fd commit 3382d01
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/vm-test.sh
@@ -0,0 +1,32 @@
set -x
set -e

TESTPATH=__runtest4__

if [[ $(uname) == CYGWIN* ]] ; then
TESTHOME=$(cygpath -m $(pwd)/$TESTPATH/.pyarmor)
TESTSRC=$(cygpath -m $(pwd)/pyarmor/src)
else
TESTHOME=$TESTPATH/.pyarmor
TESTSRC=$(pwd)/pyarmor/src
fi
TESTSCRIPT=$TESTSRC/examples/simple/queens.py

[[ ! -d "$TESTSRC" ]] && echo "No pyarmor found" && exit

rm -rf $TESTPATH
mkdir -p $TESTPATH/.pyarmor
cd $TESTPATH

for pyver in 27 37 38 27-32 37-32 38-32 ; do
PYTHON="C:/Python${pyver}/python"
PYARMOR="$PYTHON $TESTSRC/pyarmor.py --home $TESTHOME"

DIST=dist3-${pyver}
$PYARMOR obfuscate --advanced 3 -O $DIST $TESTSCRIPT
(cd $DIST; $PYTHON $(basename $TESTSCRIPT) >result.log 2>&1)

DIST=dist4-${pyver}
$PYARMOR obfuscate --advanced 4 -O $DIST $TESTSCRIPT
(cd $DIST; $PYTHON $(basename $TESTSCRIPT) >result.log 2>&1)
done

0 comments on commit 3382d01

Please sign in to comment.