diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index aef247200..f2e76ec8d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -26,8 +26,6 @@ jobs: include: - os: ubuntu-latest name: Linux - - os: macos-15 - name: macOS 15 arm64 - os: macos-26 name: macOS 26 arm64 name: ${{ matrix.name }} diff --git a/.gitignore b/.gitignore index fe85e14d5..125b8b487 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ gcovr-output/ gcov-data/ /bw-output/ /.scannerwork/ +coverage-html*/** ## Generic generated file patterns *~ diff --git a/.travis.yml b/.travis.yml index 4e8239142..efe6413d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ addons: - uuid-dev - libcurl4-openssl-dev - libcppunit-dev - - gcovr + # - gcovr Later we force version 8.2. Using apt install 4.2 which has bugs. jhrg 7/16/26 - libfl-dev # needed for focal, but not xenial. jhrg 1/18/24 - libtool-bin - ccache @@ -145,6 +145,7 @@ jobs: - stage: scan name: "scan" env: CACHE_NAME=scan + TESTSUITEFLAGS=-j1 script: - export LIBDAP_BUILD=sonar - export SONAR_TOKEN=$SONAR_LOGIN @@ -152,6 +153,12 @@ jobs: - ./configure --disable-dependency-tracking --prefix=$prefix --enable-developer --enable-coverage - build-wrapper-linux-x86-64 --out-dir bw-output make -j$BUILD_PROCS - make check -j$BUILD_PROCS + # Force version 8.2 to work around an issue with the version bound to focal. + # Using apt (the addons section at line 42) installs version 4.2 which has bugs + # that break SonarScan. jhrg 7/16/26 + - pip3 install --user gcovr==8.2 + - export PATH="$HOME/.local/bin:$PATH" + - gcovr --version - gcovr --config gcovr.config --sonarqube coverage.xml - sonar-scanner # The scanner waits for the quality gate because sonar.qualitygate.wait=true is set diff --git a/conf/config.rpath b/conf/config.rpath index af3c41559..58870bd70 100755 --- a/conf/config.rpath +++ b/conf/config.rpath @@ -1,23 +1,15 @@ #! /bin/sh # Output a system dependent set of variables, describing how to set the -# run time search path of shared libraries in an executable. +# run time search path of shared libraries in a binary (executable or +# shared library). # -# Copyright 1996-2017 Free Software Foundation, Inc. +# Copyright 1996-2024 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer @@ -25,6 +17,81 @@ # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. +# func_usage +# outputs to stdout the --help usage message. +func_usage () +{ + echo "\ +Usage: config.rpath [OPTION] HOST + +Prints shell variable assignments that describe how to hardcode a directory +for the lookup of shared libraries into a binary (executable or shared library). + +The first argument passed to this file is the canonical host specification, + CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +or + CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +should be set by the caller. + +The set of defined variables is at the end of this script. + +Options: + --help print this help and exit + --version print version information and exit + +Send patches and bug reports to ." +} + +# func_version +# outputs to stdout the --version message. +func_version () +{ + echo "config.rpath (GNU gnulib, module havelib)" + echo "Copyright (C) 2024 Free Software Foundation, Inc. +License: All-Permissive. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law." + echo + printf 'Written by %s.\n' "Bruno Haible" +} + +# func_fatal_error message +# outputs to stderr a fatal error message, and terminates the program. +func_fatal_error () +{ + echo "config.rpath: *** $1" 1>&2 + echo "config.rpath: *** Stop." 1>&2 + exit 1 +} + +# Command-line option processing. +while test $# -gt 0; do + case "$1" in + --help | --hel | --he | --h ) + func_usage + exit 0 ;; + --version | --versio | --versi | --vers | --ver | --ve | --v ) + func_version + exit 0 ;; + -- ) # Stop option processing + shift; break ;; + -* ) + func_fatal_error "unrecognized option: $1" + ;; + * ) + break ;; + esac +done + +if test $# -gt 1; then + func_fatal_error "too many arguments" +fi +if test $# -lt 1; then + func_fatal_error "too few arguments" +fi + # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a @@ -371,7 +438,7 @@ else hardcode_direct=yes hardcode_minus_L=yes ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; @@ -547,7 +614,7 @@ case "$host_os" in freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) library_names_spec='$libname$shrext' ;; gnu*) diff --git a/gcovr.config b/gcovr.config index 42298cb52..282d32907 100644 --- a/gcovr.config +++ b/gcovr.config @@ -14,6 +14,7 @@ exclude-throw-branches = yes # sort = uncovered-percent # exclude coverage for the test code +# match/sync these with sonar-project.properties. jhrg 7/16/26 exclude-directories = (.+/)?unit-tests exclude-directories = (.+/)?tests exclude-directories = (.+/)?gl diff --git a/DAPCache3.cc b/retired/DAPCache3.cc similarity index 100% rename from DAPCache3.cc rename to retired/DAPCache3.cc diff --git a/DAPCache3.h b/retired/DAPCache3.h similarity index 100% rename from DAPCache3.h rename to retired/DAPCache3.h diff --git a/unit-tests/DAPCache3Test.cc b/retired/unit-tests/DAPCache3Test.cc similarity index 100% rename from unit-tests/DAPCache3Test.cc rename to retired/unit-tests/DAPCache3Test.cc diff --git a/sonar-project.properties b/sonar-project.properties index 94e4481a7..f24396b61 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,6 +11,8 @@ sonar.projectVersion=1.0 sonar.sources=. sonar.exclusions=retired/**,debian/**,gl/**,VCPP/**,win32/** +# Be sure to sync changes to gcovr.config with these exclusions. jhrg 7/16/26 +sonar.coverage.exclusions=unit-tests/**,tests/**,conf/**,gl/**,retired/** # TODO Use this? jhrg 5/8/25 sonar.tests= sonar.cfamily.compile-commands=bw-output/compile_commands.json diff --git a/unit-tests/CMakeLists.txt b/unit-tests/CMakeLists.txt index 307e266f9..3bded8434 100644 --- a/unit-tests/CMakeLists.txt +++ b/unit-tests/CMakeLists.txt @@ -21,7 +21,7 @@ set(TESTS_DAP_ONLY D4AttributesTest.cc D4EnumTest.cc chunked_iostream_test.cc D4AsyncDocTest.cc DMRTest.cc DmrRoundTripTest.cc DmrToDap2Test.cc D4FilterClauseTest.cc IsDap4ProjectedTest.cc MarshallerFutureTest.cc TempFileTest.cc - DAPCache3Test.cc D4StreamRoundTripTest.cc ConstraintEvaluatorTest.cc MarshallerThreadTest.cc + D4StreamRoundTripTest.cc ConstraintEvaluatorTest.cc MarshallerThreadTest.cc BaseTypeTest.cc ) @@ -74,9 +74,6 @@ foreach(src ${TESTS_DAP_ONLY}) build_test(${tgt} ${src}) endforeach() -# DAPCache3 is not part of libdap, so compile its implementation into the test. -target_sources(DAPCache3Test PRIVATE ${CMAKE_SOURCE_DIR}/DAPCache3.cc) - foreach(src ${TESTS_DAPCLIENT}) get_filename_component(tgt ${src} NAME_WE) build_test(${tgt} ${src}) diff --git a/unit-tests/Makefile.am b/unit-tests/Makefile.am index 47b6692f1..8b35a8773 100644 --- a/unit-tests/Makefile.am +++ b/unit-tests/Makefile.am @@ -89,7 +89,7 @@ UNIT_TESTS = marshT arrayT attrTableT structT sequenceT ddsT dasT \ Int32Test UInt32Test Int64Test UInt64Test Float32Test Float64Test \ D4BaseTypeFactoryTest BaseTypeFactoryTest util_mitTest ErrorTest \ MarshallerFutureTest ConstraintEvaluatorTest MarshallerThreadTest \ - DAPCache3Test BaseTypeTest SegmentReadWriteT + BaseTypeTest SegmentReadWriteT # Unit tests for DAP4-only code. jhrg 2/4/22 UNIT_TESTS += D4MarshallerTest D4UnMarshallerTest D4DimensionsTest \ @@ -185,7 +185,7 @@ DDXParserTest_CPPFLAGS = $(AM_CPPFLAGS) $(XML2_CFLAGS) generalUtilTest_SOURCES = generalUtilTest.cc -DAPCache3Test_SOURCES = DAPCache3Test.cc ../DAPCache3.cc ../DAPCache3.h +# DAPCache3Test_SOURCES = DAPCache3Test.cc ../DAPCache3.cc ../DAPCache3.h ConstraintEvaluatorTest_SOURCES = ConstraintEvaluatorTest.cc