Files
Chris Mc a751ea2272 🌱 Utilize gtest's TypeParam to change traits implementation during testing (#423)
* utilize TypeParam to change traits implementation

explains why coverage hits were so slow

* fixup danielaparker-jsoncons locally

* fixup open_source_parsers_jsoncpp

tested locally

* cleanup lcov args

* add install script for osp/jsoncpp

* linting

* install script for boost

* boost outputs json in different order

this si allowed so the tests are now more relaxed when matching tokens

* update gtest to install gmock as well

* update gtest

* add default version for gtest

* lower gtest for min cmake compat test

* fix typo

* find gtest package is now config

* add back install for lcov

* try forcing install on

* debug print cmake cache file from gtest

* try install with make directly

* workaround for gtest 1.16 cmake install

* lower gtest to match cmake_min_versions

* enable picojson lint tests generation

* move negative decode tests

* linter

* explicit trait test for picojson

* lint
2026-03-17 19:48:25 -07:00

52 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install jsoncpp library with specified version
set -e # Exit on error
# Check if version is provided
if [[ -z "$1" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
echo "Usage: $0 VERSION"
echo ""
echo "Install jsoncpp library"
echo ""
echo "Arguments:"
echo " VERSION jsoncpp version to install (required)"
echo ""
echo "Examples:"
echo " $0 1.9.6"
exit 1
fi
# Configuration
JSONCPP_VERSION="$1"
INSTALL_DIR="/tmp"
BUILD_DIR="${INSTALL_DIR}/jsoncpp-${JSONCPP_VERSION}"
echo "Installing jsoncpp v${JSONCPP_VERSION}..."
# Download
echo "Downloading jsoncpp v${JSONCPP_VERSION}..."
cd "${INSTALL_DIR}"
wget -q "https://github.com/open-source-parsers/jsoncpp/archive/${JSONCPP_VERSION}.tar.gz"
# Extract
echo "Extracting archive..."
tar -zxf "${JSONCPP_VERSION}.tar.gz"
# Build and install
echo "Building and installing..."
cd "${BUILD_DIR}"
# https://github.com/open-source-parsers/jsoncpp/blob/69098a18b9af0c47549d9a271c054d13ca92b006/include/PreventInSourceBuilds.cmake#L8
mkdir -p build
cd build
cmake .. -DJSONCPP_WITH_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_OBJECT_LIBS=OFF
cmake --build .
sudo cmake --install .
# Cleanup
echo "Cleaning up..."
rm -f "${INSTALL_DIR}/${JSONCPP_VERSION}.tar.gz"
rm -rf "${BUILD_DIR}"
echo "✓ jsoncpp v${JSONCPP_VERSION} installed successfully!"