Files
CoolProp/Web/develop/testing.rst
Ian Bell f0b988236f build: replace git submodules with CPM.cmake (#2728)
* build: replace git submodules with CPM.cmake

All 11 submodules (Eigen, fmtlib, msgpack-c, rapidjson, IF97,
REFPROP-headers, multicomplex, Catch2, pybind11, ExcelAddinInstaller,
FindMathematica) are now fetched by CPM.cmake at configure time.

Set CPM_SOURCE_CACHE (e.g. ~/.cache/CPM) to share the download cache
across git worktrees and build directories — no more per-worktree
`git submodule update --init --recursive`.

Vendored deps that have no upstream release cycle (miniz, nlohmann-json,
incbin) remain in externals/ as before.

Source-level changes: angle-bracket includes for rapidjson, IF97, and
REFPROP-headers now that their directories are on the include path via
CPM-provided source dirs rather than relative paths from the repo root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(python): wire up CPM.cmake in Python wrapper, fix include paths

The Python wrapper CMakeLists.txt was still referencing submodule paths
(externals/Eigen, externals/fmtlib, externals/msgpack-c) removed by the
CPM migration. Include CPM.cmake + dependencies.cmake from the root and
use the ${Pkg_SOURCE_DIR} variables instead.  Also adds missing
rapidjson, IF97, and REFPROP_headers include dirs required by CoolProp
sources.

CI workflows drop the now-meaningless `submodules: recursive` checkout
option and add a CPM source-cache step to avoid re-downloading on each
macOS/Windows runner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: remove git submodule references after CPM.cmake migration

Dependencies are now managed by CPM.cmake (fetched automatically at
CMake configure time), so git submodules no longer exist.

- Drop `--recursive` from all `git clone` commands in Web docs and
  wrapper READMEs (26 .rst/.md files)
- Remove `submodules: recursive` from all CI workflow checkout steps
  (13 workflow files)
- Remove `git submodule foreach/update` calls from release.bsh and
  delete the now-dead pybind11 security-workaround lines
- Drop `--recursive` from build_swigged_matlab.sh and gitMirror.bsh
- Update CONTRIBUTING.md: drop "and its submodules" phrasing

Changelog entries referencing old submodule PRs are left intact as
historical records. The --recursive in buildbot.rst is for the
Dockerfiles repo (unrelated) and is also left unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(ci): remove empty 'with:' blocks after submodule removal, apply clang-format

After removing 'submodules: recursive' from checkout steps, some workflow
files were left with dangling empty 'with:' blocks that GitHub Actions
rejects as workflow file errors. Remove the empty 'with:' in 9 workflows.

Also apply clang-format to fix spacing in REFPROPMixtureBackend.cpp,
HumidAirProp.cpp, and Helmholtz.cpp.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 11:45:10 -04:00

71 lines
2.4 KiB
ReStructuredText

***********************
Diagnostics and Testing
***********************
Travis Builds
-------------
Coverity Scan
-------------
1. Download coverity and expand the zip file
2. Make up a little batch script to build the coverity analysis. Obviously change the paths to suit your machine.
.. note:: I had to set the path to the g++ compiler, and it didn't like visual studio, so I used mingw. On linux, this isn't much of an issue as it just uses g++
Here it is::
set PATH_TO_COV=C:\Users\Belli\Downloads\cov-analysis-win64-7.6.0\cov-analysis-win64-7.6.0\bin\cov-build
set PATH=C:\TDM-GCC-64\bin;%PATH%
cmake ../.. -DCOOLPROP_SHARED_LIBRARY=ON -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
%PATH_TO_COV% --dir cov-int cmake --build . --config Release
3. Zip up the results
4. Upload to coverity scan
.. note::
In April 2017, the upload to Coverity Scan has been automated and all you have to do is to merge and push new code to the branch coverity_scan, Travis CI will do the rest.
Address Sanitizer
-----------------
Address sanitizer is a module of the clang compiler that can help to pinpoint several memory problems, like addressing memory that is out of range.
The instructions here explain how to get address sanitizer working for CoolProp for testing purposes.
The easiest solution is to use OSX and download the binaries for LLVM+clang from http://llvm.org/releases/download.html. You will need to expand the file with something like::
tar -xJf clang+llvm-3.5-x86_64-apple-darwin10.9.tar.xz
1. Check out CoolProp using git::
git clone https://github.com/CoolProp/CoolProp
2. Move into folder::
cd CoolProp && mkdir -p build/asan && cd build/asan
3. Set environmental variable to the root of the clang installation::
export CLANG_ROOT=/Users/Ian/Downloads/clang+llvm-3.5.0-macosx-apple-darwin
4. Run the cmake call with the special clang version with asan support::
cmake ../.. -DCOOLPROP_CLANG_ADDRESS_SANITIZER=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_COMPILER=${CLANG_ROOT}/bin/clang -DCMAKE_CXX_COMPILER=${CLANG_ROOT}/bin/clang++
5. Build::
cmake --build .
6. Execute::
DYLD_LIBRARY_PATH=${CLANG_ROOT}/lib/clang/3.5.0/lib/darwin/ ASAN_SYMBOLIZER_PATH=${CLANG_ROOT}/bin/llvm-symbolizer ASAN_OPTIONS=verbosity=1 ./CatchTestRunner
The ``verbosity=1`` is to make sure that ASAN is actually running