tests.sh 639 字节
Newer Older
S
update  
superjom 已提交
1 2 3
#!/bin/bash
set -ex

S
init  
superjom 已提交
4
mode=$1
S
superjom 已提交
5 6 7 8 9
readonly cur=$(pwd)
readonly core_path=$cur/build/visualdl/logic
readonly python_path=$cur/visualdl/python

export PYTHONPATH="${core_path}:${python_path}"
S
init  
superjom 已提交
10 11

backend_test() {
S
superjom 已提交
12
    cd $cur
S
init  
superjom 已提交
13 14 15 16 17 18 19 20 21
    sudo pip install numpy
    mkdir -p build
    cd build
    cmake ..
    make
    make test
}

frontend_test() {
S
superjom 已提交
22
    cd $cur
S
init  
superjom 已提交
23 24 25 26 27
    cd frontend
    npm install
    npm run build
}

S
superjom 已提交
28 29 30 31 32
server_test() {
    cd $cur/server/visualdl
    python lib_test.py
}

S
init  
superjom 已提交
33 34 35 36
echo "mode" $mode

if [ $mode = "backend" ]; then
    backend_test
S
superjom 已提交
37 38 39
elif [ $mode = "all" ]; then
    frontend_test
    backend_test
S
superjom 已提交
40
    server_test
S
init  
superjom 已提交
41 42 43
else
    frontend_test
fi