Skip to content

Commit

Permalink
mike-lischke#136 Run tests in random order
Browse files Browse the repository at this point in the history
Signed-off-by: vityaman <vityaman.dev@yandex.ru>
  • Loading branch information
vityaman committed Aug 7, 2024
1 parent f3e8999 commit d0b5ef9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ jobs:

- name: Clang-Format
working-directory: ${{github.workspace}}/ports/cpp
run: |
find source test -iname '*.hpp' -o -iname '*.cpp' \
| xargs clang-format-18 -Werror --dry-run \
--fallback-style=Google --verbose
run: sh ./ci/check-format.sh

- name: Configure
working-directory: ${{github.workspace}}/ports/cpp
Expand All @@ -59,13 +56,9 @@ jobs:

- name: Unit Test
working-directory: ${{github.workspace}}/ports/cpp/build/test
run: |
ctest
cat Testing/Temporary/LastTest.log
run: sh ./ci/test.sh

- name: Clang-Tidy on sources
if: matrix.cmake_build_type == 'Release'
working-directory: ${{github.workspace}}/ports/cpp
run: |
find source -iname '*.hpp' -o -iname '*.cpp' \
| xargs clang-tidy-18 -p build/compile_commands.json
run: sh ./ci/check-style.sh
12 changes: 12 additions & 0 deletions ports/cpp/ci/check-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -e

CLANG_FORMAT="clang-format"
if command -v clang-format-18 > /dev/null 2>&1; then
CLANG_FORMAT="clang-format-18"
fi

find source test -iname '*.hpp' -o -iname '*.cpp' \
| xargs "$CLANG_FORMAT" -Werror --dry-run \
--fallback-style=Google --verbose
11 changes: 11 additions & 0 deletions ports/cpp/ci/check-style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

CLANG_TIDY="clang-tidy"
if command -v clang-tidy-18 > /dev/null 2>&1; then
CLANG_TIDY="clang-tidy-18"
fi

find source -iname '*.hpp' -o -iname '*.cpp' \
| xargs "$CLANG_TIDY" -p build/compile_commands.json
23 changes: 23 additions & 0 deletions ports/cpp/ci/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

cd "$(dirname "$0")"/../build/test

ctest
if [ $? -ne 0 ]; then
cat Testing/Temporary/LastTest.log
exit 1
fi

set -e

TESTS="
whitebox
expr
cpp14
"

for test in $TESTS; do
for i in $(seq 5); do
(cd "./$test" && "./antlr4-c3-test-$test" --gtest_shuffle)
done
done

0 comments on commit d0b5ef9

Please sign in to comment.