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

Tests fail on macOS (x86_64-darwin) #84

Closed
sternenseemann opened this issue Nov 3, 2021 · 3 comments
Closed

Tests fail on macOS (x86_64-darwin) #84

sternenseemann opened this issue Nov 3, 2021 · 3 comments

Comments

@sternenseemann
Copy link

After upgrading utf8cpp to 3.2.1 in nixpkgs, the tests started to fail in the following way:

cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_INSTALL_LOCALEDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/share/doc/utf8cpp -DCMAKE_INSTALL_INFODIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/5j78r51lhl6pwfjxd2cz25p40xcnnywn-cctools-binutils-darwin-949.0.1/bin/strip -DCMAKE_RANLIB=/nix/store/5j78r51lhl6pwfjxd2cz25p40xcnnywn-cctools-binutils-darwin-949.0.1/bin/ranlib -DCMAKE_AR=/nix/store/5j78r51lhl6pwfjxd2cz25p40xcnnywn-cctools-binutils-darwin-949.0.1/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/rfnafncznyd5z6rjjqw008mx547061m0-utf8cpp-3.2.1 -DCMAKE_INSTALL_LIBDIR=lib 
-- The CXX compiler identification is Clang 7.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/mc3wc45mhv836fs8dnjw4rfm7pj7gljl-clang-wrapper-7.1.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_C_COMPILER
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_FIND_USE_PACKAGE_REGISTRY
    CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
    CMAKE_POLICY_DEFAULT_CMP0025


-- Build files have been written to: /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/build
cmake: enabled parallel building
building
build flags: -j4 -l4 SHELL=/nix/store/vm564n0g8k6pkiwqb31x1dw1y02h2mak-bash-5.1-p8/bin/bash
[  6%] Building CXX object tests/CMakeFiles/cpp17.dir/test_cpp17.cpp.o
[ 12%] Building CXX object CMakeFiles/docsample.dir/samples/docsample.cpp.o
[ 18%] Building CXX object tests/CMakeFiles/apitests.dir/test_checked_api.cpp.o
[ 25%] Building CXX object tests/CMakeFiles/negative.dir/negative.cpp.o
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_checked_api.cpp:2:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_cpp17.cpp:1:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
[ 31%] Linking CXX executable negative
[ 31%] Built target negative
[ 37%] Building CXX object tests/CMakeFiles/apitests.dir/test_unchecked_api.cpp.o
1 warning generated.
1 warning generated.
[ 43%] Building CXX object tests/CMakeFiles/noexceptionstests.dir/test_unchecked_api.cpp.o
[ 50%] Linking CXX executable cpp17
[ 56%] Linking CXX executable docsample
[ 56%] Built target cpp17
[ 62%] Building CXX object tests/CMakeFiles/noexceptionstests.dir/test_unchecked_iterator.cpp.o
[ 62%] Built target docsample
[ 68%] Building CXX object tests/CMakeFiles/cpp11.dir/test_cpp11.cpp.o
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_unchecked_api.cpp:1:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_unchecked_api.cpp:1:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_unchecked_iterator.cpp:2:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_cpp11.cpp:1:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
1 warning generated.
[ 75%] Building CXX object tests/CMakeFiles/apitests.dir/test_checked_iterator.cpp.o
1 warning generated.
[ 81%] Building CXX object tests/CMakeFiles/apitests.dir/test_unchecked_iterator.cpp.o
1 warning generated.
[ 87%] Linking CXX executable noexceptionstests
[ 87%] Built target noexceptionstests
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_checked_iterator.cpp:2:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
In file included from /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/test_unchecked_iterator.cpp:2:
/tmp/nix-build-utf8cpp-3.2.1.drv-0/source/tests/../extern/ftest/ftest.h:159:13: warning: delete called on 'ftest::Test' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
            delete m_tests[i];
            ^
1 warning generated.
[ 93%] Linking CXX executable cpp11
[ 93%] Built target cpp11
1 warning generated.
1 warning generated.
[100%] Linking CXX executable apitests
[100%] Built target apitests
running tests
check flags: SHELL=/nix/store/vm564n0g8k6pkiwqb31x1dw1y02h2mak-bash-5.1-p8/bin/bash VERBOSE=y test
Running tests...
/nix/store/bn00vnhjd5p1ry7j1ipfakfnnqs1bbhs-cmake-3.21.2/bin/ctest --force-new-ctest-process 
Test project /tmp/nix-build-utf8cpp-3.2.1.drv-0/source/build
    Start 1: negative_test
    Start 2: cpp11_test
    Start 3: cpp17_test
    Start 4: api_test
1/5 Test #1: negative_test ....................   Passed    0.01 sec
    Start 5: noexceptions_test
2/5 Test #2: cpp11_test .......................***Exception: Illegal  0.01 sec
[==========] Running 9 tests from 1 test cases.
[----------] 9 tests from CPP11APITests
[ RUN      ] CPP11APITests.test_append
[       OK ] CPP11APITests.test_append
[ RUN      ] CPP11APITests.test_utf16to8
[       OK ] CPP11APITests.test_utf16to8
[ RUN      ] CPP11APITests.test_utf8to16
[       OK ] CPP11APITests.test_utf8to16
[ RUN      ] CPP11APITests.test_utf32to8
[       OK ] CPP11APITests.test_utf32to8
[ RUN      ] CPP11APITests.test_utf8to32
[       OK ] CPP11APITests.test_utf8to32
[ RUN      ] CPP11APITests.test_find_invalid
[       OK ] CPP11APITests.test_find_invalid
[ RUN      ] CPP11APITests.test_is_valid
[       OK ] CPP11APITests.test_is_valid
[ RUN      ] CPP11APITests.test_replace_invalid
[       OK ] CPP11APITests.test_replace_invalid
[ RUN      ] CPP11APITests.test_starts_with_bom
[       OK ] CPP11APITests.test_starts_with_bom
[----------] 9 tests from CPP11APITests
[==========] 9 tests from 1 test cases ran.
[  PASSED  ] 9 tests.

3/5 Test #3: cpp17_test .......................***Exception: Illegal  0.01 sec
[==========] Running 9 tests from 1 test cases.
[----------] 9 tests from CPP17APITests
[ RUN      ] CPP17APITests.test_utf16to8
[       OK ] CPP17APITests.test_utf16to8
[ RUN      ] CPP17APITests.test_utf8to16
[       OK ] CPP17APITests.test_utf8to16
[ RUN      ] CPP17APITests.test_utf32to8
[       OK ] CPP17APITests.test_utf32to8
[ RUN      ] CPP17APITests.test_utf8to32
[       OK ] CPP17APITests.test_utf8to32
[ RUN      ] CPP17APITests.test_find_invalid
[       OK ] CPP17APITests.test_find_invalid
[ RUN      ] CPP17APITests.test_is_valid
[       OK ] CPP17APITests.test_is_valid
[ RUN      ] CPP17APITests.test_replace_invalid
[       OK ] CPP17APITests.test_replace_invalid
[ RUN      ] CPP17APITests.test_starts_with_bom
[       OK ] CPP17APITests.test_starts_with_bom
[ RUN      ] CPP17APITests.string_class_and_literals
[       OK ] CPP17APITests.string_class_and_literals
[----------] 9 tests from CPP17APITests
[==========] 9 tests from 1 test cases ran.
[  PASSED  ] 9 tests.

4/5 Test #4: api_test .........................***Exception: Illegal  0.01 sec
[==========] Running 15 tests from 3 test cases.
[----------] 11 tests from UnCheckedAPITests
[ RUN      ] UnCheckedAPITests.test_append
[       OK ] UnCheckedAPITests.test_append
[ RUN      ] UnCheckedAPITests.test_next
[       OK ] UnCheckedAPITests.test_next
[ RUN      ] UnCheckedAPITests.test_peek_next
[       OK ] UnCheckedAPITests.test_peek_next
[ RUN      ] UnCheckedAPITests.test_prior
[       OK ] UnCheckedAPITests.test_prior
[ RUN      ] UnCheckedAPITests.test_advance
[       OK ] UnCheckedAPITests.test_advance
[ RUN      ] UnCheckedAPITests.test_distance
[       OK ] UnCheckedAPITests.test_distance
[ RUN      ] UnCheckedAPITests.test_utf32to8
[       OK ] UnCheckedAPITests.test_utf32to8
[ RUN      ] UnCheckedAPITests.test_utf8to32
[       OK ] UnCheckedAPITests.test_utf8to32
[ RUN      ] UnCheckedAPITests.test_utf16to8
[       OK ] UnCheckedAPITests.test_utf16to8
[ RUN      ] UnCheckedAPITests.test_utf8to16
[       OK ] UnCheckedAPITests.test_utf8to16
[ RUN      ] UnCheckedAPITests.test_replace_invalid
[       OK ] UnCheckedAPITests.test_replace_invalid
[----------] 11 tests from UnCheckedAPITests
[----------] 2 tests from CheckedIteratrTests
[ RUN      ] CheckedIteratrTests.test_increment
[       OK ] CheckedIteratrTests.test_increment
[ RUN      ] CheckedIteratrTests.test_decrement
[       OK ] CheckedIteratrTests.test_decrement
[----------] 2 tests from CheckedIteratrTests
[----------] 2 tests from UnCheckedIteratrTests
[ RUN      ] UnCheckedIteratrTests.test_increment
[       OK ] UnCheckedIteratrTests.test_increment
[ RUN      ] UnCheckedIteratrTests.test_decrement
[       OK ] UnCheckedIteratrTests.test_decrement
[----------] 2 tests from UnCheckedIteratrTests
[==========] 15 tests from 3 test cases ran.
[  PASSED  ] 15 tests.

5/5 Test #5: noexceptions_test ................***Exception: Illegal  0.01 sec
[==========] Running 13 tests from 2 test cases.
[----------] 11 tests from UnCheckedAPITests
[ RUN      ] UnCheckedAPITests.test_append
[       OK ] UnCheckedAPITests.test_append
[ RUN      ] UnCheckedAPITests.test_next
[       OK ] UnCheckedAPITests.test_next
[ RUN      ] UnCheckedAPITests.test_peek_next
[       OK ] UnCheckedAPITests.test_peek_next
[ RUN      ] UnCheckedAPITests.test_prior
[       OK ] UnCheckedAPITests.test_prior
[ RUN      ] UnCheckedAPITests.test_advance
[       OK ] UnCheckedAPITests.test_advance
[ RUN      ] UnCheckedAPITests.test_distance
[       OK ] UnCheckedAPITests.test_distance
[ RUN      ] UnCheckedAPITests.test_utf32to8
[       OK ] UnCheckedAPITests.test_utf32to8
[ RUN      ] UnCheckedAPITests.test_utf8to32
[       OK ] UnCheckedAPITests.test_utf8to32
[ RUN      ] UnCheckedAPITests.test_utf16to8
[       OK ] UnCheckedAPITests.test_utf16to8
[ RUN      ] UnCheckedAPITests.test_utf8to16
[       OK ] UnCheckedAPITests.test_utf8to16
[ RUN      ] UnCheckedAPITests.test_replace_invalid
[       OK ] UnCheckedAPITests.test_replace_invalid
[----------] 11 tests from UnCheckedAPITests
[----------] 2 tests from UnCheckedIteratrTests
[ RUN      ] UnCheckedIteratrTests.test_increment
[       OK ] UnCheckedIteratrTests.test_increment
[ RUN      ] UnCheckedIteratrTests.test_decrement
[       OK ] UnCheckedIteratrTests.test_decrement
[----------] 2 tests from UnCheckedIteratrTests
[==========] 13 tests from 2 test cases ran.
[  PASSED  ] 13 tests.


20% tests passed, 4 tests failed out of 5

Total Test time (real) =   0.02 sec

The following tests FAILED:
          2 - cpp11_test (ILLEGAL)
          3 - cpp17_test (ILLEGAL)
          4 - api_test (ILLEGAL)
          5 - noexceptions_test (ILLEGAL)
Errors while running CTest
make: *** [Makefile:136: test] Error 8

We have a bit of a different toolchain than distributed by Apple, for example using clang 7.1.0. From the error messages I'm struggling to pinpoint the exact nature of the issue, any pointers would be appreciated.

@sternenseemann
Copy link
Author

Bisected, first bad commit is fe79d14.

sternenseemann added a commit to sternenseemann/nixpkgs that referenced this issue Nov 3, 2021
Ever since the test framework was changed, tests started to fail on
Darwin due to an exception being thrown somewhere in the test framework
code. As this failure doesn't indicate a bug in utf8cpp, we can work
around this by disabling the test suite on darwin.

Closes NixOS#144265.
Reference nemtrif/utfcpp#84.
@nemtrif
Copy link
Owner

nemtrif commented Nov 3, 2021

I replaced GTest with ftest - a small, quick and dirty testing framework I wrote. It is something in ftest that is causing the problem.

I'll look into it when I have time, but you can always just test with gtest instead.

@nemtrif
Copy link
Owner

nemtrif commented Nov 6, 2021

I could not reproduce the failures with clang version 10.0.0-4ubuntu1. I did resolve a warning reported there, but the chance is it is unrelated to the test failure.

@nemtrif nemtrif closed this as completed Nov 20, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants