Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the tests #70

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 46 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
fail-fast: false
matrix:
include:
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, doc: OFF}
- {os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, doc: ON}
- {os: macos-12, cc: gcc-12, cxx: g++-12, doc: OFF}
- {os: macos-12, cc: clang, cxx: clang++, doc: OFF}
- {os: ubuntu-22.04, cc: gcc-12, cxx: g++-12, doc: OFF, cov: ON}
- {os: ubuntu-22.04, cc: clang-15, cxx: clang++-15, doc: ON, cov: OFF}
- {os: macos-12, cc: gcc-12, cxx: g++-12, doc: OFF, cov: OFF}
- {os: macos-12, cc: clang, cxx: clang++, doc: OFF, cov: OFF}

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -79,24 +79,41 @@ jobs:
python3-sphinx
python3-nbsphinx

- name: set up compilers
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV

- name: set clang environment
if: ${{ contains(matrix.cxx, 'clang') }}
run: |
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "PATH=/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=/usr/local/opt/llvm/lib" >> $GITHUB_ENV

- name: set up virtualenv
run: |
mkdir $HOME/.venv
python3 -m venv --system-site-packages $HOME/.venv/my_python
source $HOME/.venv/my_python/bin/activate
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV

- name: set up test coverage
if: matrix.cov == 'ON'
run: |
pip install gcovr
echo "CXXFLAGS='$CXXFLAGS --coverage'" >> $GITHUB_ENV

- name: Install homebrew dependencies
if: matrix.os == 'macos-12'
run: |
brew install ccache gcc@12 llvm hdf5 open-mpi openblas
mkdir $HOME/.venv
python3 -m venv $HOME/.venv/my_python
source $HOME/.venv/my_python/bin/activate
pip install mako numpy scipy mpi4py
pip install -r requirements.txt
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV

- name: Build doxygen
if: matrix.doc == 'ON'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
LIBRARY_PATH: /usr/local/opt/llvm/lib
run: |
cd $HOME
git clone https://github.com/doxygen/doxygen.git
Expand All @@ -108,12 +125,6 @@ jobs:
make -j 2 VERBOSE=1
cp bin/doxygen /usr/local/bin/doxygen

- name: add clang cxxflags
if: ${{ contains(matrix.cxx, 'clang') }}
run: |
echo "PATH=/usr/local/opt/llvm/bin:$PATH" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV

- name: Prepare source files for doxygen
if: matrix.doc == 'ON'
working-directory: ./c++/nda
Expand All @@ -124,12 +135,8 @@ jobs:
mv tmp_basic_array_view.hpp basic_array_view.hpp

- name: Build nda
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
LIBRARY_PATH: /usr/local/opt/llvm/lib
run: |
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=${{ matrix.doc }} -DPythonSupport=ON
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/install -DBuild_Documentation=${{ matrix.doc }} -DCMAKE_BUILD_TYPE=${{ matrix.cov == 'ON' && Debug || Release }}
make -j2 || make -j1 VERBOSE=1

- name: Test nda
Expand All @@ -140,6 +147,13 @@ jobs:
cd build
ctest -j2 --output-on-failure

- name: Generate test coverage HTML output
if: matrix.cov == 'ON'
run: |
cd build
mkdir coverage
gcovr --gcov-executable "gcov-12" --root ../c++ --html-details -o coverage/coverage.html .

- name: ccache statistics
if: always()
run: ccache -sv
Expand All @@ -157,3 +171,11 @@ jobs:
folder: build/doc/html
branch: github.io
target-folder: docs/unstable

- name: Deploy test coverage
if: matrix.cov == 'ON' && github.ref == 'refs/heads/unstable'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/coverage
branch: github.io
target-folder: docs/coverage
2 changes: 1 addition & 1 deletion c++/nda/mem/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ namespace nda::mem {
*
* @param h Source handle.
*/
handle_sso &operator=(handle_sso const &h) noexcept {
handle_sso &operator=(handle_sso const &h) {
if (this == &h) return *this; // self assignment
clean();
_size = h._size;
Expand Down
2 changes: 1 addition & 1 deletion c++/nda/stdutil/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace nda::stdutil {
template <size_t R, typename T>
constexpr std::array<T, R> make_initialized_array(T v) {
return [&v]<size_t... Is>(std::index_sequence<Is...>) {
return std::array<T, R>{(Is, v)...}; // NOLINT (always v, just a trick to have the pack)
return std::array<T, R>{((void)Is, v)...}; // NOLINT (always v, just a trick to have the pack)
}(std::make_index_sequence<R>{});
}

Expand Down
71 changes: 0 additions & 71 deletions test/c++/clef/clef_F7.cpp

This file was deleted.

160 changes: 0 additions & 160 deletions test/c++/clef/clef_basic.cpp

This file was deleted.

Loading