-
Notifications
You must be signed in to change notification settings - Fork 9
/
regress.sh
44 lines (36 loc) · 1.49 KB
/
regress.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# upgrade pip
python -m pip install --upgrade pip
# install various python dependencies
# using a version of pytest more recent than 5 won't work because it is not compatible
# with the pytest.config global used in unittest/basic_sim/test_basic_sim.py
pip install wheel
pip install "pytest<5" pytest-cov
# temporary fix
pip install numpy
pip install cvxpy==1.1.7
# install anasymod
pip install -e .
# specify python location (needed for msdsl)
export PYTHON_MSDSL=`which python`
echo $PYTHON_MSDSL
# use a default target if not specified
if [[ -z "$ANASYMOD_TARGET" ]]; then
ANASYMOD_TARGET=sim_icarus
fi
# run simulation-based tests. optional arguments:
# --target <target_name> to specify the simulator (sim_icarus, sim_vivado, etc.)
# --classification <classification> to select which tests are run (basic, weekend, etc.)
pytest --cov-report=xml -v -r s -s \
--cov=anasymod --target=$ANASYMOD_TARGET unittests
# if we're on the FPGA server, then run some tests on the FPGA board
# note that --cov-append is used so that we added to the previously
# collected coverage data
if [[ -n "${FPGA_SERVER}" ]]; then
pytest --cov-report=xml --cov-append -v -r s -s \
--cov=anasymod --target=emulate_vivado \
unittests/basic_sim/test_basic_sim.py::TestBasicSIM::test_firmware \
unittests/basic_sim/test_basic_sim.py::TestBasicSIM::test_custom_firmware \
unittests/basic_sim/test_basic_sim.py::TestBasicSIM::test_rc
fi
# upload coverage information
curl -s https://codecov.io/bash | bash