Skip to content

Commit

Permalink
Update clang-format version to 17 and update compiler versions in Tra…
Browse files Browse the repository at this point in the history
…vis CI configuration file.

Add a new function `debug_print_cells` to print time values of each vertex in the cell and the resulting cell info.

Modify the script `clang-tidy.sh` to create a blank `.clang-tidy` file in the build directory to ignore Qt files causing warnings.
  • Loading branch information
acgetchell committed Nov 7, 2023
1 parent dca7340 commit 8443a78
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '16'
clang-format-version: '17'
check-path: ${{ matrix.path }}
fallback-style: 'Google' # optional
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ addons:
- libtool-bin
- texinfo
- yasm
- gcc-12
- g++-12
- clang-15
- gcc-13
- g++-13
- clang-16
- ninja-build
- cppcheck
- doxygen
Expand All @@ -33,22 +33,22 @@ os:
- linux

compiler:
- g++-12
- clang-15
- g++-13
- clang-16

jobs:
fast_finish: true
include:
# CppCheck
- os: linux
compiler: g++-12
compiler: g++-13
env: CPPCHECK=true
before_script:
- export CMAKE_ARGS="-D ENABLE_CPPCHECK:BOOL=TRUE"
after_success: skip
# Valgrind
- os: linux
compiler: g++-12
compiler: g++-13
env: VALGRIND=true
before_script:
- export CMAKE_ARGS="-D ENABLE_IPO:BOOL=FALSE -D ENABLE_VALGRIND:BOOL=TRUE"
Expand All @@ -61,7 +61,7 @@ jobs:
- travis_wait 30 valgrind --leak-check=full --show-leak-kinds=all --verbose ./cdt --s -n64 -t3 -a0.6 -k1.1 -l0.1 -p10
# AddressSanitizer and UndefinedBehaviorSanitizer
- os: linux
compiler: clang-15
compiler: clang-16
env: ASAN=true
before_script:
- export CMAKE_ARGS="-D ENABLE_SANITIZER_ADDRESS:BOOL=TRUE -D ENABLE_SANITIZER_UNDEFINED_BEHAVIOR:BOOL=TRUE"
Expand All @@ -72,7 +72,7 @@ jobs:
- ./initialize --s -n32000 -t11 -o
# LeakSanitizer
- os: linux
compiler: clang-15
compiler: clang-16
env: LSAN=true
before_script:
- export CMAKE_ARGS="-D ENABLE_SANITIZER_LEAK:BOOL=TRUE"
Expand All @@ -83,7 +83,7 @@ jobs:
- ./initialize --s -n32000 -t11 -o
# MemorySanitizer
- os: linux
compiler: clang-15
compiler: clang-16
env: MSAN=true
before_script:
- export CMAKE_ARGS="-D ENABLE_SANITIZER_MEMORY:BOOL=TRUE"
Expand All @@ -94,7 +94,7 @@ jobs:
- ./initialize --s -n32000 -t11 -o
# ThreadSanitizer
- os: linux
compiler: clang-15
compiler: clang-16
env: TSAN=true
before_script:
- export CMAKE_ARGS="-D ENABLE_SANITIZER_THREAD:BOOL=TRUE"
Expand All @@ -105,7 +105,7 @@ jobs:
- ./initialize --s -n32000 -t11 -o
# Doxygen
- os: linux
compiler: g++-12
compiler: g++-13
env: DOXYGEN=true
install: skip
script:
Expand All @@ -128,12 +128,12 @@ jobs:
condition: $TRAVIS_BRANCH =~ ^(master|develop)$
allow_failures:
- os: linux
compiler: g++-12
compiler: g++-13
env: DOXYGEN=true

before_install:
- if [[ "$CXX" == "g++" ]]; then export CXX="g++-12" CC="gcc-12"; fi
- if [[ "$CXX" == "clang++" ]]; then export CXX="clang++-15" CC="clang-15"; fi
- if [[ "$CXX" == "g++" ]]; then export CXX="g++-13" CC="gcc-13"; fi
- if [[ "$CXX" == "clang++" ]]; then export CXX="clang++-16" CC="clang-16"; fi

install:
# vcpkg should be cached, but clone it if not
Expand Down
22 changes: 22 additions & 0 deletions include/Foliated_triangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,28 @@ namespace foliated_triangulations
}
} // print_cells

/// @brief Write to debug log timevalues of each vertex in the cell and the
/// resulting cell->info
/// @tparam dimension The dimensionality of the simplices
/// @tparam Container The type of container
/// @param t_cells The cells to write to debug log
template <int dimension, ContainerType Container>
void debug_print_cells(Container&& t_cells)
{
for (auto cells = std::forward<Container>(t_cells);
auto const& cell : cells)
{
spdlog::debug("Cell info => {}\n", cell->info());
for (int j = 0; j < dimension + 1; ++j)
{
spdlog::debug("Vertex({}) Point: ({}) Timevalue: {}\n", j,
utilities::point_to_str(cell->vertex(j)->point()),
cell->vertex(j)->info());
}
spdlog::debug("---\n");
}
} // debug_print_cells

/// @brief Print neighboring cells
/// @tparam dimension The dimensionality of the simplices
/// @param cell The cell to print neighbors of
Expand Down
5 changes: 3 additions & 2 deletions scripts/clang-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
cd ..
rm -rf build/
cmake -S . -B build -G Ninja -D ENABLE_CLANG_TIDY=ON
# Copy blank .clang-tidy into build directory to tell clang-tidy to ignore the Qt files which cause a lot of warnings
cmake -E copy cmake/.clang-tidy build/
# Make blank .clang-tidy into build directory to tell clang-tidy to ignore the Qt files which cause a lot of warnings
touch build/.clang-tidy
#echo "Checks: '-*'" >> build/.clang-tidy
cmake --build build

0 comments on commit 8443a78

Please sign in to comment.