From c84d83e4dc647b7d7d3c66c46dbc48e6257d9702 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 28 Jul 2023 16:32:27 -0700 Subject: [PATCH] fix llvm feature tests --- features/test/llvm/{llvm_16.sh => llvm_17.sh} | 4 ++-- features/test/llvm/llvm_dev.sh | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) rename features/test/llvm/{llvm_16.sh => llvm_17.sh} (85%) create mode 100644 features/test/llvm/llvm_dev.sh diff --git a/features/test/llvm/llvm_16.sh b/features/test/llvm/llvm_17.sh similarity index 85% rename from features/test/llvm/llvm_16.sh rename to features/test/llvm/llvm_17.sh index f030cfaf..da3494da 100644 --- a/features/test/llvm/llvm_16.sh +++ b/features/test/llvm/llvm_17.sh @@ -16,9 +16,9 @@ source dev-container-features-test-lib # The 'check' command comes from the dev-container-features-test-lib. echo "LLVM_VERSION: $LLVM_VERSION"; -check "version" bash -c "echo '$LLVM_VERSION' | grep '16'"; +check "version" bash -c "echo '$LLVM_VERSION' | grep '17'"; check "clang version" bash -c "clang --version | grep 'clang version $LLVM_VERSION'"; -check "apt repo" grep "llvm-toolchain-$(lsb_release -cs)-16 main" $(find /etc/apt -type f -name '*.list'); +check "apt repo" grep "llvm-toolchain-$(lsb_release -cs)-17 main" $(find /etc/apt -type f -name '*.list'); # Report result # If any of the checks above exited with a non-zero exit code, the test will fail. diff --git a/features/test/llvm/llvm_dev.sh b/features/test/llvm/llvm_dev.sh new file mode 100644 index 00000000..b44906cf --- /dev/null +++ b/features/test/llvm/llvm_dev.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash + +# This test can be run with the following command (from the root of this repo) +# ``` +# npx --package=@devcontainers/cli -c 'devcontainer features test \ +# --features llvm \ +# --base-image ubuntu:22.04 .' +# ``` + +set -e + +# Optional: Import test library bundled with the devcontainer CLI +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. + +echo "LLVM_VERSION: $LLVM_VERSION"; +check "clang version" bash -c "clang --version | grep 'clang version $LLVM_VERSION'"; +check "apt repo" grep "llvm-toolchain-$(lsb_release -cs) main" $(find /etc/apt -type f -name '*.list'); + +# Report result +# If any of the checks above exited with a non-zero exit code, the test will fail. +reportResults