From ad5bf2c879a8685fb88def2385a7e5e47a0ad0d8 Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Fri, 18 Feb 2022 11:17:16 +0300 Subject: [PATCH] ci: add DejaGNU tests run --- .gitlab-ci.yml | 78 +++++++++++++++++++++++++++++++++++++ .gitlab/ci/dejagnu-test.yml | 59 ++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 .gitlab/ci/dejagnu-test.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c0b0c66c..6c7cea936 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - private_deploy - pre_test - test + - dejagnu-test image: ${CI_DOCKER_REGISTRY}/esp32-ci-env @@ -16,6 +17,8 @@ variables: UNARCHIVE_TOOL: "tar -xf" ARCHIVE_EXT: "tar.xz" + DEJAGNU_IMAGE_TAG: 20210826-3 + .use_ci_tools: &use_ci_tools | curl -sSL ${CIT_LOADER_URL} -o cit_loader.sh && sh cit_loader.sh source citools/import_functions @@ -675,3 +678,78 @@ upload_to_http: - echo "" - cat err.log - popd + +include: '.gitlab/ci/dejagnu-test.yml' + +# esp32 tests + +test_ld_esp32_lin_amd64: + extends: .dejagnu-test-ld-template + needs: [ esp32_lin_amd64, prep_tests ] + +test_gas_esp32_lin_amd64: + extends: .dejagnu-test-gas-template + needs: [ esp32_lin_amd64, prep_tests ] + +test_gcc_esp32_lin_amd64: + extends: .dejagnu-test-gcc-template + needs: [ esp32_lin_amd64, prep_tests ] + +test_gxx_esp32_lin_amd64: + extends: .dejagnu-test-gxx-template + needs: [ esp32_lin_amd64, prep_tests ] + +#esp32s2 tests + +test_ld_esp32s2_lin_amd64: + extends: .dejagnu-test-ld-template + needs: [ esp32s2_lin_amd64, prep_tests ] + +test_gas_esp32s2_lin_amd64: + extends: .dejagnu-test-gas-template + needs: [ esp32s2_lin_amd64, prep_tests ] + +test_gcc_esp32s2_lin_amd64: + extends: .dejagnu-test-gcc-template + needs: [ esp32s2_lin_amd64, prep_tests ] + +test_gxx_esp32s2_lin_amd64: + extends: .dejagnu-test-gxx-template + needs: [ esp32s2_lin_amd64, prep_tests ] + +#esp32s3 tests + +test_ld_esp32s3_lin_amd64: + extends: .dejagnu-test-ld-template + needs: [ esp32s3_lin_amd64, prep_tests ] + +test_gas_esp32s3_lin_amd64: + extends: .dejagnu-test-gas-template + needs: [ esp32s3_lin_amd64, prep_tests ] + +test_gcc_esp32s3_lin_amd64: + extends: .dejagnu-test-gcc-template + needs: [ esp32s3_lin_amd64, prep_tests ] + +test_gxx_esp32s3_lin_amd64: + extends: .dejagnu-test-gxx-template + needs: [ esp32s3_lin_amd64, prep_tests ] + +# riscv32 tests + +test_ld_riscv32_esp_lin_amd64: + extends: .dejagnu-test-ld-template + needs: [ riscv32_esp_lin_amd64, prep_tests ] + +test_gas_riscv32_esp_lin_amd64: + extends: .dejagnu-test-gas-template + needs: [ riscv32_esp_lin_amd64, prep_tests ] + +test_gcc_riscv32_esp_lin_amd64: + extends: .dejagnu-test-gcc-template + needs: [ riscv32_esp_lin_amd64, prep_tests ] + +test_gxx_riscv32_esp_lin_amd64: + extends: .dejagnu-test-gxx-template + needs: [ riscv32_esp_lin_amd64, prep_tests ] + diff --git a/.gitlab/ci/dejagnu-test.yml b/.gitlab/ci/dejagnu-test.yml new file mode 100644 index 000000000..ab1ed530f --- /dev/null +++ b/.gitlab/ci/dejagnu-test.yml @@ -0,0 +1,59 @@ +.set_archive_name: &set_archive_name | + FILE=$(find dist -type f -name "file_*") + ARCHIVE_NAME=$(cat "$FILE") + +.set_target_from_archive_name: &set_target_from_archive_name | + CONF_TARGET=$(echo "$ARCHIVE_NAME" | cut -d '-' -f1-3) + +.unarchive_and_set_path: &unarchive_and_set_path | + ${UNARCHIVE_TOOL} "dist/${ARCHIVE_NAME}" + export PATH="${CI_PROJECT_DIR}/${CONF_TARGET}/bin:${PATH}" + +.clone_testuite_repo: &clone_testuite_repo | + # make bash happy (unbound variable error) + CT_TOP_DIR="" && CT_TARGET="" + # load crosstool variables to get repo url and branch name + set -a + . "${CI_PROJECT_DIR}/samples/${CONF_TARGET}/crosstool.config" + set +a + git clone --depth 1 --branch "${!REPO_BRANCH}" "${!REPO_URL}" + +.dejagnu-test-template: + stage: dejagnu-test + image: $CI_DOCKER_REGISTRY/esp32-dejagnu:$DEJAGNU_IMAGE_TAG + tags: [ "build", "amd64" ] + script: + - *set_archive_name + - *set_target_from_archive_name + - *unarchive_and_set_path + - *clone_testuite_repo + - esp-compiler-tests/dejagnu/run.sh "$CONF_TARGET" "$TEST_TOOL" + +.dejagnu-test-ld-template: + extends: .dejagnu-test-template + variables: + REPO_URL: "CT_BINUTILS_DEVEL_URL" + REPO_BRANCH: "CT_BINUTILS_DEVEL_BRANCH" + TEST_TOOL: "ld" + +.dejagnu-test-gas-template: + extends: .dejagnu-test-template + variables: + REPO_URL: "CT_BINUTILS_DEVEL_URL" + REPO_BRANCH: "CT_BINUTILS_DEVEL_BRANCH" + TEST_TOOL: "gas" + +.dejagnu-test-gcc-template: + extends: .dejagnu-test-template + variables: + REPO_URL: "CT_GCC_DEVEL_URL" + REPO_BRANCH: "CT_GCC_DEVEL_BRANCH" + TEST_TOOL: "gcc" + +.dejagnu-test-gxx-template: + extends: .dejagnu-test-template + variables: + REPO_URL: "CT_GCC_DEVEL_URL" + REPO_BRANCH: "CT_GCC_DEVEL_BRANCH" + TEST_TOOL: "g++" +