diff --git a/tests/scripts/ci.py b/tests/scripts/ci.py index b3f9cb6500e5..599bbaddceec 100755 --- a/tests/scripts/ci.py +++ b/tests/scripts/ci.py @@ -342,6 +342,7 @@ def generate_command( options: Dict[str, Option], help: str, precheck: Optional[Callable[[], None]] = None, + post_build: Optional[List[str]] = None, ): """ Helper to generate CLIs that: @@ -378,6 +379,9 @@ def fn( f"./tests/scripts/task_build.py --build-dir {get_build_dir(name)}", ] + if post_build is not None: + scripts += post_build + # Check that a test suite was not used alongside specific test names if any(v for v in kwargs.values()) and tests is not None: option_flags = ", ".join([f"--{k}" for k in options.keys()]) @@ -624,12 +628,12 @@ def add_subparser( generate_command( name="hexagon", help="Run Hexagon build and test(s)", + post_build=["./tests/scripts/task_build_hexagon_api.sh --output build-hexagon"], options={ "cpp": CPP_UNITTEST, "test": ( "run Hexagon API/Python tests", [ - "./tests/scripts/task_build_hexagon_api.sh", "./tests/scripts/task_python_hexagon.sh", ], ), diff --git a/tests/scripts/task_build_hexagon_api.sh b/tests/scripts/task_build_hexagon_api.sh index 4c7b4f396ced..5f811e4e2749 100755 --- a/tests/scripts/task_build_hexagon_api.sh +++ b/tests/scripts/task_build_hexagon_api.sh @@ -19,6 +19,15 @@ set -e set -u +output_directory_parent=$(realpath ${PWD}/build) +if [ $# -ge 1 ] && [[ "$1" == "--output" ]]; then + shift 1 + output_directory_parent=$(realpath $1) + shift 1 +fi +output_directory="${output_directory_parent}/hexagon_api_output" +rm -rf ${output_directory} + use_cache=false if [ $# -ge 1 ] && [[ "$1" == "--use-cache" ]]; then use_cache=true @@ -26,24 +35,19 @@ if [ $# -ge 1 ] && [[ "$1" == "--use-cache" ]]; then fi cd apps/hexagon_api - if [ "$use_cache" = false ]; then rm -rf build fi - mkdir -p build cd build -output_binary_directory=$(realpath ${PWD}/../../../build/hexagon_api_output) -rm -rf ${output_binary_directory} - cmake -DANDROID_ABI=arm64-v8a \ -DANDROID_PLATFORM=android-28 \ -DUSE_ANDROID_TOOLCHAIN="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \ -DUSE_HEXAGON_ARCH=v68 \ -DUSE_HEXAGON_SDK="${HEXAGON_SDK_ROOT}" \ -DUSE_HEXAGON_TOOLCHAIN="${HEXAGON_TOOLCHAIN}" \ - -DUSE_OUTPUT_BINARY_DIR="${output_binary_directory}" \ + -DUSE_OUTPUT_BINARY_DIR="${output_directory}" \ -DUSE_HEXAGON_GTEST="${HEXAGON_SDK_ROOT}/utils/googletest/gtest" .. make -j$(nproc)