Skip to content

Commit

Permalink
ci: add DejaGNU tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapshin authored and antmak committed Apr 6, 2022
1 parent f55eb43 commit ad5bf2c
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ stages:
- private_deploy
- pre_test
- test
- dejagnu-test

image: ${CI_DOCKER_REGISTRY}/esp32-ci-env

Expand All @@ -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
Expand Down Expand Up @@ -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 ]

59 changes: 59 additions & 0 deletions .gitlab/ci/dejagnu-test.yml
Original file line number Diff line number Diff line change
@@ -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++"

0 comments on commit ad5bf2c

Please sign in to comment.