Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ option(
"Build gtest with internal symbols hidden in shared libraries."
OFF)

# set(GTEST_BUILD_USING_STD_MODULE ON)
# set(CMAKE_CXX_STANDARD 23)
# set(CMAKE_CXX_EXTENSIONS OFF)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD ON)
# set(CMAKE_CXX_SCAN_FOR_MODULES ON)

# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
include(cmake/hermetic_build.cmake OPTIONAL)

Expand Down Expand Up @@ -120,7 +127,44 @@ include_directories(${gtest_build_include_dirs})
# Google Test libraries. We build them using more strict warnings than what
# are used for other targets, to ensure that gtest can be compiled by a user
# aggressive about warnings.
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)

cxx_library(gtest "${cxx_strict}"
src/gtest-all.cc
# src/gtest.cc
# src/gtest-port.cc
# src/gtest-assertion-result.cc
# src/gtest-death-test.cc
# src/gtest-filepath.cc
# src/gtest-internal-inl.h
# src/gtest-matchers.cc
# src/gtest-port.cc
# src/gtest-printers.cc
# src/gtest-test-part.cc
# src/gtest-typed-test.cc
include/gtest/gtest.h
include/gtest/gtest_pred_impl.h
include/gtest/gtest_prod.h
include/gtest/gtest-assertion-result.h
include/gtest/gtest-death-test.h
include/gtest/gtest-matchers.h
include/gtest/gtest-message.h
include/gtest/gtest-param-test.h
include/gtest/gtest-printers.h
include/gtest/gtest-spi.h
include/gtest/gtest-test-part.h
include/gtest/gtest-typed-test.h
include/gtest/internal/gtest-death-test-internal.h
include/gtest/internal/gtest-filepath.h
include/gtest/internal/gtest-internal.h
include/gtest/internal/gtest-param-util.h
include/gtest/internal/gtest-port-arch.h
include/gtest/internal/gtest-port.h
include/gtest/internal/gtest-string.h
include/gtest/internal/gtest-type-util.h
include/gtest/internal/custom/gtest.h
include/gtest/internal/custom/gtest-port.h
include/gtest/internal/custom/gtest-printers.h
)
set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION})
if(GTEST_HAS_ABSL)
target_compile_definitions(gtest PUBLIC GTEST_HAS_ABSL=1)
Expand All @@ -135,6 +179,11 @@ if(GTEST_HAS_ABSL)
re2::re2
)
endif()
if(GTEST_BUILD_USING_STD_MODULE)
message(STATUS GTEST_BUILD_USING_STD_MODULE=${GTEST_BUILD_USING_STD_MODULE})
target_compile_definitions(gtest PRIVATE GTEST_BUILD_USING_STD_MODULE)
endif()

cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
string(REPLACE ";" "$<SEMICOLON>" dirs "${gtest_build_include_dirs}")
Expand Down
12 changes: 8 additions & 4 deletions googletest/include/gtest/gtest-assertion-result.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_ASSERTION_RESULT_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_ASSERTION_RESULT_H_

#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
#endif

#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-port.h"
Expand Down
16 changes: 10 additions & 6 deletions googletest/include/gtest/gtest-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_

#include <atomic>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <atomic>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <type_traits>
#endif

#include "gtest/gtest-printers.h"
#include "gtest/internal/gtest-internal.h"
Expand Down
14 changes: 9 additions & 5 deletions googletest/include/gtest/gtest-message.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_

#include <limits>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <limits>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#endif

#include "gtest/internal/gtest-port.h"

Expand Down
10 changes: 7 additions & 3 deletions googletest/include/gtest/gtest-param-test.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ TEST_P(DerivedTest, DoesBlah) {

#endif // 0

#include <functional>
#include <iterator>
#include <utility>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <functional>
#include <iterator>
#include <utility>
#endif

#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-param-util.h" // IWYU pragma: export
Expand Down
40 changes: 24 additions & 16 deletions googletest/include/gtest/gtest-printers.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,24 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_

#include <any>
#include <functional>
#include <memory>
#include <optional>
#include <ostream> // NOLINT
#include <sstream>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <variant>
#include <vector>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <any>
#include <functional>
#include <memory>
#include <optional>
#include <ostream> // NOLINT
#include <sstream>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <variant>
#include <vector>
#endif

#ifdef GTEST_HAS_ABSL
#include "absl/strings/has_absl_stringify.h"
Expand All @@ -127,11 +131,15 @@
#include "gtest/internal/gtest-port.h"

#if GTEST_INTERNAL_HAS_STD_SPAN
#include <span> // NOLINT
#if !defined(GTEST_BUILD_USING_STD_MODULE)
#include <span> // NOLINT
#endif
#endif // GTEST_INTERNAL_HAS_STD_SPAN

#if GTEST_INTERNAL_HAS_COMPARE_LIB
#include <compare> // NOLINT
#if !defined(GTEST_BUILD_USING_STD_MODULE)
#include <compare> // NOLINT
#endif
#endif // GTEST_INTERNAL_HAS_COMPARE_LIB

namespace testing {
Expand Down
6 changes: 5 additions & 1 deletion googletest/include/gtest/gtest-spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_

#include <string>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <string>
#endif

#include "gtest/gtest.h"

Expand Down
12 changes: 8 additions & 4 deletions googletest/include/gtest/gtest-test-part.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_

#include <iosfwd>
#include <ostream>
#include <string>
#include <vector>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <iosfwd>
#include <ostream>
#include <string>
#include <vector>
#endif

#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
Expand Down
24 changes: 14 additions & 10 deletions googletest/include/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,20 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_H_
#define GOOGLETEST_INCLUDE_GTEST_GTEST_H_

#include <cstddef>
#include <cstdint>
#include <limits>
#include <memory>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <cstddef>
#include <cstdint>
#include <limits>
#include <memory>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#endif

#include "gtest/gtest-assertion-result.h" // IWYU pragma: export
#include "gtest/gtest-death-test.h" // IWYU pragma: export
Expand Down
8 changes: 6 additions & 2 deletions googletest/include/gtest/internal/gtest-death-test-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@

#include <stdio.h>

#include <memory>
#include <string>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <memory>
#include <string>
#endif

#include "gtest/gtest-matchers.h"
#include "gtest/internal/gtest-internal.h"
Expand Down
8 changes: 6 additions & 2 deletions googletest/include/gtest/internal/gtest-filepath.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_

#include <string>
#include <utility>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <string>
#include <utility>
#endif

#include "gtest/internal/gtest-port.h"
#include "gtest/internal/gtest-string.h"
Expand Down
31 changes: 18 additions & 13 deletions googletest/include/gtest/internal/gtest-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,28 @@
#include <unistd.h>
#endif // GTEST_OS_LINUX

#if GTEST_HAS_EXCEPTIONS
#include <stdexcept>
#endif

#include <ctype.h>
#include <float.h>
#include <string.h>

#include <cstdint>
#include <functional>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#if GTEST_HAS_EXCEPTIONS
#include <stdexcept>
#endif

#include <cstdint>
#include <functional>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#endif


#include "gtest/gtest-message.h"
#include "gtest/internal/gtest-filepath.h"
Expand Down
34 changes: 19 additions & 15 deletions googletest/include/gtest/internal/gtest-param-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@
#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

#include <ctype.h>

#include <cassert>
#include <functional>
#include <iterator>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
#if defined(GTEST_BUILD_USING_STD_MODULE)
import std;
#else
#include <ctype.h>

#include <cassert>
#include <functional>
#include <iterator>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <utility>
#include <vector>
#endif

#include "gtest/gtest-printers.h"
#include "gtest/gtest-test-part.h"
Expand Down
Loading