test_all_case.sh 472 字节
Newer Older
W
wuzewu 已提交
1 2 3
#!/bin/bash
set -o errexit

4 5 6 7 8 9 10 11 12 13 14
function usage() {
    echo "usage: sh $0 {test_case_list_file}"
}

if [ $# -lt 1 ]
then
    usage
    exit 1
fi

listfile=$1
W
wuzewu 已提交
15 16 17
base_path=$(cd `dirname $0`/..; pwd)
test_case_path=${base_path}/tests
export PYTHONPATH=$base_path:$PYTHONPATH
18 19

# install the require package
W
wuzewu 已提交
20 21 22
cd ${base_path}
pip install -r requirements.txt

23
# run all case list in the {listfile}
W
wuzewu 已提交
24
cd -
25
for test_file in `cat $listfile`
W
wuzewu 已提交
26
do
W
wuzewu 已提交
27
	python ${test_case_path}/${test_file}.py
W
wuzewu 已提交
28
done