From 57a2f41df835f0ac4f52567e020df6ca6261fd7b Mon Sep 17 00:00:00 2001 From: Saalim Quadri Date: Sun, 8 Oct 2023 19:42:04 +0530 Subject: [PATCH] tests: Make the script modular Issue: [1] [1]: https://github.com/danascape/sworkflow/issues/22 Signed-off-by: Saalim Quadri --- tests/compile_test.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/compile_test.sh b/tests/compile_test.sh index 088b51f..aee59bf 100755 --- a/tests/compile_test.sh +++ b/tests/compile_test.sh @@ -6,14 +6,25 @@ # SPDX-License-Identifier: Apache-2.0 license # -mkdir tc -export TC_DIR="$PWD/tc" -export WORK_DIR="$PWD" +clone_kernel() +{ + git clone --depth 1 -b master https://github.com/stormbreaker-project/linux-asus-x00p-3.18 X00P +} -git clone --depth 1 -b master https://github.com/stormbreaker-project/linux-asus-x00p-3.18 X00P -git clone --depth=1 https://github.com/stormbreaker-project/aarch64-linux-android-4.9 "$TC_DIR"/gcc > /dev/null 2>&1 -git clone --depth=1 https://github.com/stormbreaker-project/arm-linux-androideabi-4.9 "$TC_DIR"/gcc_32 > /dev/null 2>&1 -git clone --depth=1 -b aosp-11.0.5 https://github.com/sohamxda7/llvm-stable "$TC_DIR"/clang > /dev/null 2>&1 -export PATH="$PWD/tc/clang/bin:$PWD/tc/gcc/bin:$PWD/tc/gcc_32/bin:${PATH}" -cd X00P || exit 1 -"$WORK_DIR"/sw b X00P-3.18 +clone_toolchains() +{ + git clone --depth=1 https://github.com/stormbreaker-project/aarch64-linux-android-4.9 "$TC_DIR"/gcc > /dev/null 2>&1 + git clone --depth=1 https://github.com/stormbreaker-project/arm-linux-androideabi-4.9 "$TC_DIR"/gcc_32 > /dev/null 2>&1 + git clone --depth=1 -b aosp-11.0.5 https://github.com/sohamxda7/llvm-stable "$TC_DIR"/clang > /dev/null 2>&1 +} + +compile_kernel() +{ + export PATH="$PWD/tc/clang/bin:$PWD/tc/gcc/bin:$PWD/tc/gcc_32/bin:${PATH}" + cd X00P || exit 1 + "$WORK_DIR"/sw b X00P-3.18 +} + +clone_kernel +clone_toolchains +compile_kernel