diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 5b9bfe6..0000000 --- a/.clang-format +++ /dev/null @@ -1,4 +0,0 @@ -# Run manually to reformat a file: -# clang-format -i --style=file -Language: Cpp -BasedOnStyle: Google diff --git a/.github/ISSUE_TEMPLATE/00-bug_report.yml b/.github/ISSUE_TEMPLATE/00-bug_report.yml deleted file mode 100644 index 586779a..0000000 --- a/.github/ISSUE_TEMPLATE/00-bug_report.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Bug Report -description: Let us know that something does not work as expected. -title: "[Bug]: Please title this bug report" -body: - - type: textarea - id: what-happened - attributes: - label: Describe the issue - description: What happened, and what did you expect to happen? - validations: - required: true - - type: textarea - id: steps - attributes: - label: Steps to reproduce the problem - description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful. - validations: - required: true - - type: textarea - id: version - attributes: - label: What version of GoogleTest are you using? - description: Please include the output of `git rev-parse HEAD` or the GoogleTest release version number that you are using. - validations: - required: true - - type: textarea - id: os - attributes: - label: What operating system and version are you using? - description: If you are using a Linux distribution please include the name and version of the distribution as well. - validations: - required: true - - type: textarea - id: compiler - attributes: - label: What compiler and version are you using? - description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler. - validations: - required: true - - type: textarea - id: buildsystem - attributes: - label: What build system are you using? - description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system. - validations: - required: true - - type: textarea - id: additional - attributes: - label: Additional context - description: Add any other context about the problem here. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/10-feature_request.yml b/.github/ISSUE_TEMPLATE/10-feature_request.yml deleted file mode 100644 index 91ad041..0000000 --- a/.github/ISSUE_TEMPLATE/10-feature_request.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Feature request -description: Propose a new feature. -title: "[FR]: Please title this feature request" -labels: "enhancement" -body: - - type: textarea - id: version - attributes: - label: Does the feature exist in the most recent commit? - description: We recommend using the latest commit from GitHub in your projects. - validations: - required: true - - type: textarea - id: why - attributes: - label: Why do we need this feature? - description: Ideally, explain why a combination of existing features cannot be used instead. - validations: - required: true - - type: textarea - id: proposal - attributes: - label: Describe the proposal. - description: Include a detailed description of the feature, with usage examples. - validations: - required: true - - type: textarea - id: platform - attributes: - label: Is the feature specific to an operating system, compiler, or build system version? - description: If it is, please specify which versions. - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 65170d1..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Get Help - url: https://github.com/google/googletest/discussions - about: Please ask and answer questions here. diff --git a/.github/workflows/gtest-ci.yml b/.github/workflows/gtest-ci.yml deleted file mode 100644 index 03a8cc5..0000000 --- a/.github/workflows/gtest-ci.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: ci - -on: - push: - pull_request: - -env: - BAZEL_CXXOPTS: -std=c++14 - -jobs: - Linux: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... - - macOS: - runs-on: macos-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... - - - Windows: - runs-on: windows-latest - steps: - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Tests - run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ... diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f08cb72..0000000 --- a/.gitignore +++ /dev/null @@ -1,84 +0,0 @@ -# Ignore CI build directory -build/ -xcuserdata -cmake-build-debug/ -.idea/ -bazel-bin -bazel-genfiles -bazel-googletest -bazel-out -bazel-testlogs -# python -*.pyc - -# Visual Studio files -.vs -*.sdf -*.opensdf -*.VC.opendb -*.suo -*.user -_ReSharper.Caches/ -Win32-Debug/ -Win32-Release/ -x64-Debug/ -x64-Release/ - -# Ignore autoconf / automake files -Makefile.in -aclocal.m4 -configure -build-aux/ -autom4te.cache/ -googletest/m4/libtool.m4 -googletest/m4/ltoptions.m4 -googletest/m4/ltsugar.m4 -googletest/m4/ltversion.m4 -googletest/m4/lt~obsolete.m4 -googlemock/m4 - -# Ignore generated directories. -googlemock/fused-src/ -googletest/fused-src/ - -# macOS files -.DS_Store -googletest/.DS_Store -googletest/xcode/.DS_Store - -# Ignore cmake generated directories and files. -CMakeFiles -CTestTestfile.cmake -Makefile -cmake_install.cmake -googlemock/CMakeFiles -googlemock/CTestTestfile.cmake -googlemock/Makefile -googlemock/cmake_install.cmake -googlemock/gtest -/bin -/googlemock/gmock.dir -/googlemock/gmock_main.dir -/googlemock/RUN_TESTS.vcxproj.filters -/googlemock/RUN_TESTS.vcxproj -/googlemock/INSTALL.vcxproj.filters -/googlemock/INSTALL.vcxproj -/googlemock/gmock_main.vcxproj.filters -/googlemock/gmock_main.vcxproj -/googlemock/gmock.vcxproj.filters -/googlemock/gmock.vcxproj -/googlemock/gmock.sln -/googlemock/ALL_BUILD.vcxproj.filters -/googlemock/ALL_BUILD.vcxproj -/lib -/Win32 -/ZERO_CHECK.vcxproj.filters -/ZERO_CHECK.vcxproj -/RUN_TESTS.vcxproj.filters -/RUN_TESTS.vcxproj -/INSTALL.vcxproj.filters -/INSTALL.vcxproj -/googletest-distribution.sln -/CMakeCache.txt -/ALL_BUILD.vcxproj.filters -/ALL_BUILD.vcxproj diff --git a/lib/cmake/GTest/GTestConfig.cmake b/lib/cmake/GTest/GTestConfig.cmake new file mode 100644 index 0000000..771cb7e --- /dev/null +++ b/lib/cmake/GTest/GTestConfig.cmake @@ -0,0 +1,33 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was Config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### +include(CMakeFindDependencyMacro) +if (ON) + set(THREADS_PREFER_PTHREAD_FLAG ) + find_dependency(Threads) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake") +check_required_components("") diff --git a/lib/cmake/GTest/GTestConfigVersion.cmake b/lib/cmake/GTest/GTestConfigVersion.cmake new file mode 100644 index 0000000..d750e0c --- /dev/null +++ b/lib/cmake/GTest/GTestConfigVersion.cmake @@ -0,0 +1,43 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "1.13.0") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/lib/cmake/GTest/GTestTargets-noconfig.cmake b/lib/cmake/GTest/GTestTargets-noconfig.cmake new file mode 100644 index 0000000..9c24bdb --- /dev/null +++ b/lib/cmake/GTest/GTestTargets-noconfig.cmake @@ -0,0 +1,49 @@ +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "GTest::gtest" for configuration "" +set_property(TARGET GTest::gtest APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(GTest::gtest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libgtest.a" + ) + +list(APPEND _cmake_import_check_targets GTest::gtest ) +list(APPEND _cmake_import_check_files_for_GTest::gtest "${_IMPORT_PREFIX}/lib/libgtest.a" ) + +# Import target "GTest::gtest_main" for configuration "" +set_property(TARGET GTest::gtest_main APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(GTest::gtest_main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libgtest_main.a" + ) + +list(APPEND _cmake_import_check_targets GTest::gtest_main ) +list(APPEND _cmake_import_check_files_for_GTest::gtest_main "${_IMPORT_PREFIX}/lib/libgtest_main.a" ) + +# Import target "GTest::gmock" for configuration "" +set_property(TARGET GTest::gmock APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(GTest::gmock PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libgmock.a" + ) + +list(APPEND _cmake_import_check_targets GTest::gmock ) +list(APPEND _cmake_import_check_files_for_GTest::gmock "${_IMPORT_PREFIX}/lib/libgmock.a" ) + +# Import target "GTest::gmock_main" for configuration "" +set_property(TARGET GTest::gmock_main APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(GTest::gmock_main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libgmock_main.a" + ) + +list(APPEND _cmake_import_check_targets GTest::gmock_main ) +list(APPEND _cmake_import_check_files_for_GTest::gmock_main "${_IMPORT_PREFIX}/lib/libgmock_main.a" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/lib/cmake/GTest/GTestTargets.cmake b/lib/cmake/GTest/GTestTargets.cmake new file mode 100644 index 0000000..63d1a3c --- /dev/null +++ b/lib/cmake/GTest/GTestTargets.cmake @@ -0,0 +1,139 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.3") + message(FATAL_ERROR "CMake >= 2.8.3 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.3...3.24) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target GTest::gtest +add_library(GTest::gtest STATIC IMPORTED) + +set_target_properties(GTest::gtest PROPERTIES + INTERFACE_COMPILE_FEATURES "cxx_std_14" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target GTest::gtest_main +add_library(GTest::gtest_main STATIC IMPORTED) + +set_target_properties(GTest::gtest_main PROPERTIES + INTERFACE_COMPILE_FEATURES "cxx_std_14" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads;GTest::gtest" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target GTest::gmock +add_library(GTest::gmock STATIC IMPORTED) + +set_target_properties(GTest::gmock PROPERTIES + INTERFACE_COMPILE_FEATURES "cxx_std_14" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads;GTest::gtest" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target GTest::gmock_main +add_library(GTest::gmock_main STATIC IMPORTED) + +set_target_properties(GTest::gmock_main PROPERTIES + INTERFACE_COMPILE_FEATURES "cxx_std_14" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "Threads::Threads;GTest::gmock" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") +endif() + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/GTestTargets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/lib/libgmock.a b/lib/libgmock.a new file mode 100644 index 0000000..82cb0e8 Binary files /dev/null and b/lib/libgmock.a differ diff --git a/lib/libgmock_main.a b/lib/libgmock_main.a new file mode 100644 index 0000000..d00a4ee Binary files /dev/null and b/lib/libgmock_main.a differ diff --git a/lib/libgtest.a b/lib/libgtest.a new file mode 100644 index 0000000..c508f17 Binary files /dev/null and b/lib/libgtest.a differ diff --git a/lib/libgtest_main.a b/lib/libgtest_main.a new file mode 100644 index 0000000..0e5b4d0 Binary files /dev/null and b/lib/libgtest_main.a differ diff --git a/lib/pkgconfig/gmock.pc b/lib/pkgconfig/gmock.pc new file mode 100644 index 0000000..bf56444 --- /dev/null +++ b/lib/pkgconfig/gmock.pc @@ -0,0 +1,10 @@ +libdir=/Users/yaha/Code/flyaha/third_party/googletest/output/lib +includedir=/Users/yaha/Code/flyaha/third_party/googletest/output/include + +Name: gmock +Description: GoogleMock (without main() function) +Version: 1.13.0 +URL: https://github.com/google/googletest +Requires: gtest = 1.13.0 +Libs: -L${libdir} -lgmock +Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 diff --git a/lib/pkgconfig/gmock_main.pc b/lib/pkgconfig/gmock_main.pc new file mode 100644 index 0000000..9f0313a --- /dev/null +++ b/lib/pkgconfig/gmock_main.pc @@ -0,0 +1,10 @@ +libdir=/Users/yaha/Code/flyaha/third_party/googletest/output/lib +includedir=/Users/yaha/Code/flyaha/third_party/googletest/output/include + +Name: gmock_main +Description: GoogleMock (with main() function) +Version: 1.13.0 +URL: https://github.com/google/googletest +Requires: gmock = 1.13.0 +Libs: -L${libdir} -lgmock_main +Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 diff --git a/lib/pkgconfig/gtest.pc b/lib/pkgconfig/gtest.pc new file mode 100644 index 0000000..7b86ded --- /dev/null +++ b/lib/pkgconfig/gtest.pc @@ -0,0 +1,9 @@ +libdir=/Users/yaha/Code/flyaha/third_party/googletest/output/lib +includedir=/Users/yaha/Code/flyaha/third_party/googletest/output/include + +Name: gtest +Description: GoogleTest (without main() function) +Version: 1.13.0 +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgtest +Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 diff --git a/lib/pkgconfig/gtest_main.pc b/lib/pkgconfig/gtest_main.pc new file mode 100644 index 0000000..c871e2e --- /dev/null +++ b/lib/pkgconfig/gtest_main.pc @@ -0,0 +1,10 @@ +libdir=/Users/yaha/Code/flyaha/third_party/googletest/output/lib +includedir=/Users/yaha/Code/flyaha/third_party/googletest/output/include + +Name: gtest_main +Description: GoogleTest (with main() function) +Version: 1.13.0 +URL: https://github.com/google/googletest +Requires: gtest = 1.13.0 +Libs: -L${libdir} -lgtest_main +Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1