Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

Code formatting tests can be accidentally conducted during package builds in unclean build environments #28

Closed Nils-TUD closed 10 months ago

Nils-TUD commented 10 months ago

I tried to install version 5.24.2 today, but the tests break for me:

==> Making package: c++utilities 5.24.2-1 (Wed 22 Nov 2023 07:22:54 AM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found c++utilities-5.24.2.tar.gz
==> Validating source files with sha256sums...
    c++utilities-5.24.2.tar.gz ... Passed
==> Extracting sources...
  -> Extracting c++utilities-5.24.2.tar.gz with bsdtar
==> Sources are ready.
==> Making package: c++utilities 5.24.2-1 (Wed 22 Nov 2023 07:22:57 AM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found c++utilities-5.24.2.tar.gz
==> Validating source files with sha256sums...
    c++utilities-5.24.2.tar.gz ... Passed
==> Extracting sources...
  -> Extracting c++utilities-5.24.2.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
-- Using iconv from the standard library for target c++utilities.
-- Using __gnu_cxx::stdio_filebuf for NativeFileStream
-- Linking c++utilities against special library for std::filesystem support is not required.
-- Configuring project c++utilities
-- Using default CXX11 ABI  of libstdc++ (not forcing old CX11 ABI).
-- Using template for global.h.in from own (c++utilities) source directory.
-- Using template for version.h.in from own (c++utilities) source directory.
-- Using template for Config.cmake.in from own (c++utilities) source directory.
-- Using template for template.pc.in from own (c++utilities) source directory.
-- Linking test target against c++utilities
-- Using template for doxygen.in from own (c++utilities) source directory.
CMake Warning at cmake/modules/Doxygen.cmake:32 (message):
  Doxygen not found, unable to add target for generating API documentation
  for c++utilities
Call Stack (most recent call first):
  CMakeLists.txt:235 (include)

-- Using template for config.h.in from own (c++utilities) source directory.
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2
ninja: no work to do.
==> Starting check()...
[0/1] cd /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2 && /usr/bin/ctest -V
UpdateCTestConfiguration  from :/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/DartConfiguration.tcl
Parse Config file:/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/DartConfiguration.tcl
Parse Config file:/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/DartConfiguration.tcl
Test project /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: c++utilities_tidy_test

1: Test command: /usr/bin/clang-format "-output-replacements-xml" "-style=file" "application/argumentparser.h" "application/commandlineutils.h" "application/fakeqtconfigarguments.h" "application/global.h" "chrono/datetime.h" "chrono/period.h" "chrono/timespan.h" "chrono/format.h" "conversion/binaryconversion.h" "conversion/binaryconversionprivate.h" "conversion/conversionexception.h" "conversion/stringconversion.h" "conversion/stringbuilder.h" "io/ansiescapecodes.h" "io/binaryreader.h" "io/binarywriter.h" "io/bitreader.h" "io/buffersearch.h" "io/copy.h" "io/inifile.h" "io/path.h" "io/nativefilestream.h" "io/misc.h" "misc/flagenumclass.h" "misc/math.h" "misc/multiarray.h" "misc/parseerror.h" "misc/traits.h" "misc/levenshtein.h" "tests/testutils.h" "tests/cppunit.h" "tests/outputcheck.h" "application/argumentparserprivate.h" "application/argumentparser.cpp" "application/commandlineutils.cpp" "application/fakeqtconfigarguments.cpp" "chrono/datetime.cpp" "chrono/period.cpp" "chrono/timespan.cpp" "conversion/conversionexception.cpp" "conversion/stringconversion.cpp" "io/ansiescapecodes.cpp" "io/binaryreader.cpp" "io/binarywriter.cpp" "io/bitreader.cpp" "io/buffersearch.cpp" "io/inifile.cpp" "io/path.cpp" "io/nativefilestream.cpp" "io/misc.cpp" "misc/math.cpp" "misc/parseerror.cpp" "misc/levenshtein.cpp" "tests/testutils.cpp" "tests/cppunit.cpp" "tests/conversiontests.cpp" "tests/iotests.cpp" "tests/chronotests.cpp" "tests/argumentparsertests.cpp" "tests/traitstests.cpp" "tests/mathtests.cpp" "tests/misctests.cpp" "cmake/templates/cli-wrapper.cpp"
1: Working Directory: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2
1: Test timeout computed to be: 1500
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: <replacement offset='9042' length='1'></replacement>
1: <replacement offset='9044' length='1'></replacement>
1: <replacement offset='9230' length='1'></replacement>
1: <replacement offset='9232' length='1'></replacement>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1: <?xml version='1.0'?>
1: <replacements xml:space='preserve' incomplete_format='false'>
1: </replacements>
1/2 Test #1: c++utilities_tidy_test ...........***Failed  Error regular expression found in output. Regex=[<replacement.*>.*</replacement>]  0.57 sec
test 2
    Start 2: c++utilities_run_tests

2: Test command: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/c++utilities_tests "-p" "/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/testfiles" "-w" "/home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/testworkingdir"
2: Working Directory: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2
2: Test timeout computed to be: 1500
2: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/testfiles/
2: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/testfiles/
2: ./testfiles/
2: Directory used to store working copies:
2: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/testworkingdir/
2: Executing test cases ...
2: ...................
2: output for formatting with ANSI escape codes:
2: Error: some error
2: Warning: some warning
2: Info: some info
2: ==> ERROR: Arch-style error
2: ==> WARNING: Arch-style warning
2:     Arch-style message
2: ==> Arch-style success
2:   -> Arch-style sub-message
2: blue, blinking text on red background
2: ---------------------------------------------
2: ........................
2:
2:
2: OK (43 tests)
2:
2:
2: Tests successful
2/2 Test #2: c++utilities_run_tests ...........   Passed    0.03 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) =   0.61 sec

The following tests FAILED:
          1 - c++utilities_tidy_test (Failed)
Errors while running CTest
Output from these tests are in: /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
FAILED: CMakeFiles/check /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2/CMakeFiles/check
cd /home/hrniels/.cache/pacaur/c++utilities/src/cpp-utilities-5.24.2 && /usr/bin/ctest -V
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in check().
    Aborting...
Martchus commented 10 months ago

It actually makes no sense to run this test for you as it is just about code formatting (and the behavior of the code formatter can change slightly depending on the version so running this test is really problematic). I suggest you build in a clean chroot as described in the developer wiki or with --nocheck. I'll nevertheless try to adjust the PKGBUILD so this test is explicitly disabled.

Martchus commented 10 months ago

I pushed two commits on master and also added them to the AUR packages. These commits should disable development-related tests by default. You can try building the package again without --nocheck.

Nils-TUD commented 10 months ago

I just tried the new version of the AUR package. Now these tests are skipped and it works. Thanks!

Martchus commented 10 months ago

Good, I'm closing this issue then.