Skip to content

Commit

Permalink
fix llvm feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jul 28, 2023
1 parent b2b9648 commit c84d83e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 24 additions & 0 deletions features/test/llvm/llvm_dev.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c84d83e

Please sign in to comment.