Skip to content

Commit

Permalink
pw_{kvs,libc,log}: Use unit test framework
Browse files Browse the repository at this point in the history
Include pw_unit_test/framework.h instead of gtest/gtest.h as the facade
for unit tests.

Change-Id: I0a13edff3451ffaa138814599c3e31a694034c56
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/183307
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
  • Loading branch information
ChinchillaWithGoggles authored and CQ Bot Account committed Dec 7, 2023
1 parent 9586deb commit 2430362
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pw_kvs/alignment_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <cstring>
#include <string_view>

#include "gtest/gtest.h"
#include "pw_status/status_with_size.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/checksum_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "pw_kvs/checksum.h"

#include "gtest/gtest.h"
#include "pw_kvs/crc16_checksum.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/converts_to_span_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <string_view>
#include <vector>

#include "gtest/gtest.h"
#include "pw_kvs/internal/span_traits.h"
#include "pw_span/span.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/entry_cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

#include "pw_kvs/internal/entry_cache.h"

#include "gtest/gtest.h"
#include "pw_bytes/array.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/flash_memory.h"
#include "pw_kvs/internal/hash.h"
#include "pw_kvs/internal/key_descriptor.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs::internal {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/entry_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <string_view>

#include "gtest/gtest.h"
#include "pw_bytes/array.h"
#include "pw_kvs/alignment.h"
#include "pw_kvs/checksum.h"
Expand All @@ -25,6 +24,7 @@
#include "pw_kvs/flash_memory.h"
#include "pw_kvs/format.h"
#include "pw_span/span.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs::internal {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/flash_partition_stream_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#include <cstddef>
#include <cstring>

#include "gtest/gtest.h"
#include "public/pw_kvs/flash_memory.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/flash_memory.h"
#include "pw_kvs_private/config.h"
#include "pw_log/log.h"
#include "pw_random/xor_shift.h"
#include "pw_span/span.h"
#include "pw_unit_test/framework.h"

#if PW_CXX_STANDARD_IS_SUPPORTED(17)

Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/flash_partition_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

#include <algorithm>

#include "gtest/gtest.h"
#include "pw_kvs/flash_memory.h"
#include "pw_kvs/flash_test_partition.h"
#include "pw_kvs_private/config.h"
#include "pw_log/log.h"
#include "pw_span/span.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs::PartitionTest {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <string_view>

#include "gtest/gtest.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {

Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_binary_format_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

#include <string_view>

#include "gtest/gtest.h"
#include "pw_bytes/array.h"
#include "pw_kvs/crc16_checksum.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/format.h"
#include "pw_kvs/internal/hash.h"
#include "pw_kvs/key_value_store.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <array>
#include <cstring>

#include "gtest/gtest.h"
#include "pw_checksum/crc16_ccitt.h"
#include "pw_kvs/crc16_checksum.h"
#include "pw_kvs/flash_memory.h"
Expand All @@ -26,6 +25,7 @@
#include "pw_span/span.h"
#include "pw_status/status.h"
#include "pw_string/string_builder.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_initialized_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <cstdio>
#include <cstring>

#include "gtest/gtest.h"
#include "pw_assert/check.h"
#include "pw_bytes/array.h"
#include "pw_checksum/crc16_ccitt.h"
Expand All @@ -29,6 +28,7 @@
#include "pw_span/span.h"
#include "pw_status/status.h"
#include "pw_string/string_builder.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_map_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
#include <iostream>
#endif // DUMP_KVS_CONTENTS

#include "gtest/gtest.h"
#include "pw_kvs/crc16_checksum.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/flash_partition_with_stats.h"
#include "pw_kvs/internal/entry.h"
#include "pw_kvs/key_value_store.h"
#include "pw_log/log.h"
#include "pw_string/string_builder.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_put_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// License for the specific language governing permissions and limitations under
// the License.

#include "gtest/gtest.h"
#include "pw_assert/check.h"
#include "pw_kvs/crc16_checksum.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/flash_partition_with_stats.h"
#include "pw_kvs/key_value_store.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <vector>
#endif // DUMP_KVS_STATE_TO_FILE

#include "gtest/gtest.h"
#include "pw_assert/check.h"
#include "pw_bytes/array.h"
#include "pw_checksum/crc16_ccitt.h"
Expand All @@ -39,6 +38,7 @@
#include "pw_log/log.h"
#include "pw_status/status.h"
#include "pw_string/string_builder.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/key_value_store_wear_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
// Always use stats, these tests depend on it.
#define PW_KVS_RECORD_PARTITION_STATS 1

#include "gtest/gtest.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_kvs/flash_memory.h"
#include "pw_kvs/flash_partition_with_stats.h"
#include "pw_kvs/key_value_store.h"
#include "pw_log/log.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/sectors_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "pw_kvs/internal/sectors.h"

#include "gtest/gtest.h"
#include "pw_kvs/fake_flash_memory.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs::internal {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_kvs/test_key_value_store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

#include "pw_kvs/test_key_value_store.h"

#include "gtest/gtest.h"
#include "pw_kvs/key_value_store.h"
#include "pw_status/status.h"
#include "pw_sync/borrow.h"
#include "pw_unit_test/framework.h"

namespace pw::kvs {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_libc/memset_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <cstring>
#include <numeric>

#include "gtest/gtest.h"
#include "pw_containers/algorithm.h"
#include "pw_unit_test/framework.h"

namespace pw {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log/basic_log_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "pw_log/shorter.h"
// clang-format on

#include "gtest/gtest.h"
#include "pw_unit_test/framework.h"

// TODO: b/235291136 - Test unsigned integer logging (32 and 64 bit); test
// pointer logging.
Expand Down
2 changes: 1 addition & 1 deletion pw_log/glog_adapter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "pw_log/glog_adapter.h"

#include "gtest/gtest.h"
#include "pw_unit_test/framework.h"
// clang-format on

namespace pw::log {
Expand Down
2 changes: 1 addition & 1 deletion pw_log/proto_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#include "pw_log/proto_utils.h"

#include "gtest/gtest.h"
#include "pw_bytes/span.h"
#include "pw_containers/algorithm.h"
#include "pw_log/levels.h"
#include "pw_log/proto/log.pwpb.h"
#include "pw_protobuf/bytes_utils.h"
#include "pw_protobuf/decoder.h"
#include "pw_unit_test/framework.h"

namespace pw::log {

Expand Down
2 changes: 1 addition & 1 deletion pw_log_null/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// License for the specific language governing permissions and limitations under
// the License.

#include "gtest/gtest.h"
#include "pw_log_null/log_null.h"
#include "pw_unit_test/framework.h"

#define PW_LOG_MODULE_NAME "this test!"

Expand Down
2 changes: 1 addition & 1 deletion pw_log_rpc/log_filter_service_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cstdint>
#include <limits>

#include "gtest/gtest.h"
#include "pw_bytes/endian.h"
#include "pw_log/proto/log.pwpb.h"
#include "pw_log_rpc/log_filter.h"
Expand All @@ -28,6 +27,7 @@
#include "pw_result/result.h"
#include "pw_rpc/channel.h"
#include "pw_rpc/raw/test_method_context.h"
#include "pw_unit_test/framework.h"

namespace pw::log_rpc {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_rpc/log_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cstddef>
#include <cstring>

#include "gtest/gtest.h"
#include "pw_bytes/endian.h"
#include "pw_log/levels.h"
#include "pw_log/log.h"
Expand All @@ -29,6 +28,7 @@
#include "pw_result/result.h"
#include "pw_status/status.h"
#include "pw_status/try.h"
#include "pw_unit_test/framework.h"

namespace pw::log_rpc {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_rpc/log_service_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cstdint>
#include <limits>

#include "gtest/gtest.h"
#include "pw_assert/check.h"
#include "pw_bytes/endian.h"
#include "pw_containers/vector.h"
Expand All @@ -35,6 +34,7 @@
#include "pw_rpc/raw/fake_channel_output.h"
#include "pw_rpc/raw/test_method_context.h"
#include "pw_sync/mutex.h"
#include "pw_unit_test/framework.h"

namespace pw::log_rpc {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_rpc/rpc_log_drain_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cstdint>
#include <string_view>

#include "gtest/gtest.h"
#include "pw_bytes/array.h"
#include "pw_bytes/span.h"
#include "pw_log/proto/log.pwpb.h"
Expand All @@ -37,6 +36,7 @@
#include "pw_span/span.h"
#include "pw_status/status.h"
#include "pw_sync/mutex.h"
#include "pw_unit_test/framework.h"

namespace pw::log_rpc {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_rpc/test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

#include <cstdint>

#include "gtest/gtest.h"
#include "pw_bytes/span.h"
#include "pw_containers/vector.h"
#include "pw_log/log.h"
#include "pw_log/proto/log.pwpb.h"
#include "pw_log_tokenized/metadata.h"
#include "pw_protobuf/bytes_utils.h"
#include "pw_protobuf/decoder.h"
#include "pw_unit_test/framework.h"

namespace pw::log_rpc {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_tokenized/log_tokenized_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

#include "pw_log_tokenized/log_tokenized.h"

#include "gtest/gtest.h"
#include "pw_log_tokenized/base64.h"
#include "pw_log_tokenized_private/test_utils.h"
#include "pw_unit_test/framework.h"

namespace pw::log_tokenized {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion pw_log_tokenized/metadata_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "pw_log_tokenized/metadata.h"

#include "gtest/gtest.h"
#include "pw_unit_test/framework.h"

namespace pw::log_tokenized {
namespace {
Expand Down

0 comments on commit 2430362

Please sign in to comment.