From 7ffe45d179261d652c9a696236acb2eb0b9e1bdf Mon Sep 17 00:00:00 2001 From: Fahri Ali Rahman Date: Sat, 28 Oct 2023 15:12:10 +0700 Subject: [PATCH] Remove googletest from testing utility (#255) * remove google test from testing utility * remove googletest install script --- docker/base.dockerfile | 4 --- include/nmtools/testing/testing.hpp | 22 --------------- scripts/install_gtest.sh | 43 ----------------------------- 3 files changed, 69 deletions(-) delete mode 100644 scripts/install_gtest.sh diff --git a/docker/base.dockerfile b/docker/base.dockerfile index 991ade9de..52da4dae7 100644 --- a/docker/base.dockerfile +++ b/docker/base.dockerfile @@ -13,10 +13,6 @@ RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10000 && \ update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 10000 RUN pip3 install -U gcovr -## install gtest -COPY scripts/install_gtest.sh install_gtest.sh -RUN bash install_gtest.sh - ## install benchmark COPY scripts/install_benchmark.sh install_benchmark.sh RUN bash install_benchmark.sh diff --git a/include/nmtools/testing/testing.hpp b/include/nmtools/testing/testing.hpp index 04c9873fc..a1e72af79 100644 --- a/include/nmtools/testing/testing.hpp +++ b/include/nmtools/testing/testing.hpp @@ -35,28 +35,6 @@ nmtools::utils::to_string(array) #define NMTOOLS_TESTING_OUTPUT_PRECISION 1e-6 -/** - * @brief implementation of gtest assert macro - * - */ -#define NMTOOLS_ASSERT_CLOSE_GTEST(result,expect) \ -EXPECT_TRUE(isclose(result,expect,NMTOOLS_TESTING_OUTPUT_PRECISION)) \ - << "Actual :\n" \ - << STRINGIFY(result) \ - << "\nExpected:\n" \ - << STRINGIFY(expect) \ - -/** - * @brief implementation of gtest assert macro - * - */ -#define NMTOOLS_ASSERT_EQUAL_GTEST(result,expect) \ -EXPECT_TRUE(isequal(result,expect)) \ - << "Actual :\n" \ - << STRINGIFY(result) \ - << "\nExpected:\n" \ - << STRINGIFY(expect) \ - /** * @brief implementation of typeinfo logging for doctest, * may be used by `NMTOOLS_TESTING_LOG_TYPEINFO` macro diff --git a/scripts/install_gtest.sh b/scripts/install_gtest.sh deleted file mode 100644 index 2e020b25d..000000000 --- a/scripts/install_gtest.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -CWD=$pwd -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -googletest_url="https://github.com/google/googletest/archive/release-1.10.0.tar.gz" -googletest_file="release-1.10.0.tar.gz" -googletest_dir="googletest-release-1.10.0" - -POSITIONAL=() -while [[ $# -gt 0 ]] -do -key="$1" - -case $key in - -d|--dest) - DEST="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; -esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -if [ -z "$DEST" -a "$DEST" != " " ]; then - DEST="/opt" -fi - -wget -O $DEST/$googletest_file $googletest_url - -cd $DEST -tar -zxvf $googletest_file - -cd $googletest_dir && \ - mkdir -p build && \ - cd build && \ - cmake .. && \ - make && make install - -cd $CWD \ No newline at end of file