This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree 3 files changed +32
-2
lines changed
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 78
78
source config.sh
79
79
setup_test_venv
80
80
pip install numpy/dist/numpy-*.whl
81
- python run_tests.py -mfull
81
+ run_tests
82
82
teardown_test_venv
83
83
displayName: Install wheel and test
84
84
condition: eq(variables['SKIP_BUILD'], 'false')
Original file line number Diff line number Diff line change 1
1
# Define custom utilities
2
2
# Test for OSX with [ -n "$IS_OSX" ]
3
3
# See env_vars.sh for extra environment variables
4
+ if [ $( uname) == " Linux" ]; then IS_LINUX=1; fi
4
5
source gfortran-install/gfortran_utils.sh
5
6
6
7
function build_wheel {
@@ -36,7 +37,7 @@ function get_test_cmd {
36
37
37
38
function run_tests {
38
39
# Runs tests on installed distribution from an empty directory
39
- if [ -z " $IS_OSX " ]; then
40
+ if [ -n " $IS_LINUX " ]; then
40
41
apt-get -y update && apt-get install -y gfortran
41
42
fi
42
43
python -c " $( get_test_cmd) "
Original file line number Diff line number Diff line change
1
+ function setup_test_venv {
2
+ # Create a new empty venv dedicated to testing for non-Linux platforms. On
3
+ # Linux the tests are run in a Docker container.
4
+ if [ $( uname) != " Linux" ]; then
5
+ deactivate || echo " "
6
+ $PYTHON_EXE -m venv test_venv
7
+ if [ $( uname) == " Darwin" ]; then
8
+ source test_venv/bin/activate
9
+ else
10
+ source test_venv/Scripts/activate
11
+ fi
12
+ # Note: the idiom "python -m pip install ..." is necessary to upgrade
13
+ # pip itself on Windows. Otherwise one would get a permission error on
14
+ # pip.exe.
15
+ python -m pip install --upgrade pip wheel
16
+ if [ " $TEST_DEPENDS " != " " ]; then
17
+ pip install $TEST_DEPENDS
18
+ fi
19
+ fi
20
+ }
21
+
22
+ function teardown_test_venv {
23
+ if [ $( uname) != " Linux" ]; then
24
+ deactivate || echo " "
25
+ if [ $( uname) == " Darwin" ]; then
26
+ source venv/bin/activate
27
+ fi
28
+ fi
29
+ }
You can’t perform that action at this time.
0 commit comments