Skip to content

Commit

Permalink
test: DRY run arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jidicula committed Nov 7, 2021
1 parent 299be18 commit 051a3fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/docker-run-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

FALLBACK_STYLE="llvm"
EXCLUDE_REGEX="capital"

# build the docker container
docker build . --file Dockerfile --tag clang-format-action-test --no-cache
docker_status="$?"
Expand All @@ -9,15 +12,15 @@ if [[ "$docker_status" != "0" ]]; then
fi

# should succeed
docker run -e CLANG_FORMAT_VERSION=13 -e GITHUB_WORKSPACE=/test -v "$(pwd)"/test:/test --privileged clang-format-action-test known_pass llvm capi
docker run -e CLANG_FORMAT_VERSION=13 -e GITHUB_WORKSPACE=/test -v "$(pwd)"/test:/test --privileged clang-format-action-test known_pass $FALLBACK_STYLE $EXCLUDE_REGEX
docker_status="$?"
if [[ "$docker_status" != "0" ]]; then
echo "files that should succeed have failed!"
exit 1
fi

# should fail
docker run -e CLANG_FORMAT_VERSION=13 -e GITHUB_WORKSPACE=/test -v "$(pwd)"/test:/test --privileged clang-format-action-test known_fail llvm capi
docker run -e CLANG_FORMAT_VERSION=13 -e GITHUB_WORKSPACE=/test -v "$(pwd)"/test:/test --privileged clang-format-action-test known_fail $FALLBACK_STYLE $EXCLUDE_REGEX
docker_status="$?"
if [[ "$docker_status" == "0" ]]; then
echo "files that should fail have succeeded!"
Expand Down

0 comments on commit 051a3fd

Please sign in to comment.