-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·87 lines (70 loc) · 1.81 KB
/
script.sh
File metadata and controls
executable file
·87 lines (70 loc) · 1.81 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -euxo pipefail
function run_clippy_test() {
pushd $1
cargo clippy --all-targets --all-features
if [ -d "./tcp_iface_$1" ]
then
# Test auto-generated TCP interface
pushd ./tcp_iface_$1
cargo clippy --all-targets --all-features
popd
fi
if [ -d "./icasadi_$1" ]
then
# Test auto-generated CasADi interface
pushd icasadi_$1
cargo clippy --all-targets --all-features
popd
fi
popd
}
regular_test() {
# Run Python tests
# ------------------------------------
# --- create virtual environment
cd open-codegen
export PYTHONPATH=.
# --- install virtualenv
pip install virtualenv
# --- create virtualenv
virtualenv -p python3.12 venv
# --- activate venv
source venv/bin/activate
# --- upgrade pip within venv
pip install --upgrade pip
# --- install opengen
pip install .
# --- rust dependencies
rustup update
rustup target add arm-unknown-linux-gnueabihf
# --- run the tests
export PYTHONPATH=.
python -W ignore test/test_constraints.py -v
python -W ignore test/test.py -v
python -W ignore test/test_raspberry_pi.py -v
# Run Clippy for generated optimizers
# ------------------------------------
cd .python_test_build
run_clippy_test "only_f1"
run_clippy_test "only_f2"
run_clippy_test "halfspace_optimizer"
run_clippy_test "parametric_f2"
run_clippy_test "plain"
run_clippy_test "python_bindings"
run_clippy_test "rosenbrock_ros"
}
test_docker() {
cd docker
docker image build -t alphaville/open .
}
main() {
if [ $DO_DOCKER -eq 0 ]; then
echo "Running regular tests"
regular_test
else
echo "Building Docker image"
test_docker
fi
}
main