Skip to content

Commit

Permalink
Base tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleroy committed Aug 28, 2023
1 parent 9463a75 commit 586f897
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .editorconfig

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions base/array_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "base/array.hpp"

#include <memory>
#include <string>

#include "gmock/gmock.h"
Expand Down
7 changes: 6 additions & 1 deletion base/base32768_test.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#include "base/base32768.hpp"

#include <array>
#include <cstdint>
#include <ios>
#include <memory>
#include <ostream>
#include <random>
#include <string>
#include <vector>

#include "base/array.hpp"
#include "base/macros.hpp" // 🧙 For PRINCIPIA_COMPILER_MSVC.
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "glog/logging.h"

// Clang doesn't have a correct |std::array| yet, and we don't actually use this
// code, so let's get rid of the entire test.
Expand Down
1 change: 1 addition & 0 deletions base/base64_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "base/base64.hpp"

#include <cstdint>
#include <string>

#include "base/array.hpp"
Expand Down
5 changes: 4 additions & 1 deletion base/bundle_test.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#include "base/bundle.hpp"

#include <atomic>
#include <chrono>
#include <cstdint>
#include <thread>
#include <vector>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "testing_utilities/matchers.hpp"
#include "absl/status/status.h"

namespace principia {
namespace base {
Expand Down
1 change: 0 additions & 1 deletion base/disjoint_sets_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <vector>

#include "base/not_null.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

using ::testing::Eq;
Expand Down
1 change: 0 additions & 1 deletion base/for_all_of_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "base/for_all_of.hpp"

#include <algorithm>
#include <array>
#include <iostream>
#include <tuple>
Expand Down
3 changes: 2 additions & 1 deletion base/hexadecimal_test.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "base/hexadecimal.hpp"

#include <cstdint>
#include <memory>
#include <string>
#include <vector>

#include "base/array.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "glog/logging.h"

using ::testing::Each;
using ::testing::ElementsAre;
Expand Down
3 changes: 3 additions & 0 deletions base/jthread_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "base/jthread.hpp"

#include <ostream>
#include <thread>

#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "gtest/gtest.h"
Expand Down
2 changes: 0 additions & 2 deletions base/malloc_allocator_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "base/malloc_allocator.hpp"

#include <cstdlib>

#include "gmock/gmock.h"
#include "gtest/gtest.h"

Expand Down
1 change: 0 additions & 1 deletion base/not_null_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "base/not_null.hpp"

#include <memory>
#include <utility>
#include <string>
#include <type_traits>
#include <vector>
Expand Down
8 changes: 7 additions & 1 deletion base/pull_serializer_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "base/pull_serializer.hpp"

#include <cstring>
#include <cstdint>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <vector>

Expand All @@ -11,6 +13,10 @@
#include "gipfeli/gipfeli.h"
#include "gmock/gmock.h"
#include "serialization/physics.pb.h"
#include "serialization/geometry.pb.h"
#include "serialization/quantities.pb.h"
#include "gtest/gtest.h"
#include "glog/logging.h"

namespace principia {
namespace base {
Expand Down
7 changes: 5 additions & 2 deletions base/push_deserializer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

#include <algorithm>
#include <cstdint>
#include <cstring>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <thread>
#include <vector>

#include "base/array.hpp"
Expand All @@ -18,6 +16,11 @@
#include "gmock/gmock.h"
#include "serialization/physics.pb.h"
#include "testing_utilities/matchers.hpp"
#include "serialization/geometry.pb.h"
#include "serialization/quantities.pb.h"
#include "gtest/gtest.h"
#include "google/protobuf/message.h"
#include "glog/logging.h"

namespace principia {
namespace base {
Expand Down
5 changes: 5 additions & 0 deletions base/recurring_thread_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "base/recurring_thread.hpp"

#include <chrono>
#include <optional>
#include <thread>

#include "gtest/gtest.h"
#include "absl/status/status.h"

namespace principia {
namespace base {
Expand Down
5 changes: 4 additions & 1 deletion base/thread_pool_test.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "base/thread_pool.hpp"

#include <cstdint>
#include <future>
#include <thread>
#include <vector>

#include "absl/synchronization/mutex.h"
#include "glog/logging.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace principia {
namespace base {
Expand Down
3 changes: 2 additions & 1 deletion make_editorconfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
--project:quantities `
--project:testing_utilities `
--project:tools `
--extra:gmock/gmock.h=gmock/gmock-actions.h+gmock/gmock-matchers.h+gmock/gmock-nice-strict.h+gmock/gmock-spec-builders.h `
--extra:gipfeli/gipfeli.h=gipfeli/compression.h `
--extra:gmock/gmock.h=gmock/gmock-actions.h+gmock/gmock-matchers.h+gmock/gmock-more-matchers.h+gmock/gmock-nice-strict.h+gmock/gmock-spec-builders.h+gmock/internal/gmock-pp.h `
--extra:gtest/gtest.h=gtest/gtest-matchers.h+gtest/internal/gtest-internal.h+gtest/gtest-message.h `
--solution:.

0 comments on commit 586f897

Please sign in to comment.