Skip to content

Commit 96fea76

Browse files
committed
Change testcases
1 parent 9191793 commit 96fea76

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

tests/integration-test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ else
2323
fi
2424
fi
2525

26-
# version=${1:-2.6.1}
27-
filename=$(cd ../src/dist; ls -t pyarmor-*.${PKGEXT}) || exit 1
26+
# From pyarmor 3.5.1, dist is moved to top level
27+
DIST="../dist"
28+
[[ -d "../dist" ]] || DIST="../src/dist"
29+
filename=$(cd ${DIST}; ls -t pyarmor-*.${PKGEXT}) || exit 1
2830
version=${filename:8:5}
2931
extchar=${PYARMOR_EXTRA_CHAR:-e}
3032
workpath=__runtest__
3133
datafile=$(pwd)/data/pyarmor-data.tar.gz
32-
pkgfile=$(pwd)/../src/dist/pyarmor-${version}.${PKGEXT}
34+
pkgfile=$(pwd)/${DIST}/pyarmor-${version}.${PKGEXT}
3335

3436
declare -i _bug_counter=0
3537

@@ -325,6 +327,8 @@ cd ${workpath}
325327
[[ ${pkgfile} == *.zip ]] && unzip ${pkgfile} > /dev/null 2>&1
326328
[[ ${pkgfile} == *.tar.bz2 ]] && tar xjf ${pkgfile}
327329
cd pyarmor-$version || csih_error "Invalid pyarmor package file"
330+
# From pyarmor 3.5.1, main scripts are moved to src
331+
[[ -d src ]] && mv src/* ./
328332
tar xzf ${datafile} || csih_error "Extract data files FAILED"
329333
cp -a ../../data/package ./ || csih_error "Copy package files FAILED"
330334

tests/system-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ cd ${workpath}
2020
[[ ${pkgfile} == *.zip ]] && unzip ${pkgfile} > /dev/null 2>&1
2121
[[ ${pkgfile} == *.tar.bz2 ]] && tar xjf ${pkgfile}
2222
cd pyarmor-$version || csih_error "Invalid pyarmor package file"
23+
# From pyarmor 3.5.1, main scripts are moved to src
24+
[[ -d src ]] && mv src/* ./
2325

2426
csih_inform "Prepare for system testing"
2527
echo ""
@@ -57,7 +59,7 @@ echo "-------------------- Test Command obfuscate --------------------"
5759
echo ""
5860

5961
csih_inform "Case 1.1: obfuscate script"
60-
$PYARMOR obfuscate --src examples --entry queens.py --output dist \
62+
$PYARMOR obfuscate --src examples/simple --entry queens.py --output dist \
6163
"*.py" >result.log 2>&1
6264

6365
check_file_exists dist/queens.py

tests/test-header.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ else
2929
fi
3030
fi
3131

32-
# version=${1:-2.6.1}
33-
filename=$(cd ../src/dist; ls -t pyarmor-*.${PKGEXT}) || exit 1
32+
# From pyarmor 3.5.1, dist is moved to top level
33+
DIST="../dist"
34+
[[ -d "../dist" ]] || DIST="../src/dist"
35+
filename=$(cd ${DIST}; ls -t pyarmor-*.${PKGEXT}) || exit 1
3436
version=${filename:8:5}
3537
workpath=__runtest2__
36-
pkgfile=$(pwd)/../src/dist/pyarmor-${version}.${PKGEXT}
38+
pkgfile=$(pwd)/${DIST}/pyarmor-${version}.${PKGEXT}
3739

3840
declare -i _bug_counter=0
3941

0 commit comments

Comments
 (0)