micropython-ulab/test-common.sh
Zoltán Vörös dfed7a844a
implement nonzero (#540)
* implement nonzero for Boolean arrays

* remove axtls from build script

* extend nonzero to ndarrays of arbitrary dtype, and iterable, fix float tests

* temporarily disable circuitpython tests

* add nonzero documentation

* Added test script for np.nonzero()

Co-authored-by: Tejal Ashwini Barnwal <64950661+tejalbarnwal@users.noreply.github.com>
2022-08-03 20:56:45 +02:00

27 lines
746 B
Bash
Executable file

#!/bin/sh
set -e
dims="$1"
micropython="$2"
for level1 in $(printf "%dd " $(seq 1 ${dims}))
do
for level2 in numpy scipy utils complex; do
rm -f *.exp
if [ ! -d tests/"$level1"/"$level2" ]; then
break;
fi
for file in tests/"$level1"/"$level2"/*.py; do
if [ ! -f "$file"".exp" ]; then
echo "" > "$file"".exp"
fi
done
if ! env MICROPY_MICROPYTHON="$micropython" ./run-tests -d tests/"$level1"/"$level2"; then
for exp in *.exp; do
testbase=$(basename $exp .exp);
echo "\nFAILURE $testbase";
diff -u $testbase.exp $testbase.out;
done
exit 1
fi
done
done