66# LICENSE file in the root directory of this source tree.
77set -eux
88
9- BUILD_TOOL=$1
10- if [[ $BUILD_TOOL =~ ^(cmake| buck2)$ ]]; then
11- echo " Running unittests for ${BUILD_TOOL} ..."
12- else
13- echo " Missing build tool (require buck2 or cmake), exiting..."
14- exit 1
15- fi
9+ # shellcheck source=/dev/null
10+ source " $( dirname " ${BASH_SOURCE[0]} " ) /utils.sh"
1611
17- BUILD_MODE=$2
18- if [[ " ${BUILD_MODE:- } " =~ ^(Debug| Release)$ ]]; then
19- echo " Running tests in build mode ${BUILD_MODE} ..."
20- else
21- echo " Unsupported build mode ${BUILD_MODE} , options are Debug or Release."
22- exit 1
23- fi
12+ read -r BUILD_TOOL BUILD_MODE EDITABLE < <( parse_args " $@ " )
2413
2514# The generic Linux job chooses to use base env, not the one setup by the image
2615eval " $( conda shell.bash hook) "
@@ -34,7 +23,7 @@ if [[ "$BUILD_TOOL" == "cmake" ]]; then
3423 PYTHON_EXECUTABLE=python \
3524 EXECUTORCH_BUILD_PYBIND=ON \
3625 CMAKE_ARGS=" -DEXECUTORCH_BUILD_XNNPACK=ON -DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON" \
37- .ci/scripts/setup-linux.sh " $BUILD_TOOL " " $BUILD_MODE "
26+ .ci/scripts/setup-linux.sh " $@ "
3827
3928 # Install llama3_2_vision dependencies.
4029 PYTHON_EXECUTABLE=python ./examples/models/llama3_2_vision/install_requirements.sh
@@ -45,7 +34,7 @@ elif [[ "$BUILD_TOOL" == "buck2" ]]; then
4534 # because TMPDIR gets messed up? Please feel free to fix this and
4635 # speed up this CI job!
4736 PYTHON_EXECUTABLE=python \
48- .ci/scripts/setup-linux.sh " $BUILD_TOOL " " $BUILD_MODE "
37+ .ci/scripts/setup-linux.sh " $@ "
4938
5039 .ci/scripts/unittest-buck2.sh
5140else
0 commit comments