From 52f5b7e4df0a1872eae354eaef26d9f9e3e7b0f2 Mon Sep 17 00:00:00 2001 From: Igor Krivenko Date: Wed, 24 Jan 2024 13:04:46 +0100 Subject: [PATCH] Debugging SEGFAULT in `expression` unit test --- .github/workflows/build-test-deploy.yml | 10 +- test/CMakeLists.txt | 128 ++++++++++++------------ test/expression.cpp | 4 +- 3 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index ec2724b..5b8734f 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -5,6 +5,7 @@ on: branches: - master - ci + - debug pull_request: branches: - master @@ -13,9 +14,8 @@ jobs: build-test-deploy: strategy: matrix: - os: [ubuntu-20.04, macos-11] + os: [macos-12] cxx_compiler: - - { name: "gcc", cxx: "g++-10" } - { name: "clang", cxx: "clang++" } runs-on: ${{ matrix.os }} @@ -64,12 +64,12 @@ jobs: DOCS=OFF fi CXX="${{ matrix.cxx_compiler.cxx }}" cmake .. \ - -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/installed \ -DSTATIC_ANALYSIS=${STATIC_ANALYSIS} \ -DTESTS=ON \ - -DEXAMPLES=ON \ - -DDOCUMENTATION=${DOCS} + -DEXAMPLES=OFF \ + -DDOCUMENTATION=OFF make -j3 - name: Test libcommute diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 17df427..cfd096a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,38 +20,38 @@ endif(STATIC_ANALYSIS) include_directories(BEFORE SYSTEM catch2) set(TESTS - utility - metafunctions - generator - monomial - scalar_traits - factories + #utility + #metafunctions + #generator + #monomial + #scalar_traits + #factories expression - expression.addition - expression.subtraction - expression.multiplication - expression.const.addition - expression.const.subtraction - expression.const.multiplication - expression.mixed_arithmetics - hc - commutators - new_algebra - state_vector - elementary_space - hilbert_space - monomial_action - monomial_action_fermion - monomial_action_boson - monomial_action_spin - loperator - new_algebra.loperator - disjoint_sets - sparse_state_vector - space_partition - mapped_basis_view - n_fermion_sector_view - n_fermion_multisector_view + #expression.addition + #expression.subtraction + #expression.multiplication + #expression.const.addition + #expression.const.subtraction + #expression.const.multiplication + #expression.mixed_arithmetics + #hc + #commutators + #new_algebra + #state_vector + #elementary_space + #hilbert_space + #monomial_action + #monomial_action_fermion + #monomial_action_boson + #monomial_action_spin + #loperator + #new_algebra.loperator + #disjoint_sets + #sparse_state_vector + #space_partition + #mapped_basis_view + #n_fermion_sector_view + #n_fermion_multisector_view ) # Build C++ unit tests @@ -62,36 +62,36 @@ foreach(t ${TESTS}) add_test(NAME ${t} COMMAND ${t}) endforeach() -set(CXX17_TESTS - dyn_indices - generator_dyn - factories_dyn - elementary_space_dyn -) - -# C++17 tests -if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES) - message(STATUS "Enabling C++17 tests") - foreach(t ${CXX17_TESTS}) - set(s ${CMAKE_CURRENT_SOURCE_DIR}/${t}.cpp) - add_executable(${t} ${s}) - target_compile_features(${t} PRIVATE cxx_std_17) - target_link_libraries(${t} PRIVATE libcommute catch2) - add_test(NAME ${t} COMMAND ${t}) - endforeach() -else() - message(STATUS "Disabling C++17 tests") -endif() - -# Tests using Eigen 3 -if(Eigen3_FOUND) - message(STATUS "Enabling Eigen 3 tests") - set(EIGEN3_TESTS state_vector_eigen3) - foreach(t ${EIGEN3_TESTS}) - set(s ${CMAKE_CURRENT_SOURCE_DIR}/${t}.cpp) - add_executable(${t} ${s}) - target_link_libraries(${t} PRIVATE libcommute catch2) - link_to_eigen3(${t}) - add_test(NAME ${t} COMMAND ${t}) - endforeach() -endif(Eigen3_FOUND) +#set(CXX17_TESTS +# dyn_indices +# generator_dyn +# factories_dyn +# elementary_space_dyn +#) +# +## C++17 tests +#if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES) +# message(STATUS "Enabling C++17 tests") +# foreach(t ${CXX17_TESTS}) +# set(s ${CMAKE_CURRENT_SOURCE_DIR}/${t}.cpp) +# add_executable(${t} ${s}) +# target_compile_features(${t} PRIVATE cxx_std_17) +# target_link_libraries(${t} PRIVATE libcommute catch2) +# add_test(NAME ${t} COMMAND ${t}) +# endforeach() +#else() +# message(STATUS "Disabling C++17 tests") +#endif() +# +## Tests using Eigen 3 +#if(Eigen3_FOUND) +# message(STATUS "Enabling Eigen 3 tests") +# set(EIGEN3_TESTS state_vector_eigen3) +# foreach(t ${EIGEN3_TESTS}) +# set(s ${CMAKE_CURRENT_SOURCE_DIR}/${t}.cpp) +# add_executable(${t} ${s}) +# target_link_libraries(${t} PRIVATE libcommute catch2) +# link_to_eigen3(${t}) +# add_test(NAME ${t} COMMAND ${t}) +# endforeach() +#endif(Eigen3_FOUND) diff --git a/test/expression.cpp b/test/expression.cpp index 5457958..6f669da 100644 --- a/test/expression.cpp +++ b/test/expression.cpp @@ -136,8 +136,8 @@ TEST_CASE("Expression with static indices", "[expression]") { auto val = *it; CHECK(val.monomial == ref_mons[n]); CHECK(val.coeff == ref_coeffs[n]); - CHECK(it->monomial == ref_mons[n]); - CHECK(it->coeff == ref_coeffs[n]); + // CHECK(it->monomial == ref_mons[n]); + // CHECK(it->coeff == ref_coeffs[n]); } }