Skip to content

Commit

Permalink
Merge pull request #110 from 2xB/asan2
Browse files Browse the repository at this point in the history
CI: Test with address sanitizer
  • Loading branch information
richeldichel authored Aug 16, 2024
2 parents 890b097 + e53bd0d commit 5814516
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 236 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
fi
./setup.sh
KASSIOPEIA_CUSTOM_CMAKE_ARGS="-DENABLE_SANITIZE_ADDRESSES=ON" ./setup.sh
shell: bash

- name: Launch environment and run tests
run: |
source root/bin/thisroot.sh && source install/bin/kasperenv.sh && UnitTestKasper
source root/bin/thisroot.sh && source install/bin/kasperenv.sh && ASAN_OPTIONS=detect_leaks=0 UnitTestKasper
shell: bash

fedora_40:
Expand All @@ -66,7 +66,8 @@ jobs:
root-core root-io-xmlparser root-minuit2 root-spectrum root-genvector \
vtk vtk-qt \
boost-devel fftw-devel gsl-devel hdf5-devel libomp-devel liburing-devel libxml2-devel log4cxx-devel \
ocl-icd-devel openmpi-devel openssl-devel sqlite-devel vtk-devel zlib-devel
ocl-icd-devel openmpi-devel openssl-devel sqlite-devel vtk-devel zlib-devel \
libasan
- name: Build code
run: |
if ${{ matrix.use_clang }}; then
Expand All @@ -75,10 +76,10 @@ jobs:
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
fi
./setup.sh
KASSIOPEIA_CUSTOM_CMAKE_ARGS="-DENABLE_SANITIZE_ADDRESSES=ON" ./setup.sh
shell: bash

- name: Launch environment and run tests
run: |
source install/bin/kasperenv.sh && UnitTestKasper
source install/bin/kasperenv.sh && ASAN_OPTIONS=detect_leaks=0 UnitTestKasper
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Both examples together will yield the output::
[INITIALIZATION NORMAL MESSAGE] This is a test message.

Instead of showing normal messages, it is also possible to show a warning or an error message. An error message will
terminate the prgogram, so it is most useful in combination with the conditional expressions described below:
terminate the program, so it is most useful in combination with the conditional expressions described below:

.. code-block:: xml
Expand Down
226 changes: 0 additions & 226 deletions UnitTest/KGeoBag/Source/Shapes.cxx

This file was deleted.

8 changes: 4 additions & 4 deletions UnitTest/KGeoBag/Source/Shapes_Volumes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ TEST_F(KGeoBagShapeTest, KGBox)
tSurface3->SetP0(KThreeVector(0.1, 0.2, 0.3));
tSurface3->SetP1(KThreeVector(1., 2., 3.));

EXPECT_EQ(tSurface2->GetP0(), KThreeVector(0.1, 0.2, 0.3));
EXPECT_EQ(tSurface2->GetP1(), KThreeVector(1., 2., 3.));
EXPECT_EQ(tSurface3->GetP0(), KThreeVector(0.1, 0.2, 0.3));
EXPECT_EQ(tSurface3->GetP1(), KThreeVector(1., 2., 3.));

tSurface3->SetX0(1.1);
tSurface3->SetX1(2.1);
Expand All @@ -60,8 +60,8 @@ TEST_F(KGeoBagShapeTest, KGBox)
tSurface3->SetP0(KThreeVector(0.1, 0.2, 0.3));
tSurface3->SetP1(KThreeVector(1., 2., 3.));

EXPECT_EQ(tSurface2->GetP0(), KThreeVector(0.1, 0.2, 0.3));
EXPECT_EQ(tSurface2->GetP1(), KThreeVector(1., 2., 3.));
EXPECT_EQ(tSurface3->GetP0(), KThreeVector(0.1, 0.2, 0.3));
EXPECT_EQ(tSurface3->GetP1(), KThreeVector(1., 2., 3.));

delete tSurface3;
}
Expand Down

0 comments on commit 5814516

Please sign in to comment.