
On Wed, Jan 13, 2021 at 09:19:46PM +0800, Li Ping wrote:
Signed-off-by: Li Ping <1477412247@qq.com> --- distro/depends/api-avx2neon | 4 ++++ tests/api-avx2neon | 33 ++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 distro/depends/api-avx2neon
diff --git a/distro/depends/api-avx2neon b/distro/depends/api-avx2neon new file mode 100644 index 000000000..d82d2f65e --- /dev/null +++ b/distro/depends/api-avx2neon @@ -0,0 +1,4 @@ +git +make +gcc +g++ diff --git a/tests/api-avx2neon b/tests/api-avx2neon index 9a64f89bf..47421021c 100755 --- a/tests/api-avx2neon +++ b/tests/api-avx2neon @@ -1,18 +1,29 @@ #!/bin/bash
+SCRIPT_DIR=$(dirname $(realpath $0)) +cd "$SCRIPT_DIR" +: "${git_url:=https://github.com/Siguyi/AvxToNeon}"
-script=$(dirname $(realpath $0)) -cd $script +build() { + git clone "$git_url"
Better to add "|| exit" here too.
+ cd AvxToNeon/tests || exit
-yum install -y git -yum install -y make + if [ "${arch}" == "aarch64" ]; then + make >/dev/null 2>&1
Why quiet all output and stderr?
+ elif [ "${arch}" == "x86_64" ]; then + make ARCH=x86 >/dev/null 2>&1 + fi +}
Thanks, Fengguang
-git clone https://github.com/Siguyi/AvxToNeon +run() { + build + echo "api-avx2neon running" + ./test
What if ./test exit 1?
+ echo "api-avx2neon finished"
-cd AvxToNeon -cd tests -make + output=$(find / -name "output")
output= => output_file= What if find returns nothing?
+ fail=$(grep 'AVX2NEONTest Complete' $output |awk '{print $8}')
Please give example line that you want to grep/awk.
+ [ 0 -eq "$fail" ] || exit 1
That logic reads awkward. fail => complete?
+}
-echo "api-avx2neon running" -./test -echo "api-avx2neon finished" +run -- 2.23.0