From 447459b33aef5cce5fc28db65dfc0bf37b238e2e Mon Sep 17 00:00:00 2001 From: kishanps Date: Fri, 19 Dec 2025 20:56:23 +0000 Subject: [PATCH] [comb] Make pins depend on github.com/google/gutil. Signed-off-by: Bibhuprasad Singh Signed-off-by: bibhuprasad-hcl --- WORKSPACE.bazel | 6 + dvaas/BUILD.bazel | 137 +++---- dvaas/arriba_test_vector_validation.cc | 6 +- dvaas/dataplane_validation.cc | 12 +- dvaas/dataplane_validation.h | 2 +- dvaas/dataplane_validation_test.cc | 6 +- dvaas/dvaas_detective.cc | 6 +- dvaas/dvaas_detective_test.cc | 6 +- dvaas/failure_post_processing.cc | 2 +- dvaas/failure_post_processing_test.cc | 8 +- dvaas/label.cc | 2 +- dvaas/labeler.cc | 2 +- dvaas/labeler_test.cc | 4 +- dvaas/mirror_testbed_config.cc | 6 +- dvaas/packet_injection.cc | 2 +- dvaas/packet_trace.cc | 6 +- dvaas/packet_trace.h | 3 +- dvaas/packet_trace_test.cc | 6 +- dvaas/port_id_map.cc | 4 +- dvaas/port_id_map.h | 2 +- dvaas/port_id_map_test.cc | 2 +- dvaas/test_insights.cc | 4 +- dvaas/test_insights_test.cc | 6 +- dvaas/test_run_validation.cc | 8 +- dvaas/test_run_validation_test.cc | 6 +- dvaas/test_run_validation_test_runner.cc | 2 +- dvaas/test_vector.cc | 4 +- dvaas/test_vector_stats_test.cc | 2 +- dvaas/test_vector_test.cc | 6 +- dvaas/thinkit_tests/BUILD.bazel | 2 +- dvaas/thinkit_tests/dvaas_regression_test.cc | 2 +- dvaas/traffic_generator.cc | 6 +- dvaas/user_provided_packet_test_vector.cc | 4 +- .../user_provided_packet_test_vector_test.cc | 10 +- dvaas/validation_result.cc | 2 +- dvaas/validation_result_test.cc | 8 +- gutil/gutil/BUILD.bazel | 349 ------------------ gutil/gutil/assign_or_return.md | 318 ---------------- gutil/gutil/collections.h | 169 --------- gutil/gutil/collections_test.cc | 77 ---- gutil/gutil/embed_data/BUILD.bazel | 31 -- .../embed_data/generate_cc_embed_data_main.cc | 197 ---------- gutil/gutil/io.cc | 92 ----- gutil/gutil/io.h | 38 -- gutil/gutil/io_test.cc | 63 ---- gutil/gutil/overload.h | 36 -- gutil/gutil/proto.cc | 187 ---------- gutil/gutil/proto.h | 127 ------- gutil/gutil/proto_matchers.h | 257 ------------- gutil/gutil/proto_matchers_test.cc | 214 ----------- gutil/gutil/proto_ordering.cc | 27 -- gutil/gutil/proto_ordering.h | 85 ----- gutil/gutil/proto_ordering_test.cc | 195 ---------- gutil/gutil/proto_string_error_collector.h | 56 --- gutil/gutil/proto_test.cc | 241 ------------ gutil/gutil/proto_test.proto | 24 -- gutil/gutil/status.cc | 71 ---- gutil/gutil/status.h | 348 ----------------- gutil/gutil/status_matchers.h | 146 -------- gutil/gutil/status_matchers_test.cc | 117 ------ gutil/gutil/syslog_sink.cc | 65 ---- gutil/gutil/syslog_sink.h | 47 --- gutil/gutil/test_artifact_writer.cc | 160 -------- gutil/gutil/test_artifact_writer.h | 86 ----- gutil/gutil/test_artifact_writer_test.cc | 167 --------- gutil/gutil/test_artifact_writer_test.proto | 22 -- gutil/gutil/testing.cc | 45 --- gutil/gutil/testing.h | 54 --- gutil/gutil/testing_test.cc | 47 --- gutil/gutil/timer.h | 47 --- gutil/gutil/timer_test.cc | 54 --- gutil/gutil/version.cc | 87 ----- gutil/gutil/version.h | 78 ---- gutil/gutil/version_test.cc | 102 ----- lib/BUILD.bazel | 26 +- lib/basic_switch_test.cc | 2 +- lib/basic_traffic/BUILD.bazel | 14 +- lib/basic_traffic/basic_p4rt_util.cc | 4 +- lib/basic_traffic/basic_p4rt_util_test.cc | 4 +- lib/basic_traffic/basic_traffic.cc | 4 +- lib/basic_traffic/basic_traffic_test.cc | 8 +- lib/gnmi/BUILD.bazel | 12 +- lib/gnmi/gnmi_helper.cc | 6 +- lib/gnmi/gnmi_helper_test.cc | 6 +- lib/gnoi/BUILD.bazel | 6 +- lib/gnoi/gnoi_helper.cc | 2 +- lib/gnoi/gnoi_helper_test.cc | 4 +- lib/ixia_helper.cc | 8 +- lib/ixia_helper_test.cc | 6 +- lib/ixia_protocol_helper.cc | 2 +- lib/ixia_protocol_helper_test.cc | 2 +- lib/lacp_ixia_helper.cc | 4 +- lib/lacp_ixia_helper_test.cc | 2 +- lib/p4rt/BUILD.bazel | 12 +- lib/p4rt/p4rt_port.cc | 2 +- lib/p4rt/p4rt_port_test.cc | 2 +- lib/p4rt/p4rt_programming_context.cc | 2 +- lib/p4rt/p4rt_programming_context_test.cc | 6 +- lib/p4rt/packet_listener.cc | 4 +- lib/pins_control_device.cc | 4 +- lib/ssh/BUILD.bazel | 2 +- lib/ssh/ssh_wrapper_client.cc | 2 +- lib/utils/BUILD.bazel | 14 +- lib/utils/generic_testbed_utils.cc | 2 +- lib/utils/generic_testbed_utils_test.cc | 6 +- lib/utils/json_utils.cc | 2 +- lib/utils/json_utils_test.cc | 2 +- lib/utils/merging_status_bundle_test.cc | 2 +- lib/validator/BUILD.bazel | 12 +- lib/validator/config_validator.cc | 2 +- lib/validator/config_validator_test.cc | 6 +- lib/validator/validator_backend_test.cc | 2 +- lib/validator/validator_lib.cc | 2 +- lib/validator/validator_lib_test.cc | 2 +- p4_fuzzer/BUILD.bazel | 64 ++-- p4_fuzzer/annotation_util.cc | 2 +- p4_fuzzer/constraints.cc | 4 +- p4_fuzzer/constraints_test.cc | 10 +- p4_fuzzer/fuzz_util.cc | 6 +- p4_fuzzer/fuzz_util_test.cc | 10 +- p4_fuzzer/fuzzer_config.cc | 6 +- p4_fuzzer/fuzzer_config_test.cc | 4 +- p4_fuzzer/mutation.cc | 2 +- p4_fuzzer/oracle_util.cc | 2 +- p4_fuzzer/oracle_util.h | 2 +- p4_fuzzer/oracle_util_test.cc | 6 +- p4_fuzzer/switch_state.cc | 6 +- p4_fuzzer/switch_state.h | 2 +- ...state_assert_entry_equality_test_runner.cc | 8 +- p4_fuzzer/switch_state_test.cc | 10 +- p4_fuzzer/test_utils.cc | 2 +- p4_infra/p4_pdpi/netaddr/netaddr_files.sh | 13 + p4_pdpi/BUILD.bazel | 108 +++--- p4_pdpi/built_ins.cc | 2 +- p4_pdpi/built_ins_test.cc | 2 +- p4_pdpi/entity_keys.cc | 2 +- p4_pdpi/entity_keys.h | 2 +- p4_pdpi/entity_keys_test.cc | 4 +- p4_pdpi/ir.cc | 6 +- p4_pdpi/ir_properties_test.cc | 2 +- p4_pdpi/ir_to_ir_test.cc | 6 +- p4_pdpi/ir_tools.cc | 4 +- p4_pdpi/ir_tools_test.cc | 10 +- p4_pdpi/names.cc | 4 +- p4_pdpi/names_test.cc | 4 +- p4_pdpi/netaddr/BUILD.bazel | 20 +- p4_pdpi/netaddr/ipv4_address.cc | 2 +- .../ipv4_address_and_network_address_test.cc | 4 +- p4_pdpi/netaddr/ipv6_address.cc | 2 +- p4_pdpi/netaddr/ipv6_address_test.cc | 4 +- p4_pdpi/netaddr/mac_address.cc | 2 +- p4_pdpi/netaddr/mac_address_test.cc | 4 +- p4_pdpi/netaddr/network_address.h | 2 +- p4_pdpi/p4_runtime_matchers.h | 2 +- p4_pdpi/p4_runtime_matchers_test.cc | 4 +- p4_pdpi/p4_runtime_session.cc | 8 +- p4_pdpi/p4_runtime_session.h | 2 +- p4_pdpi/p4_runtime_session_extras.cc | 4 +- p4_pdpi/p4_runtime_session_extras.h | 4 +- p4_pdpi/p4_runtime_session_test.cc | 6 +- p4_pdpi/p4info_union.cc | 2 +- p4_pdpi/p4info_union_lib.cc | 4 +- p4_pdpi/p4info_union_test.cc | 6 +- p4_pdpi/packetlib/BUILD.bazel | 30 +- p4_pdpi/packetlib/packetlib.cc | 6 +- p4_pdpi/packetlib/packetlib_debugging_test.cc | 4 +- p4_pdpi/packetlib/packetlib_fuzzer_test.cc | 4 +- p4_pdpi/packetlib/packetlib_matchers.h | 2 +- p4_pdpi/packetlib/packetlib_matchers_test.cc | 2 +- p4_pdpi/packetlib/packetlib_test_runner.cc | 6 +- p4_pdpi/packetlib/packetlib_unit_test.cc | 6 +- p4_pdpi/pd.cc | 6 +- p4_pdpi/pd.h | 2 +- p4_pdpi/pdgen.cc | 4 +- p4_pdpi/pdgenlib.cc | 4 +- p4_pdpi/pdgenlib.h | 2 +- p4_pdpi/pi.cc | 4 +- p4_pdpi/reference_annotations.cc | 4 +- p4_pdpi/reference_annotations_test.cc | 6 +- p4_pdpi/references.cc | 6 +- p4_pdpi/sequencing.cc | 4 +- p4_pdpi/sequencing_util.cc | 4 +- p4_pdpi/string_encodings/BUILD.bazel | 22 +- p4_pdpi/string_encodings/bit_string.cc | 2 +- p4_pdpi/string_encodings/bit_string_test.cc | 2 +- p4_pdpi/string_encodings/byte_string.h | 2 +- p4_pdpi/string_encodings/byte_string_test.cc | 4 +- p4_pdpi/string_encodings/decimal_string.cc | 2 +- p4_pdpi/string_encodings/hex_string.cc | 2 +- p4_pdpi/string_encodings/hex_string.h | 2 +- .../string_encodings/readable_byte_string.cc | 2 +- .../readable_byte_string_test.cc | 2 +- p4_pdpi/testing/BUILD.bazel | 56 +-- p4_pdpi/testing/helper_function_test.cc | 6 +- p4_pdpi/testing/info_test_runner.cc | 6 +- p4_pdpi/testing/packet_io_test_runner.cc | 4 +- p4_pdpi/testing/references_test_runner.cc | 6 +- p4_pdpi/testing/rpc_test_runner.cc | 6 +- p4_pdpi/testing/sequencing_test_runner.cc | 4 +- .../testing/sequencing_util_test_runner.cc | 4 +- p4_pdpi/testing/table_entry_gunit_test.cc | 8 +- p4_pdpi/testing/table_entry_test_runner.cc | 4 +- p4_pdpi/testing/test_helper.h | 6 +- p4_pdpi/utils/BUILD.bazel | 14 +- p4_pdpi/utils/annotation_parser.cc | 2 +- p4_pdpi/utils/annotation_parser.h | 2 +- p4_pdpi/utils/annotation_parser_test.cc | 2 +- p4_pdpi/utils/ir.cc | 4 +- p4_pdpi/utils/ir_test.cc | 6 +- p4_symbolic/BUILD.bazel | 10 +- p4_symbolic/bmv2/BUILD.bazel | 10 +- p4_symbolic/bmv2/bmv2.cc | 4 +- p4_symbolic/bmv2/bmv2.h | 2 +- p4_symbolic/bmv2/test.cc | 6 +- p4_symbolic/ir/BUILD.bazel | 14 +- p4_symbolic/ir/cfg.cc | 2 +- p4_symbolic/ir/cfg_test.cc | 4 +- p4_symbolic/ir/ir.cc | 2 +- p4_symbolic/ir/parser.cc | 2 +- p4_symbolic/ir/table_entries.cc | 2 +- p4_symbolic/ir/test.cc | 4 +- p4_symbolic/main.cc | 4 +- p4_symbolic/packet_synthesizer/BUILD.bazel | 16 +- .../packet_synthesizer/criteria_generator.cc | 4 +- .../packet_synthesis_criteria.cc | 2 +- .../packet_synthesis_criteria_test.cc | 6 +- .../packet_synthesizer/packet_synthesizer.cc | 4 +- p4_symbolic/packet_synthesizer/util.cc | 2 +- .../packet_synthesizer/z3_model_to_packet.cc | 2 +- p4_symbolic/sai/BUILD.bazel | 28 +- p4_symbolic/sai/criteria_generator_test.cc | 6 +- p4_symbolic/sai/packet_synthesizer_test.cc | 8 +- p4_symbolic/sai/sai.cc | 4 +- p4_symbolic/sai/sai_coverage_goals.h | 2 +- p4_symbolic/sai/sai_test.cc | 8 +- p4_symbolic/symbolic/BUILD.bazel | 32 +- p4_symbolic/symbolic/action.cc | 4 +- p4_symbolic/symbolic/conditional.cc | 2 +- p4_symbolic/symbolic/control.cc | 2 +- p4_symbolic/symbolic/deparser.cc | 2 +- p4_symbolic/symbolic/deparser_test.cc | 2 +- p4_symbolic/symbolic/guarded_map.cc | 2 +- p4_symbolic/symbolic/operators.cc | 2 +- p4_symbolic/symbolic/operators.h | 2 +- p4_symbolic/symbolic/parser.cc | 2 +- p4_symbolic/symbolic/parser_test.cc | 4 +- p4_symbolic/symbolic/symbolic.cc | 2 +- p4_symbolic/symbolic/symbolic_table_entry.cc | 4 +- .../symbolic/symbolic_table_entry_test.cc | 6 +- p4_symbolic/symbolic/table.cc | 2 +- p4_symbolic/symbolic/util.cc | 2 +- p4_symbolic/symbolic/util_test.cc | 4 +- p4_symbolic/symbolic/v1model.cc | 4 +- p4_symbolic/symbolic/values.cc | 2 +- p4_symbolic/symbolic/values_test.cc | 4 +- p4_symbolic/test_util.cc | 4 +- p4_symbolic/tests/BUILD.bazel | 12 +- p4_symbolic/tests/sai_p4_integration_test.cc | 6 +- .../tests/symbolic_table_entries_test.cc | 8 +- p4_symbolic/z3_util.cc | 2 +- p4_symbolic/z3_util_test.cc | 2 +- p4rt_app/BUILD.bazel | 4 +- p4rt_app/event_monitoring/BUILD.bazel | 32 +- .../app_state_db_port_table_event_test.cc | 2 +- ...b_send_to_ingress_port_table_event_test.cc | 2 +- .../config_db_node_cfg_table_event_test.cc | 2 +- .../config_db_port_table_event.cc | 2 +- .../config_db_port_table_event_test.cc | 2 +- .../config_db_queue_table_event.cc | 2 +- .../config_db_queue_table_event_test.cc | 2 +- .../debug_data_dump_events.cc | 4 +- .../debug_data_dump_events_test.cc | 4 +- .../event_monitoring/state_event_monitor.cc | 2 +- .../state_verification_events.cc | 2 +- .../state_verification_events_test.cc | 2 +- p4rt_app/event_monitoring/warm_boot_events.cc | 2 +- .../event_monitoring/warm_boot_events_test.cc | 2 +- p4rt_app/p4rt.cc | 4 +- p4rt_app/p4runtime/BUILD.bazel | 80 ++-- p4rt_app/p4runtime/ir_translation.cc | 4 +- p4rt_app/p4runtime/ir_translation_test.cc | 4 +- p4rt_app/p4runtime/p4info_reconcile.cc | 4 +- p4rt_app/p4runtime/p4info_reconcile_test.cc | 4 +- p4rt_app/p4runtime/p4info_verification.cc | 4 +- .../p4runtime/p4info_verification_schema.cc | 6 +- .../p4info_verification_schema_test.cc | 8 +- .../p4runtime/p4info_verification_test.cc | 8 +- p4rt_app/p4runtime/p4runtime_impl.cc | 8 +- p4rt_app/p4runtime/p4runtime_read.cc | 2 +- p4rt_app/p4runtime/packetio_helpers.cc | 2 +- p4rt_app/p4runtime/packetio_helpers_test.cc | 4 +- p4rt_app/p4runtime/queue_translator.cc | 4 +- p4rt_app/p4runtime/queue_translator_test.cc | 2 +- p4rt_app/p4runtime/resource_utilization.cc | 4 +- .../p4runtime/resource_utilization_test.cc | 6 +- p4rt_app/p4runtime/sdn_controller_manager.cc | 4 +- p4rt_app/scripts/BUILD.bazel | 36 +- p4rt_app/scripts/build_schema_from_p4info.cc | 6 +- .../scripts/p4rt_hybridband_test_client.cc | 6 +- p4rt_app/scripts/p4rt_program_table.cc | 4 +- p4rt_app/scripts/p4rt_read.cc | 2 +- .../scripts/p4rt_route_measurement_test.cc | 10 +- .../scripts/p4rt_set_forwarding_pipeline.cc | 6 +- p4rt_app/scripts/p4rt_write.cc | 4 +- p4rt_app/sonic/BUILD.bazel | 74 ++-- p4rt_app/sonic/adapters/BUILD.bazel | 2 +- .../adapters/fake_sonic_db_table_test.cc | 2 +- .../sonic/app_db_acl_def_table_manager.cc | 2 +- .../app_db_acl_def_table_manager_test.cc | 2 +- p4rt_app/sonic/app_db_manager.cc | 4 +- p4rt_app/sonic/app_db_manager_test.cc | 4 +- .../sonic/app_db_to_pdpi_ir_translator.cc | 4 +- .../app_db_to_pdpi_ir_translator_test.cc | 4 +- p4rt_app/sonic/fake_packetio_interface.cc | 2 +- p4rt_app/sonic/hashing.cc | 2 +- p4rt_app/sonic/hashing_test.cc | 4 +- .../packet_replication_entry_translation.cc | 2 +- .../packet_replication_entry_translation.h | 2 +- ...cket_replication_entry_translation_test.cc | 4 +- p4rt_app/sonic/packetio_impl.cc | 4 +- p4rt_app/sonic/packetio_impl_test.cc | 2 +- p4rt_app/sonic/packetio_port.cc | 4 +- p4rt_app/sonic/packetio_port_test.cc | 2 +- p4rt_app/sonic/receive_genetlink.cc | 2 +- p4rt_app/sonic/response_handler.cc | 2 +- p4rt_app/sonic/response_handler_test.cc | 4 +- p4rt_app/sonic/state_verification.cc | 2 +- p4rt_app/sonic/state_verification_test.cc | 2 +- p4rt_app/sonic/swss_utils.cc | 2 +- p4rt_app/sonic/swss_utils_test.cc | 2 +- p4rt_app/sonic/vlan_entry_translation.cc | 2 +- p4rt_app/sonic/vlan_entry_translation_test.cc | 4 +- p4rt_app/sonic/vrf_entry_translation.cc | 2 +- p4rt_app/sonic/vrf_entry_translation.h | 2 +- p4rt_app/sonic/vrf_entry_translation_test.cc | 4 +- p4rt_app/tests/BUILD.bazel | 94 ++--- p4rt_app/tests/acl_table_test.cc | 8 +- p4rt_app/tests/action_set_test.cc | 8 +- p4rt_app/tests/api_access_test.cc | 4 +- p4rt_app/tests/arbitration_test.cc | 4 +- p4rt_app/tests/cpu_queue_name_and_id_test.cc | 4 +- p4rt_app/tests/debug_data_dump_test.cc | 2 +- p4rt_app/tests/fixed_l3_tables_test.cc | 8 +- .../tests/forwarding_pipeline_config_test.cc | 8 +- p4rt_app/tests/hashing_test.cc | 2 +- p4rt_app/tests/lib/BUILD.bazel | 4 +- .../lib/p4runtime_component_test_fixture.h | 2 +- .../tests/lib/p4runtime_request_helpers.cc | 4 +- p4rt_app/tests/p4_constraints_test_runner.cc | 4 +- p4rt_app/tests/p4_programs_test.cc | 2 +- .../tests/packet_replication_table_test.cc | 4 +- p4rt_app/tests/packetio_test.cc | 6 +- p4rt_app/tests/port_name_and_id_test.cc | 4 +- p4rt_app/tests/resource_limits_test.cc | 6 +- p4rt_app/tests/response_path_test.cc | 6 +- p4rt_app/tests/role_test.cc | 6 +- p4rt_app/tests/state_verification_test.cc | 2 +- p4rt_app/tests/utf8_validity_test.cc | 2 +- p4rt_app/tests/vrf_table_test.cc | 6 +- p4rt_app/tests/warm_restart_bootup_test.cc | 8 +- p4rt_app/utils/BUILD.bazel | 8 +- p4rt_app/utils/table_utility.cc | 2 +- p4rt_app/utils/table_utility_test.cc | 6 +- pins_infra_deps.bzl | 15 + sai_p4/BUILD.bazel | 6 +- sai_p4/capabilities_test.cc | 4 +- sai_p4/instantiations/google/BUILD.bazel | 22 +- .../instantiations/google/clos_stage_test.cc | 4 +- ..._nonstandard_platforms_config_generator.cc | 2 +- .../google/sai_nonstandard_platforms_test.cc | 2 +- .../google/sai_p4info_fetcher_test.cc | 4 +- .../instantiations/google/sai_p4info_test.cc | 6 +- .../instantiations/google/sai_pd_util_test.cc | 2 +- .../google/test_tools/BUILD.bazel | 28 +- .../test_tools/table_entry_generator.cc | 6 +- .../table_entry_generator_helper_test.cc | 4 +- .../test_tools/table_entry_generator_test.cc | 4 +- .../google/test_tools/test_entries.cc | 10 +- .../google/test_tools/test_entries_test.cc | 6 +- .../instantiations/google/tests/BUILD.bazel | 12 +- .../tests/p4_constraints_integration_test.cc | 4 +- .../tests/p4_fuzzer_integration_test.cc | 10 +- sai_p4/tools/BUILD.bazel | 22 +- .../auxiliary_entries_for_v1model_targets.cc | 6 +- ...iliary_entries_for_v1model_targets_test.cc | 6 +- sai_p4/tools/p4info_tools_test.cc | 4 +- sai_p4/tools/packetio_tools.cc | 2 +- sai_p4/tools/packetio_tools_test.cc | 4 +- tests/BUILD.bazel | 22 +- tests/forwarding/BUILD.bazel | 103 +++--- tests/forwarding/acl_feature_test.cc | 10 +- tests/forwarding/arbitration_test.cc | 6 +- tests/forwarding/arbitration_test.h | 4 +- tests/forwarding/arriba_test.cc | 4 +- .../configure_mirror_testbed_test.cc | 2 +- tests/forwarding/fuzzer_tests.cc | 8 +- tests/forwarding/group_programming_util.cc | 8 +- tests/forwarding/hash_statistics_util.cc | 4 +- tests/forwarding/hash_statistics_util_test.cc | 2 +- tests/forwarding/hash_testfixture.cc | 8 +- tests/forwarding/l3_admit_test.cc | 6 +- tests/forwarding/l3_admit_test.h | 2 +- tests/forwarding/l3_multicast_test.cc | 6 +- tests/forwarding/l3_multicast_test.h | 2 +- .../forwarding/match_action_coverage_test.cc | 10 +- .../mirror_blackbox_test_fixture.cc | 2 +- .../multicast_fallback_group_test.cc | 8 +- tests/forwarding/multistage_hash_test.cc | 4 +- tests/forwarding/ouroboros_test.cc | 6 +- tests/forwarding/p4info_push_test.cc | 4 +- tests/forwarding/smoke_test.cc | 8 +- tests/forwarding/test_data.cc | 2 +- tests/forwarding/tor_protocol_test.cc | 4 +- tests/forwarding/tunnel_decap_test.cc | 6 +- tests/forwarding/util.cc | 2 +- tests/forwarding/watch_port_test.cc | 10 +- tests/gnmi/BUILD.bazel | 24 +- tests/gnmi/counter_timestamp_test.cc | 8 +- tests/gnmi/ethcounter_ixia_test.cc | 8 +- tests/gnmi/host_link_flap_tests.cc | 4 +- tests/gnmi/link_flap_tests.cc | 6 +- tests/gnmi/util.cc | 2 +- tests/gnoi/BUILD.bazel | 8 +- tests/gnoi/bert_tests.cc | 6 +- tests/gnoi/bert_tests.h | 4 +- tests/gnoi/factory_reset_test.cc | 4 +- tests/integration/system/BUILD.bazel | 32 +- .../system/alpm_miss_counter_tests.cc | 8 +- .../system/alpm_miss_counter_tests.h | 4 +- .../system/control_device_reboot_test.cc | 4 +- .../system/linerate_traffic_test.cc | 10 +- tests/integration/system/nsf/BUILD.bazel | 30 +- .../integration/system/nsf/compare_p4flows.cc | 2 +- .../system/nsf/compare_p4flows_test.cc | 4 +- .../nsf/component_validators/BUILD.bazel | 2 +- .../component_validators/p4rt_validator.cc | 2 +- .../platform_validator.cc | 3 +- .../component_validators/swss_validator.cc | 2 +- .../component_validators/xcvrd_validator.cc | 2 +- .../system/nsf/interfaces/BUILD.bazel | 2 +- .../system/nsf/interfaces/testbed.h | 2 +- .../system/nsf/nsf_acl_flow_coverage_test.cc | 2 +- ...rrent_config_push_flow_programming_test.cc | 4 +- .../nsf/nsf_dynamic_state_update_test.cc | 4 +- .../system/nsf/nsf_link_flap_test.cc | 6 +- .../system/nsf/traffic_helpers/BUILD.bazel | 2 +- .../system/nsf/traffic_helpers/otg_helper.cc | 2 +- tests/integration/system/nsf/upgrade_test.cc | 4 +- tests/integration/system/nsf/util.cc | 6 +- .../system/packet_forwarding_tests.cc | 6 +- .../system/random_blackbox_events_tests.cc | 4 +- tests/lib/BUILD.bazel | 37 +- tests/lib/common_ir_table_entries_test.cc | 2 +- tests/lib/p4info_helper.cc | 4 +- .../p4rt_fixed_table_programming_helper.cc | 4 +- ...4rt_fixed_table_programming_helper_test.cc | 6 +- tests/lib/packet_generator.cc | 4 +- tests/lib/packet_generator.h | 4 +- tests/lib/packet_generator_test.cc | 4 +- tests/lib/packet_injector_test.cc | 2 +- tests/lib/switch_test_setup_helpers.cc | 8 +- ...h_test_setup_helpers_golden_test_runner.cc | 6 +- tests/lib/switch_test_setup_helpers_test.cc | 6 +- tests/mtu_tests/BUILD.bazel | 8 +- tests/mtu_tests/mtu_tests.cc | 10 +- tests/packet_capture/packet_capture_test.cc | 4 +- tests/packet_capture/packet_capture_test.h | 2 +- .../packet_capture_test_util.cc | 3 +- tests/qos/BUILD.bazel | 52 +-- tests/qos/cpu_qos_test.cc | 14 +- tests/qos/cpu_qos_test.h | 4 +- tests/qos/frontpanel_qos_test.cc | 10 +- tests/qos/gnmi_parsers.cc | 4 +- tests/qos/gnmi_parsers_test_runner.cc | 4 +- tests/qos/pfc_test.cc | 10 +- tests/qos/punt_qos_test.cc | 8 +- tests/qos/qos_test_util.cc | 6 +- tests/sflow/BUILD.bazel | 9 +- tests/sflow/sflow_breakout_test.cc | 2 +- tests/sflow/sflow_test.cc | 8 +- tests/sflow/sflow_util.cc | 2 +- tests/sflow/sflow_util_test.cc | 4 +- tests/thinkit_gnmi_interface_tests.cc | 8 +- tests/thinkit_gnmi_interface_util.cc | 2 +- tests/thinkit_gnmi_interface_util.h | 2 +- tests/thinkit_gnmi_interface_util_tests.cc | 6 +- tests/thinkit_gnmi_subscribe_tests.cc | 2 +- tests/thinkit_sanity_tests.cc | 4 +- thinkit/BUILD.bazel | 8 +- thinkit/bazel_test_environment.cc | 2 +- thinkit/bazel_test_environment.h | 2 +- thinkit/bazel_test_environment_test.cc | 4 +- thinkit/switch_test.cc | 2 +- 493 files changed, 1590 insertions(+), 6071 deletions(-) delete mode 100644 gutil/gutil/BUILD.bazel delete mode 100644 gutil/gutil/assign_or_return.md delete mode 100644 gutil/gutil/collections.h delete mode 100644 gutil/gutil/collections_test.cc delete mode 100644 gutil/gutil/embed_data/BUILD.bazel delete mode 100644 gutil/gutil/embed_data/generate_cc_embed_data_main.cc delete mode 100644 gutil/gutil/io.cc delete mode 100644 gutil/gutil/io.h delete mode 100644 gutil/gutil/io_test.cc delete mode 100644 gutil/gutil/overload.h delete mode 100644 gutil/gutil/proto.cc delete mode 100644 gutil/gutil/proto.h delete mode 100644 gutil/gutil/proto_matchers.h delete mode 100644 gutil/gutil/proto_matchers_test.cc delete mode 100644 gutil/gutil/proto_ordering.cc delete mode 100644 gutil/gutil/proto_ordering.h delete mode 100644 gutil/gutil/proto_ordering_test.cc delete mode 100644 gutil/gutil/proto_string_error_collector.h delete mode 100644 gutil/gutil/proto_test.cc delete mode 100644 gutil/gutil/proto_test.proto delete mode 100644 gutil/gutil/status.cc delete mode 100644 gutil/gutil/status.h delete mode 100644 gutil/gutil/status_matchers.h delete mode 100644 gutil/gutil/status_matchers_test.cc delete mode 100644 gutil/gutil/syslog_sink.cc delete mode 100644 gutil/gutil/syslog_sink.h delete mode 100644 gutil/gutil/test_artifact_writer.cc delete mode 100644 gutil/gutil/test_artifact_writer.h delete mode 100644 gutil/gutil/test_artifact_writer_test.cc delete mode 100644 gutil/gutil/test_artifact_writer_test.proto delete mode 100644 gutil/gutil/testing.cc delete mode 100644 gutil/gutil/testing.h delete mode 100644 gutil/gutil/testing_test.cc delete mode 100644 gutil/gutil/timer.h delete mode 100644 gutil/gutil/timer_test.cc delete mode 100644 gutil/gutil/version.cc delete mode 100644 gutil/gutil/version.h delete mode 100644 gutil/gutil/version_test.cc create mode 100755 p4_infra/p4_pdpi/netaddr/netaddr_files.sh diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 431c63c53..0304e640e 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -107,6 +107,12 @@ rules_proto_grpc_toolchains() rules_proto_grpc_repos() +# -- Load GUtil ----------------------------------------------------------------- + +load("@com_google_gutil//:gutil_deps.bzl", "gutil_deps") + +gutil_deps() + # -- Load P4Runtime ------------------------------------------------------------ load("@com_github_p4lang_p4runtime//:p4runtime_deps.bzl", "p4runtime_deps") diff --git a/dvaas/BUILD.bazel b/dvaas/BUILD.bazel index c33794430..5ecae1ab3 100644 --- a/dvaas/BUILD.bazel +++ b/dvaas/BUILD.bazel @@ -42,12 +42,6 @@ cc_library( ":user_provided_packet_test_vector", ":validation_result", "//dvaas/thinkit_tests:dvaas_regression_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:timer", - "//gutil/gutil:proto_ordering", - "//gutil/gutil:status", - "//gutil/gutil:test_artifact_writer", - "//gutil/gutil:version", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -76,6 +70,12 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:timer", + "@com_google_gutil//gutil:proto_ordering", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:version", ], ) @@ -96,8 +96,6 @@ cc_library( deps = [ ":dvaas_detective_cc_proto", ":test_vector_cc_proto", - "//gutil/gutil:overload", - "//gutil/gutil:proto", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status", @@ -105,6 +103,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:variant", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:overload", "@com_google_ydf//yggdrasil_decision_forests/dataset:data_spec_cc_proto", "@com_google_ydf//yggdrasil_decision_forests/model/decision_tree", "@com_google_ydf//yggdrasil_decision_forests/model/decision_tree:decision_tree_cc_proto", @@ -122,14 +122,14 @@ cc_test( ":dvaas_detective", ":dvaas_detective_cc_proto", ":test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/internal:ordered_map", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:testing", + "@com_google_gutil//gutil:status_matchers", "@com_google_ydf//yggdrasil_decision_forests/dataset:data_spec_cc_proto", "@com_google_ydf//yggdrasil_decision_forests/model/decision_tree", "@com_google_ydf//yggdrasil_decision_forests/model/random_forest", @@ -155,8 +155,13 @@ cc_test( deps = [ ":packet_trace", ":packet_trace_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:testing", + "@com_google_absl//absl/container:btree", + "@com_google_absl//absl/log", + "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", ], @@ -184,7 +189,6 @@ cc_library( ":test_run_validation", ":test_vector_cc_proto", ":test_vector_stats", - "//gutil/gutil:status", "//p4_symbolic/packet_synthesizer:packet_synthesizer_cc_proto", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/container:btree", @@ -194,6 +198,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status", ], ) @@ -203,14 +208,14 @@ cc_test( deps = [ ":test_vector_cc_proto", ":validation_result", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -231,7 +236,6 @@ cc_library( ":port_id_map", ":test_vector", ":test_vector_cc_proto", - "//gutil/gutil:status", "//lib/p4rt:p4rt_port", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -248,6 +252,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], ) @@ -258,9 +263,6 @@ cc_library( deps = [ ":switch_api", ":test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:proto_ordering", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/base:nullability", @@ -273,6 +275,9 @@ cc_library( "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_ordering", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -291,8 +296,6 @@ cc_library( ":test_vector", ":test_vector_cc_proto", ":validation_result", - "//gutil/gutil:proto", - "//gutil/gutil:test_artifact_writer", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -308,6 +311,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:test_artifact_writer", ], ) @@ -318,8 +323,6 @@ cc_library( deps = [ ":port_id_map", ":switch_api", - "//gutil/gutil:proto", - "//gutil/gutil:test_artifact_writer", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -330,6 +333,8 @@ cc_library( "//tests/lib:switch_test_setup_helpers", "//thinkit:mirror_testbed", "//thinkit:mirror_testbed_fixture", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:test_artifact_writer", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", "@com_google_absl//absl/container:btree", "@com_google_absl//absl/log", @@ -374,8 +379,6 @@ cc_library( hdrs = ["test_vector.h"], deps = [ ":test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:bit_widths", @@ -386,6 +389,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_googlesource_code_re2//:re2", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -395,14 +400,14 @@ cc_test( deps = [ ":test_vector", ":test_vector_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:bit_widths", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -431,8 +436,6 @@ cc_library( srcs = ["port_id_map.cc"], hdrs = ["port_id_map.h"], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:test_artifact_writer", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_port", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", @@ -444,6 +447,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:test_artifact_writer", ], ) @@ -452,11 +457,11 @@ cc_test( srcs = ["port_id_map_test.cc"], deps = [ ":port_id_map", - "//gutil/gutil:status_matchers", "//lib/p4rt:p4rt_port", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -468,8 +473,6 @@ cc_library( deps = [ ":test_vector", ":test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi/packetlib", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -477,6 +480,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -497,8 +502,6 @@ cc_library( ":test_vector", ":test_vector_cc_proto", ":validation_result", - "//gutil/gutil:proto", - "//gutil/gutil:test_artifact_writer", "//lib/p4rt:p4rt_port", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -519,6 +522,8 @@ cc_library( "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:test_artifact_writer", ], ) @@ -531,7 +536,6 @@ cc_library( ":packet_trace_cc_proto", ":test_vector", ":test_vector_cc_proto", - "//gutil/gutil:proto", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -544,6 +548,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:proto", ], ) @@ -555,9 +560,9 @@ cc_test( ":test_insights", ":test_vector_cc_proto", "//p4_pdpi:ir_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -582,10 +587,10 @@ cc_library( hdrs = ["label.h"], deps = [ ":test_vector_cc_proto", - "//gutil/gutil:status", "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", + "@com_google_gutil//gutil:status", ], ) @@ -596,9 +601,9 @@ cc_library( deps = [ ":packet_trace_cc_proto", ":test_vector_cc_proto", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_symbolic/packet_synthesizer:packet_synthesizer_cc_proto", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", @@ -614,9 +619,9 @@ cc_library( ":packet_trace_cc_proto", ":test_vector", ":test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:test_artifact_writer", "//p4_pdpi:ir_cc_proto", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:test_artifact_writer", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/log", "@com_google_absl//absl/status", @@ -629,9 +634,9 @@ cc_test( srcs = ["packet_trace_test.cc"], deps = [ ":packet_trace", - "//gutil/gutil:status_matchers", - "//gutil/gutil:test_artifact_writer", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:testing", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", @@ -645,12 +650,12 @@ cc_library( deps = [ ":packet_trace_cc_proto", ":test_vector_cc_proto", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/netaddr:ipv4_address", "//p4_pdpi/netaddr:ipv6_address", "//p4_pdpi/netaddr:mac_address", "//p4_pdpi/packetlib:packetlib_cc_proto", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/algorithm:container", "@com_google_absl//absl/log", "@com_google_absl//absl/status", @@ -667,10 +672,10 @@ cc_test( ":labeler", ":packet_trace_cc_proto", ":test_vector_cc_proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -683,10 +688,6 @@ cc_test( ":test_vector", ":test_vector_cc_proto", ":user_provided_packet_test_vector", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:packetlib_cc_proto", "//p4_pdpi/testing:test_p4info_cc", @@ -695,6 +696,10 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -718,7 +723,7 @@ cc_test( deps = [ ":test_vector_cc_proto", ":test_vector_stats", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", ], ) @@ -743,12 +748,12 @@ cc_test( deps = [ ":test_run_validation", ":test_vector_cc_proto", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status:statusor", + "@com_google_gutil//gutil:testing", ], ) @@ -766,14 +771,14 @@ cc_test( ":switch_api", ":test_run_validation", ":test_vector_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -782,10 +787,10 @@ cc_test( srcs = ["failure_post_processing_test.cc"], deps = [ ":failure_post_processing", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", ], diff --git a/dvaas/arriba_test_vector_validation.cc b/dvaas/arriba_test_vector_validation.cc index ee3d26985..b729e9f19 100644 --- a/dvaas/arriba_test_vector_validation.cc +++ b/dvaas/arriba_test_vector_validation.cc @@ -31,9 +31,9 @@ #include "dvaas/test_vector.h" #include "dvaas/test_vector.pb.h" #include "dvaas/validation_result.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" #include "lib/p4rt/p4rt_port.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/dvaas/dataplane_validation.cc b/dvaas/dataplane_validation.cc index 6cecc5c48..12d209803 100644 --- a/dvaas/dataplane_validation.cc +++ b/dvaas/dataplane_validation.cc @@ -49,12 +49,12 @@ #include "dvaas/user_provided_packet_test_vector.h" #include "dvaas/validation_result.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/timer.h" -#include "gutil/gutil/proto_ordering.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" -#include "gutil/gutil/version.h" +#include "gutil/proto.h" +#include "gutil/timer.h" +#include "gutil/proto_ordering.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/version.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/p4rt/p4rt_port.h" diff --git a/dvaas/dataplane_validation.h b/dvaas/dataplane_validation.h index f151f07e6..471f0e72d 100644 --- a/dvaas/dataplane_validation.h +++ b/dvaas/dataplane_validation.h @@ -41,7 +41,7 @@ limitations under the License. #include "dvaas/test_vector.pb.h" #include "dvaas/thinkit_tests/dvaas_regression.pb.h" #include "dvaas/validation_result.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/test_artifact_writer.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/dvaas/dataplane_validation_test.cc b/dvaas/dataplane_validation_test.cc index 5c6fc8bc3..e6228be67 100644 --- a/dvaas/dataplane_validation_test.cc +++ b/dvaas/dataplane_validation_test.cc @@ -6,8 +6,10 @@ #include "dvaas/packet_trace.h" #include "dvaas/packet_trace.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/testing.h" namespace dvaas { namespace { diff --git a/dvaas/dvaas_detective.cc b/dvaas/dvaas_detective.cc index 039578d2c..07080e9e9 100644 --- a/dvaas/dvaas_detective.cc +++ b/dvaas/dvaas_detective.cc @@ -33,9 +33,9 @@ #include "absl/types/variant.h" #include "dvaas/dvaas_detective.pb.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/overload.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "yggdrasil_decision_forests/dataset/data_spec.pb.h" #include "yggdrasil_decision_forests/model/decision_tree/decision_tree.h" diff --git a/dvaas/dvaas_detective_test.cc b/dvaas/dvaas_detective_test.cc index 76cf4c7b2..8951462eb 100644 --- a/dvaas/dvaas_detective_test.cc +++ b/dvaas/dvaas_detective_test.cc @@ -34,9 +34,9 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "yggdrasil_decision_forests/dataset/data_spec.pb.h" diff --git a/dvaas/failure_post_processing.cc b/dvaas/failure_post_processing.cc index fd231b78a..be3ea2fa9 100644 --- a/dvaas/failure_post_processing.cc +++ b/dvaas/failure_post_processing.cc @@ -8,7 +8,7 @@ #include "dvaas/packet_trace.pb.h" #include "dvaas/test_vector.pb.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/packet_synthesizer/packet_synthesizer.pb.h" diff --git a/dvaas/failure_post_processing_test.cc b/dvaas/failure_post_processing_test.cc index 1bf71fc80..740d3e913 100644 --- a/dvaas/failure_post_processing_test.cc +++ b/dvaas/failure_post_processing_test.cc @@ -3,10 +3,10 @@ #include "absl/status/statusor.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/testing.h" namespace dvaas { namespace { diff --git a/dvaas/label.cc b/dvaas/label.cc index 1a7cf68b2..98a6cc59f 100644 --- a/dvaas/label.cc +++ b/dvaas/label.cc @@ -10,7 +10,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace dvaas { diff --git a/dvaas/labeler.cc b/dvaas/labeler.cc index 1170e18d3..95bb4ba60 100644 --- a/dvaas/labeler.cc +++ b/dvaas/labeler.cc @@ -12,7 +12,7 @@ #include "absl/strings/string_view.h" #include "dvaas/packet_trace.pb.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/netaddr/ipv4_address.h" #include "p4_pdpi/netaddr/ipv6_address.h" diff --git a/dvaas/labeler_test.cc b/dvaas/labeler_test.cc index ddcc00f49..e5345500d 100644 --- a/dvaas/labeler_test.cc +++ b/dvaas/labeler_test.cc @@ -4,9 +4,9 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" #include "p4_pdpi/ir.pb.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" namespace dvaas { namespace { diff --git a/dvaas/mirror_testbed_config.cc b/dvaas/mirror_testbed_config.cc index 538fd498a..4057c544f 100644 --- a/dvaas/mirror_testbed_config.cc +++ b/dvaas/mirror_testbed_config.cc @@ -33,9 +33,9 @@ #include "absl/strings/substitute.h" #include "dvaas/port_id_map.h" #include "dvaas/switch_api.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" diff --git a/dvaas/packet_injection.cc b/dvaas/packet_injection.cc index 78a797a65..cb2025dab 100644 --- a/dvaas/packet_injection.cc +++ b/dvaas/packet_injection.cc @@ -32,7 +32,7 @@ #include "dvaas/port_id_map.h" #include "dvaas/test_vector.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/p4rt/p4rt_port.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/dvaas/packet_trace.cc b/dvaas/packet_trace.cc index 09afd6ba4..4e65d5c3d 100644 --- a/dvaas/packet_trace.cc +++ b/dvaas/packet_trace.cc @@ -9,10 +9,10 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_replace.h" #include "dvaas/test_vector.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" #include "p4_pdpi/ir.pb.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" namespace dvaas { diff --git a/dvaas/packet_trace.h b/dvaas/packet_trace.h index dc5ac0a5c..e4bf23f9f 100644 --- a/dvaas/packet_trace.h +++ b/dvaas/packet_trace.h @@ -6,8 +6,7 @@ #include "absl/status/status.h" #include "dvaas/packet_trace.pb.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/test_artifact_writer.h" - +#include "gutil/test_artifact_writer.h" namespace dvaas { // Returns a copy of the packet trace with all the redundant information (bmv2 diff --git a/dvaas/packet_trace_test.cc b/dvaas/packet_trace_test.cc index 302da457a..a8983b0ff 100644 --- a/dvaas/packet_trace_test.cc +++ b/dvaas/packet_trace_test.cc @@ -4,9 +4,9 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/test_artifact_writer.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/testing.h" namespace { diff --git a/dvaas/port_id_map.cc b/dvaas/port_id_map.cc index fca617bcc..06b0a7b04 100644 --- a/dvaas/port_id_map.cc +++ b/dvaas/port_id_map.cc @@ -27,8 +27,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/dvaas/port_id_map.h b/dvaas/port_id_map.h index 497f26b83..d73ea9a20 100644 --- a/dvaas/port_id_map.h +++ b/dvaas/port_id_map.h @@ -23,7 +23,7 @@ #include "absl/container/flat_hash_set.h" #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/test_artifact_writer.h" #include "lib/p4rt/p4rt_port.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/dvaas/port_id_map_test.cc b/dvaas/port_id_map_test.cc index f5c935a97..b3bdd04ff 100644 --- a/dvaas/port_id_map_test.cc +++ b/dvaas/port_id_map_test.cc @@ -18,7 +18,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/p4rt/p4rt_port.h" namespace dvaas { diff --git a/dvaas/test_insights.cc b/dvaas/test_insights.cc index ffaf30cc5..3af1f8071 100644 --- a/dvaas/test_insights.cc +++ b/dvaas/test_insights.cc @@ -35,8 +35,8 @@ #include "dvaas/packet_trace.pb.h" #include "dvaas/test_vector.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/dvaas/test_insights_test.cc b/dvaas/test_insights_test.cc index 5430c938b..da2714acc 100644 --- a/dvaas/test_insights_test.cc +++ b/dvaas/test_insights_test.cc @@ -9,9 +9,9 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.pb.h" namespace dvaas { diff --git a/dvaas/test_run_validation.cc b/dvaas/test_run_validation.cc index 3e78ffa3e..b208c0d3d 100644 --- a/dvaas/test_run_validation.cc +++ b/dvaas/test_run_validation.cc @@ -40,10 +40,10 @@ #include "google/protobuf/repeated_ptr_field.h" #include "google/protobuf/util/message_differencer.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_ordering.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_ordering.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/dvaas/test_run_validation_test.cc b/dvaas/test_run_validation_test.cc index 47c627410..002ac9b33 100644 --- a/dvaas/test_run_validation_test.cc +++ b/dvaas/test_run_validation_test.cc @@ -12,9 +12,9 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/repeated_ptr_field.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.pb.h" namespace dvaas { diff --git a/dvaas/test_run_validation_test_runner.cc b/dvaas/test_run_validation_test_runner.cc index ded4b307c..307e5dad9 100644 --- a/dvaas/test_run_validation_test_runner.cc +++ b/dvaas/test_run_validation_test_runner.cc @@ -21,7 +21,7 @@ #include "absl/status/statusor.h" #include "dvaas/test_run_validation.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/dvaas/test_vector.cc b/dvaas/test_vector.cc index cd9493025..65ae703e5 100644 --- a/dvaas/test_vector.cc +++ b/dvaas/test_vector.cc @@ -23,8 +23,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/packetlib/bit_widths.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/dvaas/test_vector_stats_test.cc b/dvaas/test_vector_stats_test.cc index 253d9a762..fddf98052 100644 --- a/dvaas/test_vector_stats_test.cc +++ b/dvaas/test_vector_stats_test.cc @@ -18,7 +18,7 @@ #include "dvaas/test_vector.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" namespace dvaas { namespace { diff --git a/dvaas/test_vector_test.cc b/dvaas/test_vector_test.cc index de53accb0..968a47c39 100644 --- a/dvaas/test_vector_test.cc +++ b/dvaas/test_vector_test.cc @@ -20,9 +20,9 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/bit_widths.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/dvaas/thinkit_tests/BUILD.bazel b/dvaas/thinkit_tests/BUILD.bazel index fcbcef723..fd2209298 100644 --- a/dvaas/thinkit_tests/BUILD.bazel +++ b/dvaas/thinkit_tests/BUILD.bazel @@ -30,7 +30,6 @@ cc_library( "//dvaas:test_vector_cc_proto", "//dvaas:validation_result", "//lib/p4rt:p4rt_port", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:p4_runtime_session_extras", "//tests/lib:switch_test_setup_helpers", @@ -39,6 +38,7 @@ cc_library( "@com_google_absl//absl/container:btree", "@com_google_absl//absl/log", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) diff --git a/dvaas/thinkit_tests/dvaas_regression_test.cc b/dvaas/thinkit_tests/dvaas_regression_test.cc index 2fb1a4fe4..4de057f39 100644 --- a/dvaas/thinkit_tests/dvaas_regression_test.cc +++ b/dvaas/thinkit_tests/dvaas_regression_test.cc @@ -13,7 +13,7 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4_pdpi/p4_runtime_session_extras.h" diff --git a/dvaas/traffic_generator.cc b/dvaas/traffic_generator.cc index 03b174add..62d4792ad 100644 --- a/dvaas/traffic_generator.cc +++ b/dvaas/traffic_generator.cc @@ -47,9 +47,9 @@ #include "dvaas/test_vector.h" #include "dvaas/test_vector.pb.h" #include "dvaas/validation_result.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/test_artifact_writer.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/dvaas/user_provided_packet_test_vector.cc b/dvaas/user_provided_packet_test_vector.cc index 1b0e39c8d..1eb8052c4 100644 --- a/dvaas/user_provided_packet_test_vector.cc +++ b/dvaas/user_provided_packet_test_vector.cc @@ -9,8 +9,8 @@ #include "absl/types/span.h" #include "dvaas/test_vector.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/packetlib/packetlib.h" diff --git a/dvaas/user_provided_packet_test_vector_test.cc b/dvaas/user_provided_packet_test_vector_test.cc index bbc21d956..0c79cace6 100644 --- a/dvaas/user_provided_packet_test_vector_test.cc +++ b/dvaas/user_provided_packet_test_vector_test.cc @@ -28,11 +28,11 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "p4_pdpi/testing/test_p4info.h" diff --git a/dvaas/validation_result.cc b/dvaas/validation_result.cc index 51b9c4f9e..33a06852f 100644 --- a/dvaas/validation_result.cc +++ b/dvaas/validation_result.cc @@ -28,8 +28,8 @@ #include "dvaas/test_run_validation.h" #include "dvaas/test_vector.pb.h" #include "dvaas/test_vector_stats.h" -#include "gutil/gutil/status.h" #include "gtest/gtest.h" +#include "gutil/status.h" namespace dvaas { diff --git a/dvaas/validation_result_test.cc b/dvaas/validation_result_test.cc index 7dbd5c999..fcbb48028 100644 --- a/dvaas/validation_result_test.cc +++ b/dvaas/validation_result_test.cc @@ -4,11 +4,11 @@ #include "absl/status/status.h" #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" -#include "gutil/gutil/proto_matchers.h" +#include "gutil/proto_matchers.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" namespace dvaas { namespace { diff --git a/gutil/gutil/BUILD.bazel b/gutil/gutil/BUILD.bazel deleted file mode 100644 index 2051156ba..000000000 --- a/gutil/gutil/BUILD.bazel +++ /dev/null @@ -1,349 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@com_google_googleapis_imports//:imports.bzl", "cc_proto_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], -) - -cc_library( - name = "status", - srcs = [ - "status.cc", - ], - hdrs = [ - "status.h", - ], - deps = [ - "@com_github_grpc_grpc//:grpc++", - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:cord", - "@com_google_absl//absl/types:optional", - ], -) - -cc_library( - name = "proto_matchers", - testonly = True, - hdrs = ["proto_matchers.h"], - deps = [ - ":proto", - "@com_google_absl//absl/log", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", - ], -) - -cc_test( - name = "proto_matchers_test", - srcs = ["proto_matchers_test.cc"], - deps = [ - ":proto_matchers", - ":proto_test_cc_proto", - ":testing", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "status_matchers", - testonly = True, - hdrs = ["status_matchers.h"], - deps = [ - ":status", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - "@com_google_googletest//:gtest", - ], -) - -cc_test( - name = "status_matchers_test", - srcs = ["status_matchers_test.cc"], - deps = [ - ":status", - ":status_matchers", - "@com_google_absl//absl/memory", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "testing", - testonly = True, - srcs = ["testing.cc"], - hdrs = ["testing.h"], - deps = [ - ":proto", - ":status", - "@com_google_absl//absl/log", - "@com_google_absl//absl/log:check", - "@com_google_absl//absl/status", - "@com_google_absl//absl/strings", - ], -) - -cc_test( - name = "testing_test", - srcs = ["testing_test.cc"], - deps = [ - ":testing", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "collections", - hdrs = [ - "collections.h", - ], - deps = [ - ":status", - "@com_google_absl//absl/log", - "@com_google_absl//absl/log:check", - "@com_google_absl//absl/container:flat_hash_map", - "@com_google_absl//absl/container:flat_hash_set", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - ], -) - -cc_library( - name = "proto", - srcs = [ - "proto.cc", - ], - hdrs = [ - "proto.h", - ], - deps = [ - ":proto_string_error_collector", - ":status", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - ], -) - -cc_library( - name = "overload", - hdrs = ["overload.h"], -) - -cc_library( - name = "io", - srcs = [ - "io.cc", - ], - hdrs = [ - "io.h", - ], - deps = [ - ":status", - "@com_google_absl//absl/status", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - ], -) - -cc_test( - name = "io_test", - srcs = [ - "io_test.cc", - ], - deps = [ - ":io", - ":status_matchers", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "collections_test", - srcs = ["collections_test.cc"], - deps = [ - ":collections", - ":status_matchers", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "proto_test", - srcs = ["proto_test.cc"], - deps = [ - ":proto", - ":proto_matchers", - ":proto_test_cc_proto", - ":status", - ":status_matchers", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -proto_library( - name = "proto_test_proto", - srcs = ["proto_test.proto"], -) - -proto_library( - name = "test_artifact_writer_test_proto", - srcs = ["test_artifact_writer_test.proto"], -) - -cc_proto_library( - name = "test_artifact_writer_test_cc_proto", - deps = [":test_artifact_writer_test_proto"], -) - -cc_proto_library( - name = "proto_test_cc_proto", - deps = [":proto_test_proto"], -) - -cc_library( - name = "version", - srcs = ["version.cc"], - hdrs = ["version.h"], - deps = [ - ":status", - "@com_google_absl//absl/log", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", - "@com_googlesource_code_re2//:re2", - ], -) - -cc_test( - name = "version_test", - srcs = ["version_test.cc"], - deps = [ - ":status_matchers", - ":version", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "proto_string_error_collector", - hdrs = ["proto_string_error_collector.h"], - deps = [ - "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - ], -) - -cc_library( - name = "test_artifact_writer", - testonly = True, - srcs = ["test_artifact_writer.cc"], - hdrs = ["test_artifact_writer.h"], - deps = [ - ":proto", - ":status", - "@com_google_absl//absl/container:flat_hash_map", - "@com_google_absl//absl/status", - "@com_google_absl//absl/status:statusor", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/synchronization", - "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", - ], -) - -cc_library( - name = "proto_ordering", - testonly = True, - srcs = ["proto_ordering.cc"], - hdrs = ["proto_ordering.h"], - deps = [ - ":proto", - "@com_google_absl//absl/algorithm:container", - "@com_google_absl//absl/types:span", - "@com_google_protobuf//:protobuf", - ], -) - -cc_library( - name = "timer", - hdrs = ["timer.h"], - deps = ["@com_google_absl//absl/time"], -) - -cc_test( - name = "proto_ordering_test", - srcs = ["proto_ordering_test.cc"], - deps = [ - ":proto_matchers", - ":proto_ordering", - ":proto_test_cc_proto", - ":testing", - "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", - ], -) - -cc_test( - name = "test_artifact_writer_test", - srcs = ["test_artifact_writer_test.cc"], - deps = [ - ":status_matchers", - ":test_artifact_writer", - ":test_artifact_writer_test_cc_proto", - "@com_google_googletest//:gtest_main", - "@com_google_benchmark//:benchmark", - "@com_google_absl//absl/strings", - ], -) - -cc_library( - name = "syslog_sink", - srcs = ["syslog_sink.cc"], - hdrs = ["syslog_sink.h"], - deps = [ - "@com_google_absl//absl/log:log_entry", - "@com_google_absl//absl/log:log_sink", - "@com_google_absl//absl/log:log_sink_registry", - ], -) - -cc_test( - name = "timer_test", - srcs = ["timer_test.cc"], - deps = [ - ":timer", - "@com_google_googletest//:gtest_main", - ], -) diff --git a/gutil/gutil/assign_or_return.md b/gutil/gutil/assign_or_return.md deleted file mode 100644 index 117b83680..000000000 --- a/gutil/gutil/assign_or_return.md +++ /dev/null @@ -1,318 +0,0 @@ -# ASSIGN_OR_RETURN Macro Explanation - -The `ASSIGN_OR_RETURN` macro may look complicated at first, but ultimately does -not breaks down to a few different macros. To get an overview of what -`ASSIGN_OR_RETURN` does, skip to the [ASSIGN_OR_RETURN](#ASSIGN_OR_RETURN) -section. - -Below is a call graph of the macros: - -``` -ASSIGN_OR_RETURN # Initial dispatch. - | - |_______ __ASSIGN_OR_RETURN_PICK # Selects the macro to invoke - | - 2-----< # Params >-----3 - | | - | | - __ASSIGN_OR_RETURN __ASSIGN_OR_RETURN_STREAM # Performs the actual logic - | | - | | - | | - __ASSIGN_OR_RETURN_VAL(__LINE__) # Resolves the __LINE__ arg. - | - __ASSIGN_OR_RETURN_VAL_INDIRECT # Creates a unique value -``` - -## Individual Macro Descriptions - -Descriptions are given in a bottom-up manner in relation to the previous graph. - -### \_\_ASSIGN\_OR\_RETURN\_VAL\_DIRECT - -`__ASSIGN_OR_RETURN_VAL_DIRECT(arg)` creates a unique variable name: -`__ASSIGN_OR_RETURN_RESULT_[arg]`. This helps the other `__ASSIGN_OR_RETURN` -macros save values in the caller's scope while minimizing the risk of conflict -with any existing variable. - -#### Macro - -```c++ -#define __ASSIGN_OR_RETURN_VAL_DIRECT(arg) \ - __ASSIGN_OR_RETURN_RESULT_##arg -``` - -#### Constraints - -`__ASSIGN_OR_RETURN_VAL_DIRECT` utilizes the argument name, not the value. It -does not invoke any macro that is passed in as an argument (e.g. `__LINE__`). -Therefore, we suggest users invoke the wrapper macro `__ASSIGN_OR_RETURN_VAL` -described in the next section. - -#### Examples - -Code | Resolves to ------------------------------------------ | ------------------------------------ -`__ASSIGN_OR_RETURN_VAL_DIRECT(__LINE__)` | `__ASSIGN_OR_RETURN_RESULT___LINE__` -`__ASSIGN_OR_RETURN_VAL_DIRECT()` | `__ASSIGN_OR_RETURN_RESULT` -`__ASSIGN_OR_RETURN_VAL_DIRECT(HELLO)` | `__ASSIGN_OR_RETURN_RESULT_HELLO` - -### \_\_ASSIGN\_OR\_RETURN\_VAL - -`__ASSIGN_OR_RETURN_VAL(arg)` is a wrapper around -`__ASSIGN_OR_RETURN_VAL_DIRECT`, described in the previous section. This macro -evaluates its argument before passing it to `__ASSIGN_OR_RETURN_VAL`. - -#### Macro - -```c++ -#define __ASSIGN_OR_RETURN_VAL(arg) \ - __ASSIGN_OR_RETURN_VAL_DIRECT(arg) -``` - -#### Examples - -Line | Code | Resolves to ----- | ---------------------------------- | --------------------------------- -173 | `__ASSIGN_OR_RETURN_VAL(__LINE__)` | `__ASSIGN_OR_RETURN_RESULT_173` -834 | `__ASSIGN_OR_RETURN_VAL(__LINE__)` | `__ASSIGN_OR_RETURN_RESULT_834` -- | `__ASSIGN_OR_RETURN_VAL()` | `__ASSIGN_OR_RETURN_RESULT_` -- | `__ASSIGN_OR_RETURN_VAL(HELLO)` | `__ASSIGN_OR_RETURN_RESULT_HELLO` - -### \_\_ASSIGN\_OR\_RETURN - -`__ASSIGN_OR_RETURN(dest, expr)` evalutes an expression returning a StatusOr -object. If the resulting StatusOr contains a value (is ok), the value is saved -to `dest`. Otherwise, the StatusOr's error status is returned. - -#### Macro - -```c++ -#define __ASSIGN_OR_RETURN(dest, expr) \ - auto __ASSIGN_OR_RETURN_VAL(__LINE__) = expr; \ - if (!__ASSIGN_OR_RETURN_VAL(__LINE__).ok()) { \ - return __ASSIGN_OR_RETURN_VAL(__LINE__).status(); \ - } \ - dest = __ASSIGN_OR_RETURN_VAL(__LINE__).value() -``` - -#### Examples - -`__ASSIGN_OR_RETURN(int val, StatusOrFunc());` @ line **127** resolves to: - -```c++ -auto __ASSIGN_OR_RETURN_VAL_127 = StatusorFunc(); -if (!__ASSIGN_OR_RETURN_VAL_127.ok()) { - return __ASSIGN_OR_RETURN_VAL_127.status(); -} -dest = __ASSIGN_OR_RETURN_VAL_127.value(); -``` - -### \_\_ASSIGN\_OR\_RETURN\_STREAM - -`__ASSIGN_OR_RETURN_STREAM(dest, expr, stream)` works similarly to -`__ASSIGN_OR_RETURN` described in the previous section. However, it has the -addition of a `stream` input which allows the caller to control a -`StatusBuilder` object to inject or log information. The `stream` parameter is -must be a command assuming a StatusOr object already exists with the name `_`. - -#### Macro - -```c++ -#define __ASSIGN_OR_RETURN_STREAM(dest, expr, stream) \ - auto __ASSIGN_OR_RETURN_VAL(__LINE__) = expr; \ - if (!__ASSIGN_OR_RETURN_VAL(__LINE__).ok()) { \ - return status::StatusBuilderHolder( \ - __ASSIGN_OR_RETURN_VAL(__LINE__).status()) \ - .builder##stream; \ - } \ - dest = __ASSIGN_OR_RETURN_VAL(__LINE__).value() -``` - -#### Examples - -Assume all `__ASSIGN_OR_RETURN_STREAM` calls are made @ line **134**. - -##### Example 1 - -```c++ -// Assign Foo().value() to val if successful. -// If unsuccessful, append 'info' to the error message. -__ASSIGN_OR_RETURN_STREAM(int val, Foo(), _ << "info") -``` - -resolves to - -```c++ -auto __ASSIGN_OR_RETURN_VAL_134 = Foo(); -if (!__ASSIGN_OR_RETURN_VAL_134.ok()) { - return status::StatusBuilderHolder( - __ASSIGN_OR_RETURN_VAL_134.status()).builder_ << "info"; -} -dest = __ASSIGN_OR_RETURN_VAL_134.value(); -``` - -##### Example 2 - -```c++ -// Assign Foo().value() to val if successful. -// If unsuccessful, append 'info' to the error message and log the error. -__ASSIGN_OR_RETURN_STREAM(int val, Foo(), _.LogError() << "info") -``` - -resolves to - -```c++ -auto __ASSIGN_OR_RETURN_VAL_134 = Foo(); -if (!__ASSIGN_OR_RETURN_VAL_134.ok()) - return status::StatusBuilderHolder( - __ASSIGN_OR_RETURN_VAL_134.status()).builder_.LogError() << "info"; -dest = __ASSIGN_OR_RETURN_VAL_134.value(); -``` - -### \_\_ASSIGN\_OR\_RETURN\_PICK - -`__ASSIGN_OR_RETURN_PICK(dest, expr, stream, func, ...)` returns a macro based -on the number of arguments provided for macros with up to 3 inputs (dest, expr, -and stream). This macro functions when the caller ensures the **fourth** -argument is the macro to return. - -The expected usage is: - -```c++ -FOO(...) \ - __ASSIGN_OR_RETURN_PICK(__VA_ARGS__, FOO_3INPUTS, [FOO_2INPUTS], \ - [FOO_1INPUT], [FOO_0INPUTS])(__VA_ARGS__) \ -``` - -#### Macro - -```c++ -#define __ASSIGN_OR_RETURN_PICK(dest, expr, stream, func, ...) func -``` - -#### Examples - -```c++ -SUM_3(arg1, arg2, arg3) arg1 + arg2 + arg3 -SUM_2(arg1, arg2) arg1 + arg2 -SUM_1(arg1) arg1 -SUM_0() 0 - -SUM(...) - __ASSIGN_OR_RETURN_PICK(__VA_ARGS__, SUM_3, SUM_2, SUM_1, SUM_0)(__VA_ARGS__) - -std::cout << SUM() << std::endl; // 0 -std::cout << SUM(15) << std::endl; // 15 -std::cout << SUM(15, 5) << std::endl; // 20 -std::cout << SUM(15, 5, 1) << std::endl; // 21 -``` - -Detail for 3-argument call `SUM(15, 5, 1)` - -```c++ -// SUM with __VA_ARGS__ expansion -// Fourth argument --v -__ASSIGN_OR_RETURN_PICK(15, 5, 1, SUM_3, SUM2, SUM_1, SUM_0)(15, 5, 1) - -// __ASSIGN_OR_RETURN_PICK expansion -SUM_3(15, 5, 1) -``` - -Detail for 2-argument call `SUM(15, 5)` - -```c++ -// SUM with __VA_ARGS__ expansion -// Fourth argument --v -__ASSIGN_OR_RETURN_PICK(15, 5, SUM_3, SUM2, SUM_1, SUM_0)(15, 5) - -// __ASSIGN_OR_RETURN_PICK expansion -SUM_2(15, 5) -``` - -Detail for 1-argument call `SUM(15)` - -```c++ -// SUM with __VA_ARGS__ expansion -// Fourth argument --v -__ASSIGN_OR_RETURN_PICK(15, SUM_3, SUM2, SUM_1, SUM_0)(15) - -// __ASSIGN_OR_RETURN_PICK expansion -SUM_1(15) -``` - -Detail for 0-argument call `SUM()` - -```c++ -// SUM with __VA_ARGS__ expansion -// Fourth argument --v -__ASSIGN_OR_RETURN_PICK(SUM_3, SUM2, SUM_1, SUM_0)() - -// __ASSIGN_OR_RETURN_PICK expansion -SUM_0() -``` - -## ASSIGN\_OR\_RETURN {#ASSIGN_OR_RETURN} - -The `ASSIGN_OR_RETURN(...)` macro takes in up to three arguments: - -1. The value destination (if successful). - * The destination may be an existing variable (e.g. `foo`) or a new - variable declaration (e.g. `int foo`). -2. The expression to evaluate (must return StatusOr). -3. An *optional* StatusBuilder command. This command must be presented with the - assumption that the resulting StatusBuilder is named `_`. Example: - `_.LogError() << "info"`. - -`ASSIGN_OR_RETURN` evaluates the expression (second parameter). If the resulting -StatusOr contains a value (is ok), the the destination (first parameter) is set -to the StatusOr value. Otherwise, the error StatusOr (error) status is returned -with optional StatusBuilder modifications (third parameter). - -### Macro - -```c++ -#define ASSIGN_OR_RETURN(...) \ - __ASSIGN_OR_RETURN_PICK(__VA_ARGS__, __ASSIGN_OR_RETURN_STREAM, \ - __ASSIGN_OR_RETURN) \ - (__VA_ARGS__) -``` - -### Examples - -#### Basic ASSIGN\_OR\_RETURN - -```c++ -Line | -173 | ASSIGN_OR_RETURN(bool val, Foo()); -``` - -Resolves to: - -```c++ -auto __ASSIGN_OR_RETURN_RESULT_173 = Foo(); -if (!__ASSIGN_OR_RETURN_RESULT_173.ok()) { - return __ASSIGN_OR_RETURN_RESULT_173.status(); -} -bool val = __ASSIGN_OR_RETURN_RESULT_173; -``` - -#### ASSIGN\_OR\_RETURN with StatusBuilder - -```c++ -Line | -173 | ASSIGN_OR_RETURN(bool val, Foo(), _.LogError() << "info"); -``` - -Resolves to: - -```c++ -auto __ASSIGN_OR_RETURN_RESULT_173 = Foo(); -if (!__ASSIGN_OR_RETURN_RESULT_173.ok()) { - return status::StatusBuilderHolder( - __ASSIGN_OR_RETURN_RESULT_173.status()) - .builder_.LogError() - << "info"; -} -bool val = __ASSIGN_OR_RETURN_RESULT_173; -``` diff --git a/gutil/gutil/collections.h b/gutil/gutil/collections.h deleted file mode 100644 index 4cb1dfdcb..000000000 --- a/gutil/gutil/collections.h +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_COLLECTIONS_H_ -#define PINS_GUTIL_GUTIL_COLLECTIONS_H_ - -#include -#include -#include - -#include "absl/container/flat_hash_map.h" -#include "absl/container/flat_hash_set.h" -#include "absl/log/check.h" -#include "absl/log/log.h" -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "google/protobuf/map.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -// Returns a vector of the keys in a map collection. -template -std::vector Keys(const M& m) { - std::vector keys; - for (const auto& [key, val] : m) keys.push_back(key); - return keys; -} - -// Returns a const copy of the value associated with a given key if it exists, -// or a status failure if it does not. -// -// WARNING: prefer FindOrNull if the value can be large to avoid the copy. -template -absl::StatusOr FindOrStatus(const M& m, - const KeyType& k) { - auto it = m.find(k); - if (it != m.end()) return it->second; - if constexpr (std::is_same_v) { - return absl::NotFoundError(absl::StrCat("Key not found: '", k, "'")); - } else { - return absl::NotFoundError("Key not found"); - } -} - -// Returns a const, non-null pointer of the value associated with a given key -// if it exists, or a status failure if it does not. -template -absl::StatusOr FindPtrOrStatus( - const M& m, const KeyType& k) { - auto it = m.find(k); - if (it != m.end()) return &it->second; - if constexpr (std::is_same_v) { - return absl::NotFoundError(absl::StrCat("Key not found: '", k, "'")); - } else { - return absl::NotFoundError("Key not found"); - } -} - -// Returns a mutable, non-null pointer of the value associated with a given key -// if it exists, or a status failure if it does not. -template -absl::StatusOr FindMutablePtrOrStatus( - M& m, const KeyType& k) { - auto it = m.find(k); - if (it != m.end()) return &it->second; - if constexpr (std::is_same_v) { - return absl::NotFoundError(absl::StrCat("Key not found: '", k, "'")); - } else { - return absl::NotFoundError("Key not found"); - } -} - -// Returns a const pointer of the value associated with a given key if it -// exists, or a nullptr if it does not. -template -const typename M::mapped_type* FindOrNull(const M& m, const KeyType& k) { - const auto it = m.find(k); - if (it != m.end()) return &(it->second); - return nullptr; -} - -// Returns a non-const pointer of the value associated with a given key if it -// exists, or a nullptr if it does not. -template -typename M::mapped_type* FindOrNull(M& m, const KeyType& k) { - auto it = m.find(k); - if (it != m.end()) return &(it->second); - return nullptr; -} - -// Returns a reference of the value associated with a given key if it exists, -// crashes if it does not. -template -typename M::mapped_type& FindOrDie(M& map, const KeyType& key) { - auto iter = map.find(key); - CHECK(iter != map.end()) << "Could not find key"; // Crash OK - return iter->second; -} - -// Returns a const reference of the value associated with a given key if it -// exists, crashes if it does not. -template -const typename M::mapped_type& FindOrDie(const M& map, const KeyType& key) { - auto iter = map.find(key); - CHECK(iter != map.end()) << "Could not find key"; // Crash OK - - return iter->second; -} - -// Returns a copy of the value associated with the given key if it exists, or -// returns the given default value otherwise. -// NOTE: May be inefficient for large datatypes that are expensive to copy. -template -typename M::mapped_type FindOrDefault(const M& map, const KeyType& key, - typename M::mapped_type default_value) { - auto it = map.find(key); - return (it != map.end()) ? it->second : default_value; -} - -// Checks if the id is unique in set. -template -absl::Status InsertIfUnique(absl::flat_hash_set& set, const M& id, - const std::string& error_message) { - const auto it = set.insert(id); - if (!it.second) { - return absl::Status(absl::StatusCode::kInvalidArgument, error_message); - } - - return absl::OkStatus(); -} - -template -absl::Status InsertIfUnique(absl::flat_hash_map& map, K key, const V& val, - const std::string& error_message) { - auto it = map.insert({key, val}); - if (!it.second) { - return absl::Status(absl::StatusCode::kInvalidArgument, error_message); - } - - return absl::OkStatus(); -} - -template -absl::Status InsertIfUnique(google::protobuf::Map* map, K key, - const V& val, const std::string& error_message) { - auto it = map->insert({key, val}); - if (!it.second) { - return absl::Status(absl::StatusCode::kInvalidArgument, error_message); - } - - return absl::OkStatus(); -} - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_COLLECTIONS_H_ diff --git a/gutil/gutil/collections_test.cc b/gutil/gutil/collections_test.cc deleted file mode 100644 index 407df8862..000000000 --- a/gutil/gutil/collections_test.cc +++ /dev/null @@ -1,77 +0,0 @@ -#include "gutil/gutil/collections.h" - -#include "absl/strings/string_view.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" - -namespace gutil { -namespace { - -using ::gutil::IsOk; -using ::gutil::IsOkAndHolds; -using ::testing::Eq; -using ::testing::IsNull; -using ::testing::Not; -using ::testing::Pointee; - -TEST(FindOrDefault, ReturnsDefaultForEmptyMap) { - absl::flat_hash_map empty_map; - EXPECT_THAT(FindOrDefault(empty_map, "key", "default"), Eq("default")); -} - -TEST(FindOrDefault, ReturnsMappedValueForExistingKeyAndDefaultOtherwise) { - absl::flat_hash_map map = {{"key", "value"}}; - EXPECT_THAT(FindOrDefault(map, "key", "default"), Eq("value")); - EXPECT_THAT(FindOrDefault(map, "other key", "default"), Eq("default")); -} - -TEST(FindFunctions, CanLookUpStringsUsingStringViews) { - // Non-const and const dictionaries use different code paths, so we test both. - absl::flat_hash_map mutable_map = { - {"key", "value"}}; - const auto& immutable_map = mutable_map; - constexpr absl::string_view kCorrectKey = "key"; - constexpr absl::string_view kIncorrectKey = "incorrect key"; - - // FindOrStatus. - EXPECT_THAT(FindOrStatus(mutable_map, kCorrectKey), - IsOkAndHolds(Eq("value"))); - EXPECT_THAT(FindOrStatus(immutable_map, kCorrectKey), - IsOkAndHolds(Eq("value"))); - EXPECT_THAT(FindOrStatus(mutable_map, kIncorrectKey).status(), Not(IsOk())); - EXPECT_THAT(FindOrStatus(immutable_map, kIncorrectKey).status(), Not(IsOk())); - - // FindPtrOrStatus. - EXPECT_THAT(FindPtrOrStatus(mutable_map, kCorrectKey), - IsOkAndHolds(Pointee(Eq("value")))); - EXPECT_THAT(FindPtrOrStatus(immutable_map, kCorrectKey), - IsOkAndHolds(Pointee(Eq("value")))); - EXPECT_THAT(FindPtrOrStatus(mutable_map, kIncorrectKey).status(), - Not(IsOk())); - EXPECT_THAT(FindPtrOrStatus(immutable_map, kIncorrectKey).status(), - Not(IsOk())); - - // FindOrNull. - EXPECT_THAT(FindOrNull(mutable_map, kCorrectKey), Pointee(Eq("value"))); - EXPECT_THAT(FindOrNull(immutable_map, kCorrectKey), Pointee(Eq("value"))); - EXPECT_THAT(FindOrNull(mutable_map, kIncorrectKey), IsNull()); - EXPECT_THAT(FindOrNull(immutable_map, kIncorrectKey), IsNull()); - - // FindOrDie. - EXPECT_THAT(FindOrDie(mutable_map, kCorrectKey), Eq("value")); - EXPECT_THAT(FindOrDie(immutable_map, kCorrectKey), Eq("value")); - // Skip death tests. - - // FindOrDefault. - const std::string kDefault = "default"; - EXPECT_THAT(FindOrDefault(mutable_map, kCorrectKey, kDefault), Eq("value")); - EXPECT_THAT(FindOrDefault(immutable_map, kCorrectKey, kDefault), Eq("value")); - EXPECT_THAT(FindOrDefault(mutable_map, kIncorrectKey, kDefault), - Eq(kDefault)); - EXPECT_THAT(FindOrDefault(immutable_map, kIncorrectKey, kDefault), - Eq(kDefault)); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/embed_data/BUILD.bazel b/gutil/gutil/embed_data/BUILD.bazel deleted file mode 100644 index 10e806588..000000000 --- a/gutil/gutil/embed_data/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generates source files with embedded file contents. - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], -) - -cc_binary( - name = "generate_cc_embed_data", - srcs = ["generate_cc_embed_data_main.cc"], - deps = [ - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/time", - ], -) diff --git a/gutil/gutil/embed_data/generate_cc_embed_data_main.cc b/gutil/gutil/embed_data/generate_cc_embed_data_main.cc deleted file mode 100644 index 78290b16d..000000000 --- a/gutil/gutil/embed_data/generate_cc_embed_data_main.cc +++ /dev/null @@ -1,197 +0,0 @@ - -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include -#include - -#include "absl/flags/flag.h" -#include "absl/flags/parse.h" -#include "absl/strings/escaping.h" -#include "absl/strings/str_split.h" -#include "absl/strings/strip.h" -#include "absl/time/time.h" - -ABSL_FLAG(std::string, identifier, "resources", - "name of the resources function"); -ABSL_FLAG(std::string, output_header, "", "output header file"); -ABSL_FLAG(std::string, output_impl, "", "output cc impl file"); -ABSL_FLAG(std::string, cpp_namespace, "", "generate in a c++ namespace"); -ABSL_FLAG(std::string, strip_prefix, "", "strip prefix from filenames"); -ABSL_FLAG(bool, flatten, false, - "whether to flatten the directory structure (only include basename)"); - -void GenerateNamespaceOpen(std::ofstream& f) { - const auto& ns = absl::GetFlag(FLAGS_cpp_namespace); - if (ns.empty()) return; - - std::vector ns_comps = - absl::StrSplit(absl::GetFlag(FLAGS_cpp_namespace), absl::ByString("::")); - for (const auto& ns_comp : ns_comps) { - f << "namespace " << ns_comp << " {\n"; - } -} - -void GenerateNamespaceClose(std::ofstream& f) { - const auto& ns = absl::GetFlag(FLAGS_cpp_namespace); - if (ns.empty()) return; - - std::vector ns_comps = - absl::StrSplit(absl::GetFlag(FLAGS_cpp_namespace), absl::ByString("::")); - for (size_t i = 0, e = ns_comps.size(); i < e; ++i) { - f << "}\n"; - } -} - -void GenerateTocStruct(std::ofstream& f) { - f << "#ifndef GUTIL_FILE_TOC\n"; - f << "#define GUTIL_FILE_TOC\n"; - f << "namespace gutil {\n"; - f << "struct FileToc {\n"; - f << " const char* name; // the file's original name\n"; - f << " const char* data; // beginning of the file\n"; - f << " std::size_t size; // length of the file\n"; - f << "};\n"; - f << "} // namespace gutil\n"; - f << "#endif // GUTIL_FILE_TOC\n"; -} - -bool GenerateHeader(const std::string& header_file, - const std::vector& toc_files) { - std::ofstream f(header_file, std::ios::out | std::ios::trunc); - f << "#pragma once\n"; // Pragma once isn't great but is the best we can do. - f << "#include \n"; - GenerateTocStruct(f); - GenerateNamespaceOpen(f); - f << "extern const struct ::gutil::FileToc* " - << absl::GetFlag(FLAGS_identifier) << "_create();\n"; - f << "static inline std::size_t " << absl::GetFlag(FLAGS_identifier) - << "_size() { \n"; - f << " return " << toc_files.size() << ";\n"; - f << "}\n"; - GenerateNamespaceClose(f); - f.close(); - return f.good(); -} - -bool SlurpFile(const std::string& file_name, std::string* contents) { - constexpr std::streamoff kMaxSize = 100000000; - std::ifstream f(file_name, std::ios::in | std::ios::binary); - // get length of file: - f.seekg(0, f.end); - std::streamoff length = f.tellg(); - f.seekg(0, f.beg); - if (!f.good()) return false; - - if (length > kMaxSize) { - std::cerr << "File " << file_name << " is too large\n"; - return false; - } - - size_t mem_length = static_cast(length); - contents->resize(mem_length); - f.read(&(*contents)[0], mem_length); - f.close(); - return f.good(); -} - -bool GenerateImpl(const std::string& impl_file, - const std::vector& input_files, - const std::vector& toc_files) { - std::ofstream f(impl_file, std::ios::out | std::ios::trunc); - f << "#include \n"; - GenerateTocStruct(f); - GenerateNamespaceOpen(f); - for (size_t i = 0, e = input_files.size(); i < e; ++i) { - f << "alignas(alignof(void*)) static char const file_" << i << "[] = {\n"; - std::string contents; - if (!SlurpFile(input_files[i], &contents)) { - std::cerr << "Error reading file " << input_files[i] << "\n"; - return false; - } - absl::string_view remaining_contents = contents; - constexpr int kMaxBytesPerLine = 1024; - while (!remaining_contents.empty()) { - auto line = remaining_contents.substr(0, kMaxBytesPerLine); - f << "\"" << absl::CHexEscape(line) << "\"\n"; - remaining_contents = remaining_contents.substr(line.size()); - } - f << "};\n"; - } - f << "static const struct ::gutil::FileToc toc[] = {\n"; - assert(input_files.size() == toc_files.size()); - for (size_t i = 0, e = input_files.size(); i < e; ++i) { - f << " {\n"; - f << " \"" << absl::CEscape(toc_files[i]) << "\",\n"; - f << " file_" << i << ",\n"; - f << " sizeof(file_" << i << ") - 1\n"; - f << " },\n"; - } - f << " {nullptr, nullptr, 0},\n"; - f << "};\n"; - f << "const struct ::gutil::FileToc* " << absl::GetFlag(FLAGS_identifier) - << "_create() {\n"; - f << " return &toc[0];\n"; - f << "}\n"; - - GenerateNamespaceClose(f); - f.close(); - return f.good(); -} - -int main(int argc, char** argv) { - // Parse flags. - std::vector raw_positional_args = absl::ParseCommandLine(argc, argv); - std::vector input_files; - input_files.reserve(raw_positional_args.size() - 1); - // Skip program name. - for (size_t i = 1, e = raw_positional_args.size(); i < e; ++i) { - input_files.push_back(std::string(raw_positional_args[i])); - } - - // Generate TOC files by optionally removing a prefix. - std::vector toc_files; - toc_files.reserve(input_files.size()); - const std::string& strip_prefix = absl::GetFlag(FLAGS_strip_prefix); - for (const auto& input_file : input_files) { - std::string toc_file = input_file; - if (!strip_prefix.empty()) { - toc_file = std::string(absl::StripPrefix(toc_file, strip_prefix)); - } - if (absl::GetFlag(FLAGS_flatten)) { - std::vector comps = - absl::StrSplit(toc_file, absl::ByAnyChar("/\\")); - toc_file = comps.back(); - } - toc_files.push_back(toc_file); - } - - if (!absl::GetFlag(FLAGS_output_header).empty()) { - if (!GenerateHeader(absl::GetFlag(FLAGS_output_header), toc_files)) { - std::cerr << "Error generating headers.\n"; - return 1; - } - } - - if (!absl::GetFlag(FLAGS_output_impl).empty()) { - if (!GenerateImpl(absl::GetFlag(FLAGS_output_impl), input_files, - toc_files)) { - std::cerr << "Error generating impl.\n"; - return 2; - } - } - - return 0; -} diff --git a/gutil/gutil/io.cc b/gutil/gutil/io.cc deleted file mode 100644 index 67a003357..000000000 --- a/gutil/gutil/io.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/io.h" - -#include -#include -#include -#include - -#include "absl/strings/str_format.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -namespace { - -absl::Status ErrorNoToAbsl(const char* operation, const std::string& path) { - switch (errno) { - case EACCES: - case ENOENT: - return absl::NotFoundError( - absl::StrFormat("%s: %s", strerror(errno), path)); - default: - return absl::UnknownError(absl::StrFormat("Cannot %s file %s, errno = %d", - operation, path, errno)); - } -} - -} // namespace - -absl::StatusOr ReadFile(const std::string& path) { - std::ifstream f; - f.open(path.c_str()); - if (f.fail()) { - return ErrorNoToAbsl("open", path); - } - f >> std::noskipws; // Read whitespaces. - std::string result(std::istreambuf_iterator(f), - (std::istreambuf_iterator())); - if (f.bad()) { - return ErrorNoToAbsl("read", path); - } - f.close(); - return result; -} - -absl::StatusOr> ReadFileLines( - const std::string& path) { - std::ifstream f; - f.open(path.c_str()); - if (f.fail()) { - return ErrorNoToAbsl("open", path); - } - std::vector results; - std::string line; - while (std::getline(f, line)) { - results.push_back(line); - } - if (f.bad()) { - return ErrorNoToAbsl("read", path); - } - f.close(); - return results; -} - -absl::Status WriteFile(const std::string& content, const std::string& path) { - std::ofstream f; - f.open(path.c_str()); - if (f.fail()) { - return ErrorNoToAbsl("open", path); - } - f << content; - f.close(); - if (f.bad()) { - return ErrorNoToAbsl("write", path); - } - return absl::OkStatus(); -} - -} // namespace gutil diff --git a/gutil/gutil/io.h b/gutil/gutil/io.h deleted file mode 100644 index 55e83a5b3..000000000 --- a/gutil/gutil/io.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_IO_H_ -#define PINS_GUTIL_GUTIL_IO_H_ - -#include - -#include "absl/status/status.h" -#include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -// Reads the entire content of the file and returns it (or an error status). -absl::StatusOr ReadFile(const std::string& path); - -// Reads the entire content of the file and returns as a vector of individual -// lines (or an error status). -absl::StatusOr> ReadFileLines(const std::string& path); - -// Writes the content of the string to the file. -absl::Status WriteFile(const std::string& content, const std::string& path); - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_IO_H_ diff --git a/gutil/gutil/io_test.cc b/gutil/gutil/io_test.cc deleted file mode 100644 index 2fcf3c03e..000000000 --- a/gutil/gutil/io_test.cc +++ /dev/null @@ -1,63 +0,0 @@ -#include "gutil/gutil/io.h" - -#include -#include - -#include "absl/strings/str_split.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" - -namespace gutil { -namespace { - -const std::string& TestDir() { - static const auto* const kTestDir = - new std::string(std::getenv("TEST_TMPDIR")); - return *kTestDir; -} - -TEST(IoTest, CanReadAndWrite) { - const std::string kFilename = TestDir() + "/can_read_and_write.txt"; - const std::string kInput = R"( - hello, I am a string. - I have words, I have breaks. - I have punctuation. - I am a very nice string. - Please read me. - )"; - ASSERT_OK(WriteFile(kInput, kFilename)); - ASSERT_THAT(ReadFile(kFilename), gutil::IsOkAndHolds(testing::Eq(kInput))); -} - -TEST(IoTest, CanReadLines) { - const std::string kFilename = TestDir() + "/can_read_lines.txt"; - const std::string kInput = R"( - hello, I am a string. - I have words, I have breaks. - I have punctuation. - I am a very nice string. - Please read me. - )"; - std::vector expected_lines = absl::StrSplit(kInput, '\n'); - - ASSERT_OK(WriteFile(kInput, kFilename)); - ASSERT_THAT(ReadFileLines(kFilename), - gutil::IsOkAndHolds(testing::ElementsAreArray(expected_lines))); -} - -TEST(IoTest, WriteFailsWithNonexistentDirectory) { - const std::string kFilename = - TestDir() + "/non_directory/write_fails_with_nonexistent_directory.txt"; - EXPECT_FALSE(WriteFile("text", kFilename).ok()); -} - -TEST(IoTest, ReadFailsWithNonexistentFile) { - const std::string kFilename = - TestDir() + "/read_fails_with_nonexistent_file.txt"; - EXPECT_FALSE(ReadFile(kFilename).ok()); - EXPECT_FALSE(ReadFileLines(kFilename).ok()); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/overload.h b/gutil/gutil/overload.h deleted file mode 100644 index d3b3e6e18..000000000 --- a/gutil/gutil/overload.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_OVERLOADED_H_ -#define PINS_GUTIL_GUTIL_OVERLOADED_H_ - -#include - -namespace gutil { - -// Useful in conjunction with {std,absl}::visit. -// See https://en.cppreference.com/w/cpp/utility/variant/visit. -template -struct Overload : Ts... { - using Ts::operator()...; - // Before C++20, we need a constructor to allow for using parenthesis instead - // of curly braces. - explicit Overload(Ts... ts) : Ts(std::move(ts))... {} -}; -template -Overload(Ts...) -> Overload; - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_OVERLOADED_H_ diff --git a/gutil/gutil/proto.cc b/gutil/gutil/proto.cc deleted file mode 100644 index 5889057e6..000000000 --- a/gutil/gutil/proto.cc +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/proto.h" - -#include - -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/string_view.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/io/zero_copy_stream_impl.h" -#include "google/protobuf/message.h" -#include "google/protobuf/text_format.h" -#include "gutil/gutil/proto_string_error_collector.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -bool IsEmptyProto(const google::protobuf::Message& message) { - return message.ByteSizeLong() == 0; -} - -absl::Status ReadProtoFromFile(absl::string_view filename, - google::protobuf::Message* message) { - // Verifies that the version of the library that we linked against is - // compatible with the version of the headers we compiled against. - GOOGLE_PROTOBUF_VERIFY_VERSION; - - int fd = open(std::string(filename).c_str(), O_RDONLY); - if (fd < 0) { - return InvalidArgumentErrorBuilder() - << "Error opening the file " << filename; - } - - google::protobuf::io::FileInputStream file_stream(fd); - file_stream.SetCloseOnDelete(true); - - if (!google::protobuf::TextFormat::Parse(&file_stream, message)) { - return InvalidArgumentErrorBuilder() << "Failed to parse file " << filename; - } - - return absl::OkStatus(); -} - -absl::Status ReadProtoFromString(absl::string_view proto_string, - google::protobuf::Message* message) { - // Verifies that the version of the library that we linked against is - // compatible with the version of the headers we compiled against. - GOOGLE_PROTOBUF_VERIFY_VERSION; - - google::protobuf::TextFormat::Parser parser; - std::string all_errors; - StringErrorCollector collector(&all_errors); - parser.RecordErrorsTo(&collector); - - if (!parser.ParseFromString(std::string(proto_string), message)) { - return InvalidArgumentErrorBuilder() - << "string <" << proto_string << "> did not parse as a" - << message->GetTypeName() << ":\n" - << all_errors; - } - - return absl::OkStatus(); -} - -absl::Status SaveProtoToFile(absl::string_view filename, - const google::protobuf::Message& message) { - // Verifies that the version of the library that we linked against is - // compatible with the version of the headers we compiled against. - GOOGLE_PROTOBUF_VERIFY_VERSION; - int fd = - open(std::string(filename).c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd < 0) { - return InvalidArgumentErrorBuilder() - << "Error opening the file " << filename; - } - - google::protobuf::io::FileOutputStream file_stream(fd); - file_stream.SetCloseOnDelete(true); - - if (!google::protobuf::TextFormat::Print(message, &file_stream)) { - return InvalidArgumentErrorBuilder() - << "Failed to print proto to file " << filename; - } - - file_stream.Flush(); - return absl::OkStatus(); -} - -absl::StatusOr ProtoDiff( - const google::protobuf::Message& message1, - const google::protobuf::Message& message2, - google::protobuf::util::MessageDifferencer differ) { - if (message1.GetDescriptor() != message2.GetDescriptor()) { - return gutil::InvalidArgumentErrorBuilder() - << "cannot compute diff for messages of incompatible descriptors `" - << message1.GetDescriptor()->full_name() << "' vs '" - << message2.GetDescriptor()->full_name() << "'"; - } - - std::string diff; - differ.ReportDifferencesToString(&diff); - differ.Compare(message1, message2); - return diff; -} - -bool ProtoEqual(const google::protobuf::Message& message1, - const google::protobuf::Message& message2, - google::protobuf::util::MessageDifferencer& differ) { - if (message1.GetDescriptor() != message2.GetDescriptor()) { - return false; - } - return differ.Compare(message1, message2); -} - -// Calls `ProtoEqual` with default `MessageDifferencer`. -bool ProtoEqual(const google::protobuf::Message& message1, - const google::protobuf::Message& message2) { - google::protobuf::util::MessageDifferencer differ = - google::protobuf::util::MessageDifferencer(); - return ProtoEqual(message1, message2, differ); -} - -absl::StatusOr GetOneOfFieldName( - const google::protobuf::Message& message, const std::string& oneof_name) { - const auto* oneof_descriptor = - message.GetDescriptor()->FindOneofByName(oneof_name); - const auto* field = message.GetReflection()->GetOneofFieldDescriptor( - message, oneof_descriptor); - if (!field) { - return gutil::NotFoundErrorBuilder() - << "Oneof field \"" << oneof_name << "\" is not set"; - } - return std::string(field->name()); -} - -std::string PrintTextProto(const google::protobuf::Message& message) { - std::string message_text; - - google::protobuf::TextFormat::Printer printer; - printer.SetExpandAny(true); - - printer.PrintToString(message, &message_text); - - return message_text; -} - -// Print proto in TextFormat with single line mode enabled. -std::string PrintShortTextProto(const google::protobuf::Message& message) { - std::string message_short_text; - - google::protobuf::TextFormat::Printer printer; - printer.SetSingleLineMode(true); - printer.SetExpandAny(true); - - printer.PrintToString(message, &message_short_text); - // Single line mode currently might have an extra space at the end. - if (!message_short_text.empty() && message_short_text.back() == ' ') { - message_short_text.pop_back(); - } - - return message_short_text; -} - -absl::StatusOr SerializeProtoAsJson( - const google::protobuf::Message& proto) { - std::string json; - RETURN_IF_ERROR(gutil::ToAbslStatus( - google::protobuf::util::MessageToJsonString(proto, &json))); - return json; -} - -} // namespace gutil diff --git a/gutil/gutil/proto.h b/gutil/gutil/proto.h deleted file mode 100644 index 7e3099026..000000000 --- a/gutil/gutil/proto.h +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_PROTO_H_ -#define PINS_GUTIL_GUTIL_PROTO_H_ - -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/string_view.h" -#include "google/protobuf/message.h" -#include "google/protobuf/util/json_util.h" -#include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -// Returns `true` if the given `message` has no fields set, `false` otherwise. -bool IsEmptyProto(const google::protobuf::Message& message); - -// Read the contents of the file into a protobuf. -absl::Status ReadProtoFromFile(absl::string_view filename, - google::protobuf::Message* message); - -// Read the contents of the string into a protobuf. -absl::Status ReadProtoFromString(absl::string_view proto_string, - google::protobuf::Message* message); - -// Saves the content of a protobuf into a file. -absl::Status SaveProtoToFile(absl::string_view filename, - const google::protobuf::Message& message); - -// Read the contents of the given string into a protobuf and returns it. -template -absl::StatusOr ParseTextProto(absl::string_view proto_string) { - T message; - RETURN_IF_ERROR(ReadProtoFromString(proto_string, &message)); - return message; -} - -// Returns diff of the given protobuf messages, provided they have the same -// `Descriptor` (message1.GetDescriptor() == message2.GetDescriptor()), or -// returns `InvalidArgumentError` otherwise. -// Optionally, a `differ` can be provided for fine-grained control over how to -// compute the diff. -absl::StatusOr ProtoDiff( - const google::protobuf::Message& message1, - const google::protobuf::Message& message2, - google::protobuf::util::MessageDifferencer differ = - google::protobuf::util::MessageDifferencer()); - -// Similar to `ProtoDiff`, execpt returns boolean result of equality comparison. -bool ProtoEqual(const google::protobuf::Message& message1, - const google::protobuf::Message& message2, - google::protobuf::util::MessageDifferencer& differ); - -bool ProtoEqual(const google::protobuf::Message& message1, - const google::protobuf::Message& message2); - -// Get the name of the oneof enum that is set. -// Eg: -// message IrValue { -// oneof format { -// string hex_str = 1; -// string ipv4 = 2; -// string ipv6 = 3; -// string mac = 4; -// string str = 5; -// } -// } -// IrValue value; -// value.set_hex_str("0xf00d"); -// std::string name = GetOneOfFieldName(value, std::string("format")); -// EXPECT_EQ(name, "hex_str"); -absl::StatusOr GetOneOfFieldName( - const google::protobuf::Message& message, const std::string& oneof_name); - -// Print proto in TextFormat. -std::string PrintTextProto(const google::protobuf::Message& message); - -// Print proto in TextFormat in a single line. -std::string PrintShortTextProto(const google::protobuf::Message& message); - -// Parses the given JSON string into a proto of type `T`. -template -absl::StatusOr ParseJsonAsProto(absl::string_view raw_json_string, - bool ignore_unknown_fields = false); - -// Serializes the given proto message as a JSON string. -absl::StatusOr SerializeProtoAsJson( - const google::protobuf::Message& proto); - -// -- END OF PUBLIC INTERFACE - Implementation details follow ------------------ - -template -absl::StatusOr ParseJsonAsProto(absl::string_view raw_json_string, - bool ignore_unknown_fields) { - google::protobuf::util::JsonParseOptions options; - options.ignore_unknown_fields = ignore_unknown_fields; - T proto; - // OS protobuf uses its own `Status`-like and `string_view`-like classes, so - // some gymnastics are required here: - // - ToAbslStatus converts any `Status`-like type to an absl::Status. - // - We pass in `{raw_json_string.data(), raw_json_string.size()}` instead of - // `raw_json_string`, constructing a new object of the appropriate - // `string_view`-like type implicitly. - RETURN_IF_ERROR( - gutil::ToAbslStatus(google::protobuf::util::JsonStringToMessage( - {raw_json_string.data(), raw_json_string.size()}, &proto, options))); - return proto; -} - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_PROTO_H_ diff --git a/gutil/gutil/proto_matchers.h b/gutil/gutil/proto_matchers.h deleted file mode 100644 index 4b8b50c89..000000000 --- a/gutil/gutil/proto_matchers.h +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_PROTO_MATCHERS_H_ -#define PINS_GUTIL_PROTO_MATCHERS_H_ - -#include -#include -#include - -#include "absl/log/log.h" -#include "absl/strings/string_view.h" -#include "gmock/gmock.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/message.h" -#include "google/protobuf/util/message_differencer.h" -#include "gtest/gtest.h" -#include "gutil/gutil/proto.h" - -namespace gutil { - -// -- EqualsProto matcher ------------------------------------------------------ - -// Implements a protobuf matcher interface that verifies 2 protobufs are equal -// while ignoring the repeated field ordering. -// -// Sample usage: -// EXPECT_THAT(MyCall(), EqualsProto(R"pb( -// table_name: "ROUTER_INTERFACE_TABLE" -// priority: 123 -// matches { -// name: "router_interface_id" -// exact { str: "16" } -// } -// )pb")); -// -// Sample output on failure: -// Value of: MyCall() -// Expected: -// table_name: "ROUTER_INTERFACE_TABLE" -// matches { -// name: "router_interface_id" -// exact { -// str: "16" -// } -// } -// priority: 123 -// -// Actual: 96-byte object <58-AC 77-4D 5C-55 00-00 00-00 00-00 00-00 00-00 -// 00-00 00-00 00-00 00-00 01-00 00-00 04-00 00-00 30-8D 80-4D 5C-55 00-00 -// 30-55 80-4D 5C-55 00-00 20-25 79-4D 5C-55 00-00 00-00 00-00 00-00 00-00 -// 00-00 00-00 00-00 00-00 C8-01 00-00 5C-55 00-00 00-E6 12-7F 70-7F 00-00 -// 00-00 00-00 00-00 00-00> (of type pdpi::IrTableEntry), -// table_name: "ROUTER_INTERFACE_TABLE" -// matches { -// name: "router_interface_id" -// exact { -// str: "16" -// } -// } -// priority: 456 -class ProtobufEqMatcher { - public: - ProtobufEqMatcher(const google::protobuf::Message& expected) - : expected_(expected.New()), expected_text_(PrintTextProto(expected)) { - expected_->CopyFrom(expected); - } - ProtobufEqMatcher(absl::string_view expected_text) - : expected_text_{expected_text} {} - - void DescribeTo(std::ostream* os, bool negated) const { - *os << "is " << (negated ? "not " : "") << "equal to " - << (expected_ == nullptr ? "" - : absl::StrCat(expected_->GetTypeName(), " ")) - << "<\n" - << expected_text_ << ">"; - } - void DescribeTo(std::ostream* os) const { return DescribeTo(os, false); } - void DescribeNegationTo(std::ostream* os) const { - return DescribeTo(os, true); - } - - template - bool MatchAndExplain(const ProtoType& actual, - ::testing::MatchResultListener* listener) const { - std::string diff; - google::protobuf::util::MessageDifferencer differ; - differ.set_scope(comparison_scope_); - differ.ReportDifferencesToString(&diff); - // Order does not matter for repeated fields. - differ.set_repeated_field_comparison( - google::protobuf::util::MessageDifferencer::RepeatedFieldComparison:: - AS_SET); - - // When parsing from a proto text string we must first create a temporary - // with the same proto type as the "acutal" argument. - if (expected_ == nullptr) { - absl::StatusOr expected = - gutil::ParseTextProto(expected_text_); - if (expected.ok()) { - expected_ = std::make_shared(std::move(*expected)); - } else { - *listener << "where the expected proto " << expected.status().message(); - return false; - } - } - - // Otherwise we can compare directly with the passed protobuf message. - bool equal = differ.Compare(*expected_, actual); - if (!equal) { - *listener << "with diff:\n" << diff; - } - return equal; - } - void SetComparePartially() { - comparison_scope_ = google::protobuf::util::MessageDifferencer::PARTIAL; - } - - private: - mutable std::shared_ptr expected_; - std::string expected_text_; - google::protobuf::util::MessageDifferencer::Scope comparison_scope_ = - google::protobuf::util::MessageDifferencer::FULL; -}; - -inline ::testing::PolymorphicMatcher EqualsProto( - const google::protobuf::Message& proto) { - return ::testing::MakePolymorphicMatcher(ProtobufEqMatcher(proto)); -} - -inline ::testing::PolymorphicMatcher EqualsProto( - absl::string_view proto_text) { - return ::testing::MakePolymorphicMatcher(ProtobufEqMatcher(proto_text)); -} - -// Checks that a pair of protos are equal. Useful in combination with -// `Pointwise`. -MATCHER(EqualsProto, "is a pair of equal protobufs") { - const auto& [x, y] = arg; - return testing::ExplainMatchResult(EqualsProto(x), y, result_listener); -} - -// Checks that a sequences of protos is equal to a given sequence. -template -auto EqualsProtoSequence(T&& sequence) { - return testing::Pointwise(EqualsProto(), std::forward(sequence)); -} - -// -- HasOneofCaseMatcher matcher ---------------------------------------------- - -template -class HasOneofCaseMatcher { - public: - using is_gtest_matcher = void; - using OneofCase = int; - HasOneofCaseMatcher(absl::string_view oneof_name, - OneofCase expected_oneof_case) - : oneof_name_{oneof_name}, expected_oneof_case_(expected_oneof_case) {} - - void DescribeTo(std::ostream* os, bool negate) const { - if (os == nullptr) return; - *os << "is a `" << GetMessageDescriptor().full_name() - << "` protobuf message whose oneof field `" << oneof_name_ << "`"; - if (negate) { - *os << " does not have case "; - } else { - *os << " has case "; - } - *os << "`" << GetOneofCaseName(expected_oneof_case_) << "`"; - } - void DescribeTo(std::ostream* os) const { DescribeTo(os, false); } - void DescribeNegationTo(std::ostream* os) const { DescribeTo(os, true); } - - bool MatchAndExplain(const ProtoMessage& message, - testing::MatchResultListener* listener) const { - const google::protobuf::Message& m = message; - const google::protobuf::FieldDescriptor* set_oneof_field = - m.GetReflection()->GetOneofFieldDescriptor(m, GetOneofDescriptor()); - *listener << "the oneof `" << oneof_name_ << "` is "; - if (set_oneof_field == nullptr) { - *listener << "unset"; - return false; - } else { - *listener << "set to `" << set_oneof_field->name() << "`"; - return set_oneof_field->number() == expected_oneof_case_; - } - } - - private: - std::string oneof_name_; - OneofCase expected_oneof_case_; - - const google::protobuf::Descriptor& GetMessageDescriptor() const { - auto* descriptor = ProtoMessage::descriptor(); - if (descriptor == nullptr) { - LOG(FATAL) // Crash ok: test - << "ProtoMessage::descriptor() returned null."; - } - return *descriptor; - } - const google::protobuf::OneofDescriptor* GetOneofDescriptor() const { - return GetMessageDescriptor().FindOneofByName(oneof_name_); - } - const google::protobuf::FieldDescriptor* GetOneofCaseDescriptor( - OneofCase oneof_case) const { - return GetMessageDescriptor().FindFieldByNumber(oneof_case); - } - std::string GetOneofCaseName(OneofCase oneof_case) const { - const google::protobuf::FieldDescriptor* descriptor = - GetOneofCaseDescriptor(oneof_case); - return descriptor == nullptr ? "" - : std::string(descriptor->name()); - } -}; - -// Protobuf matcher that checks if the oneof field with the given `oneof_name` -// is set to the given `expected_oneof_case`. -// That is, checks `proto.oneof_name_case() == expected_oneof_case`. -// -// Sample usage: -// ``` -// EXPECT_THAT(packet.headers(0), -// HasOneofCase( -// "header", packetlib::Header::kIpv4Header)); -// ``` -template -HasOneofCaseMatcher HasOneofCase(absl::string_view oneof_name, - int expected_oneof_case) { - return HasOneofCaseMatcher(oneof_name, expected_oneof_case); -} - -// Partially(m) returns a matcher that is the same as m, except that -// only fields present in the expected protobuf are considered (using -// google::protobuf::util::MessageDifferencer's PARTIAL comparison option). For -// example, Partially(EqualsProto(p)) will ignore any field that's -// not set in p when comparing the protobufs. The inner matcher m can -// be any of the Equals* and EquivTo* protobuf matchers above. -template -inline InnerProtoMatcher Partially(InnerProtoMatcher inner_proto_matcher) { - inner_proto_matcher.mutable_impl().SetComparePartially(); - return inner_proto_matcher; -} - -} // namespace gutil - -#endif // PINS_GUTIL_PROTO_MATCHERS_H_ diff --git a/gutil/gutil/proto_matchers_test.cc b/gutil/gutil/proto_matchers_test.cc deleted file mode 100644 index c0714c1ad..000000000 --- a/gutil/gutil/proto_matchers_test.cc +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include "proto_matchers.h" - -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/proto_test.pb.h" -#include "gutil/gutil/testing.h" - -namespace gutil { -namespace { - -using ::testing::Not; - -TEST(ProtoMatcher, EqualsProto) { - TestMessage message; - message.set_int_field(123); - message.set_string_field("foo"); - message.set_bool_field(true); - - EXPECT_THAT(message, EqualsProto(message)); -} - -TEST(ProtoMatcher, EqualsProtoFromText) { - TestMessage message; - message.set_int_field(123); - message.set_string_field("foo"); - message.set_bool_field(true); - - EXPECT_THAT(message, EqualsProto(R"pb(int_field: 123 - string_field: "foo" - bool_field: true)pb")); -} - -TEST(ProtoMatcher, DescribeEqualsProto) { - auto matcher = EqualsProto(gutil::ParseProtoOrDie(R"pb( - int_field: 123 - string_field: "foo" - bool_field: true - )pb")); - - EXPECT_EQ(testing::DescribeMatcher(matcher), - R"(is equal to gutil.TestMessage < -int_field: 123 -string_field: "foo" -bool_field: true ->)"); - EXPECT_EQ(testing::DescribeMatcher(Not(matcher)), - R"(is not equal to gutil.TestMessage < -int_field: 123 -string_field: "foo" -bool_field: true ->)"); -} - -TEST(ProtoMatcher, DescribeEqualsProtoFromText) { - std::string text = - R"pb(int_field: 123 string_field: "foo" bool_field: true)pb"; - auto matcher = EqualsProto(text); - - EXPECT_EQ(testing::DescribeMatcher(matcher), - R"(is equal to < -int_field: 123 string_field: "foo" bool_field: true>)"); - EXPECT_EQ(testing::DescribeMatcher(Not(matcher)), - R"(is not equal to < -int_field: 123 string_field: "foo" bool_field: true>)"); -} - -TEST(BinaryEqualsProtoTest, EqualPairWorks) { - auto arbitrary_proto_1 = ParseProtoOrDie("int_field: 24"); - EXPECT_THAT(std::make_pair(arbitrary_proto_1, arbitrary_proto_1), - EqualsProto()); - - auto arbitrary_proto_2 = ParseProtoOrDie("string_field: \"hi\""); - EXPECT_THAT(std::make_pair(arbitrary_proto_2, arbitrary_proto_2), - EqualsProto()); -} - -TEST(BinaryEqualsProtoTest, UnequalPairWorks) { - auto arbitrary_proto_1 = ParseProtoOrDie("int_field: 24"); - auto arbitrary_proto_2 = ParseProtoOrDie("string_field: \"hi\""); - EXPECT_THAT(std::make_pair(arbitrary_proto_1, arbitrary_proto_2), - Not(EqualsProto())); - EXPECT_THAT(std::make_pair(arbitrary_proto_2, arbitrary_proto_1), - Not(EqualsProto())); -} - -TEST(BinaryEqualsProtoTest, WorksWithPointwiseMatcher) { - std::vector protos = { - ParseProtoOrDie("int_field: 24"), - ParseProtoOrDie("string_field: \"hi\""), - }; - EXPECT_THAT(protos, testing::Pointwise(EqualsProto(), protos)); -} - -TEST(BinaryEqualsProtoTest, DescribeBinaryEqualsProto) { - auto matcher = EqualsProto(); - EXPECT_EQ( - (testing::DescribeMatcher>(matcher)), - "is a pair of equal protobufs"); -} - -TEST(EqualsProtoSequenceTest, EqualSequencesWork) { - std::vector protos = { - ParseProtoOrDie("int_field: 24"), - ParseProtoOrDie("string_field: \"hi\""), - }; - EXPECT_THAT(protos, EqualsProtoSequence(protos)); -} - -TEST(EqualsProtoSequenceTest, UnequalSequencesWork) { - std::vector protos1 = { - ParseProtoOrDie("int_field: 24"), - ParseProtoOrDie("string_field: \"hi\""), - }; - std::vector protos2 = { - ParseProtoOrDie("int_field: 42"), - }; - EXPECT_THAT(protos1, Not(EqualsProtoSequence(protos2))); -} - -TEST(PartiallyMatcherTest, IdenticalProtosAreAlsoPartiallyEqual) { - TestMessage message; - message.set_int_field(123); - - EXPECT_THAT(message, Partially(EqualsProto(message))); -} - -TEST(PartiallyMatcherTest, PartiallyEqualsProtoOnlyComparePresentFields) { - TestMessage message; - message.set_int_field(123); - - EXPECT_THAT(message, Partially(EqualsProto(R"pb( - int_field: 123)pb"))); -} - -TEST(PartiallyMatcherTest, DifferentlProtosDoNotMatch) { - TestMessage message; - message.set_int_field(123); - message.set_string_field("foo"); - - // Proto differs in one field and remains the same for another field does not - // match. - EXPECT_THAT(message, Not(Partially(EqualsProto(R"pb( - int_field: 1234 - string_field: "foo")pb")))); - // Proto differs in both fields should not match. - EXPECT_THAT(message, Not(Partially(EqualsProto(R"pb( - int_field: 1234 - string_field: "bar")pb")))); -} - -TEST(HasOneofCaseTest, NotHasOneofCase) { - EXPECT_THAT(gutil::ParseProtoOrDie(R"pb()pb"), - Not(HasOneofCase( - "foo", TestMessageWithOneof::kStringFoo))); - EXPECT_THAT(gutil::ParseProtoOrDie(R"pb( - int_foo: 42 - )pb"), - Not(HasOneofCase( - "foo", TestMessageWithOneof::kStringFoo))); - EXPECT_THAT(gutil::ParseProtoOrDie(R"pb( - int_foo: 42 - )pb"), - Not(HasOneofCase( - "foo", TestMessageWithOneof::kBoolFoo))); -} - -TEST(HasOneofCaseTest, DoesHaveOneofCase) { - EXPECT_THAT(gutil::ParseProtoOrDie(R"pb( - string_foo: "hi" - )pb"), - HasOneofCase( - "foo", TestMessageWithOneof::kStringFoo)); - EXPECT_THAT( - gutil::ParseProtoOrDie(R"pb( - int_foo: 42 - )pb"), - HasOneofCase("foo", TestMessageWithOneof::kIntFoo)); - EXPECT_THAT(gutil::ParseProtoOrDie(R"pb( - bool_foo: false - )pb"), - HasOneofCase( - "foo", TestMessageWithOneof::kBoolFoo)); -} - -TEST(HasOneofCaseTest, Description) { - auto matcher = HasOneofCase( - "foo", TestMessageWithOneof::kStringFoo); - EXPECT_EQ(testing::DescribeMatcher(matcher), - "is a `gutil.TestMessageWithOneof` protobuf message whose oneof " - "field `foo` has case `string_foo`"); - EXPECT_EQ(testing::DescribeMatcher(Not(matcher)), - "is a `gutil.TestMessageWithOneof` protobuf message whose oneof " - "field `foo` does not have case `string_foo`"); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/proto_ordering.cc b/gutil/gutil/proto_ordering.cc deleted file mode 100644 index d149a86a2..000000000 --- a/gutil/gutil/proto_ordering.cc +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/proto_ordering.h" - -#include "google/protobuf/message.h" -#include "gutil/gutil/proto.h" - -namespace gutil { - -bool InefficientProtoLessThan(const google::protobuf::Message& message1, - const google::protobuf::Message& message2) { - return PrintTextProto(message1) < PrintTextProto(message2); -} - -} // namespace gutil diff --git a/gutil/gutil/proto_ordering.h b/gutil/gutil/proto_ordering.h deleted file mode 100644 index db548d709..000000000 --- a/gutil/gutil/proto_ordering.h +++ /dev/null @@ -1,85 +0,0 @@ -// Functions for sorting, ordering, and deduplicating Protobuf messages. - -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_PROTO_ORDERING_H_ -#define PINS_GUTIL_GUTIL_PROTO_ORDERING_H_ - -#include -#include - -#include "absl/algorithm/container.h" -#include "absl/types/span.h" -#include "google/protobuf/message.h" -#include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/proto.h" - -namespace gutil { - -// A strict total order (`<`) on proto messages. The order is not semantically -// meaningful, but can be useful for operations such as sorting. -// -// CAUTION: This function is very inefficient and must only be used in -// performance-insensitive settings. -bool InefficientProtoLessThan(const google::protobuf::Message& message1, - const google::protobuf::Message& message2); - -// Sorts the given sequence of `messages` with respect to an arbitrary, but -// deterministic order. -// -// CAUTION: This function is very inefficient and must only be used in -// performance-insensitive settings. -template -void InefficientProtoSort(ProtoSequence& messages); - -// Sorts the given sequence of `messages` with respect to an arbitrary, but -// deterministic order, and removes all duplicate messages. -// -// CAUTION: This function is very inefficient and must only be used in -// performance-insensitive settings. -template -void InefficientProtoSortAndDedup(ProtoSequence& messages); - -// == END OF PUBLIC INTERFACE ================================================== - -template -void InefficientProtoSort(ProtoSequence& messages) { - absl::c_stable_sort(messages, InefficientProtoLessThan); -} - -// Helper to obtain back inserter of a given `Container`. Essentially a drop-in -// replacement for `std::back_inserter` that also works for repeated protobuf -// fields. -template -auto BackInserter(Container& c) { - return std::back_inserter(c); -} -template -auto BackInserter(google::protobuf::RepeatedPtrField& c) { - return google::protobuf::RepeatedPtrFieldBackInserter(&c); -} - -template -void InefficientProtoSortAndDedup(ProtoSequence& messages) { - InefficientProtoSort(messages); - ProtoSequence tmp; - std::swap(messages, tmp); - absl::c_unique_copy(tmp, BackInserter(messages), - google::protobuf::util::MessageDifferencer::Equals); -} - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_PROTO_ORDERING_H_ diff --git a/gutil/gutil/proto_ordering_test.cc b/gutil/gutil/proto_ordering_test.cc deleted file mode 100644 index 617b4a72f..000000000 --- a/gutil/gutil/proto_ordering_test.cc +++ /dev/null @@ -1,195 +0,0 @@ -#include "gutil/gutil/proto_ordering.h" - -#include - -#include "gmock/gmock.h" -#include "google/protobuf/repeated_ptr_field.h" -#include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/proto_test.pb.h" -#include "gutil/gutil/testing.h" - -namespace gutil { -namespace { - -using ::testing::Not; -using ::testing::UnorderedElementsAre; - -// Returns a `TestMessage` protobuf that is distinct from -// `ArbitraryProtoMessage2()` and `ArbitraryProtoMessage3()` but otherwise -// arbitrary. -TestMessage ArbitraryProtoMessage1() { - return ParseProtoOrDie(R"pb( - int_field: 42 string_field: "hello!" - )pb"); -} - -// Returns a `TestMessage` protobuf that is distinct from -// `ArbitraryProtoMessage1()` and `ArbitraryProtoMessage3()` but otherwise -// arbitrary. -TestMessage ArbitraryProtoMessage2() { - return ParseProtoOrDie(R"pb( - int_field: 42 string_field: "bye" - )pb"); -} - -// Returns a `TestMessage` protobuf that is distinct from -// `ArbitraryProtoMessage1()` and `ArbitraryProtoMessage2()` but otherwise -// arbitrary. -TestMessage ArbitraryProtoMessage3() { - return ParseProtoOrDie(R"pb( - int_field: 12 string_field: "ciao" - )pb"); -} - -TEST(InefficientProtoLessThan, ReturnsFalseForEqualMessages) { - EXPECT_FALSE(InefficientProtoLessThan(ArbitraryProtoMessage1(), - ArbitraryProtoMessage1())); - EXPECT_FALSE(InefficientProtoLessThan(ArbitraryProtoMessage2(), - ArbitraryProtoMessage2())); - EXPECT_FALSE(InefficientProtoLessThan(ArbitraryProtoMessage3(), - ArbitraryProtoMessage3())); -} - -TEST(InefficientProtoLessThan, ReturnsTrueAndFalseForUnequalMessages) { - EXPECT_THAT((std::vector{ - InefficientProtoLessThan(ArbitraryProtoMessage1(), - ArbitraryProtoMessage2()), - InefficientProtoLessThan(ArbitraryProtoMessage2(), - ArbitraryProtoMessage1()), - }), - UnorderedElementsAre(true, false)); - EXPECT_THAT((std::vector{ - InefficientProtoLessThan(ArbitraryProtoMessage1(), - ArbitraryProtoMessage3()), - InefficientProtoLessThan(ArbitraryProtoMessage3(), - ArbitraryProtoMessage1()), - }), - UnorderedElementsAre(true, false)); - EXPECT_THAT((std::vector{ - InefficientProtoLessThan(ArbitraryProtoMessage2(), - ArbitraryProtoMessage3()), - InefficientProtoLessThan(ArbitraryProtoMessage3(), - ArbitraryProtoMessage2()), - }), - UnorderedElementsAre(true, false)); -} - -// `InefficientProtoLessThan` promises to be stable over time. Here, we -// hard-code some input-output pairs of the function to catch changes in -// behavior. -TEST(InefficientProtoLessThan, OrderIsStable) { - EXPECT_TRUE( - InefficientProtoLessThan(ParseProtoOrDie("int_field: 1"), - ParseProtoOrDie("int_field: 2"))); - EXPECT_TRUE(InefficientProtoLessThan( - ParseProtoOrDie("int_field: 42"), - ParseProtoOrDie("string_field: \"hello!\""))); -} - -TEST(InefficientProtoSort, AllPermutationsOfThreeGetOrderedTheSameWay) { - std::vector x1, x2, x3, x4, x5, x6; - x1 = {ArbitraryProtoMessage1(), ArbitraryProtoMessage2(), - ArbitraryProtoMessage3()}; - x2 = {ArbitraryProtoMessage1(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage2()}; - x3 = {ArbitraryProtoMessage2(), ArbitraryProtoMessage1(), - ArbitraryProtoMessage3()}; - x4 = {ArbitraryProtoMessage2(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage1()}; - x5 = {ArbitraryProtoMessage2(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage1()}; - x6 = {ArbitraryProtoMessage2(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage1()}; - EXPECT_THAT(x2, Not(EqualsProtoSequence(x1))); - EXPECT_THAT(x3, Not(EqualsProtoSequence(x1))); - EXPECT_THAT(x4, Not(EqualsProtoSequence(x1))); - EXPECT_THAT(x5, Not(EqualsProtoSequence(x1))); - EXPECT_THAT(x6, Not(EqualsProtoSequence(x1))); - InefficientProtoSort(x1); - InefficientProtoSort(x2); - InefficientProtoSort(x3); - InefficientProtoSort(x4); - InefficientProtoSort(x5); - InefficientProtoSort(x6); - EXPECT_THAT(x2, EqualsProtoSequence(x1)); - EXPECT_THAT(x3, EqualsProtoSequence(x1)); - EXPECT_THAT(x4, EqualsProtoSequence(x1)); - EXPECT_THAT(x5, EqualsProtoSequence(x1)); - EXPECT_THAT(x6, EqualsProtoSequence(x1)); -} - -TEST(InefficientProtoSortAndDedupTest, RemovesDuplicates) { - std::vector messages; - - messages = {ArbitraryProtoMessage1(), ArbitraryProtoMessage1(), - ArbitraryProtoMessage1()}; - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()))); - - messages = {ArbitraryProtoMessage1(), ArbitraryProtoMessage2(), - ArbitraryProtoMessage2()}; - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()), - EqualsProto(ArbitraryProtoMessage2()))); - - messages = { - ArbitraryProtoMessage1(), ArbitraryProtoMessage2(), - ArbitraryProtoMessage2(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage3(), ArbitraryProtoMessage3(), - }; - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()), - EqualsProto(ArbitraryProtoMessage2()), - EqualsProto(ArbitraryProtoMessage3()))); -} - -TEST(InefficientProtoSortAndDedupTest, - RepeatedPtrFieldSpecializationRemovesDuplicates) { - google::protobuf::RepeatedPtrField messages; - - messages.Add(ArbitraryProtoMessage1()); - messages.Add(ArbitraryProtoMessage1()); - messages.Add(ArbitraryProtoMessage1()); - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()))); - - messages.Add(ArbitraryProtoMessage2()); - messages.Add(ArbitraryProtoMessage2()); - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()), - EqualsProto(ArbitraryProtoMessage2()))); - - messages.Add(ArbitraryProtoMessage1()); - messages.Add(ArbitraryProtoMessage2()); - messages.Add(ArbitraryProtoMessage2()); - messages.Add(ArbitraryProtoMessage3()); - messages.Add(ArbitraryProtoMessage3()); - messages.Add(ArbitraryProtoMessage3()); - InefficientProtoSortAndDedup(messages); - EXPECT_THAT(messages, - UnorderedElementsAre(EqualsProto(ArbitraryProtoMessage1()), - EqualsProto(ArbitraryProtoMessage2()), - EqualsProto(ArbitraryProtoMessage3()))); -} - -TEST(InefficientProtoSortAndDedupTest, Sorts) { - std::vector messages, deduped_messages; - - messages = {ArbitraryProtoMessage1(), ArbitraryProtoMessage2(), - ArbitraryProtoMessage1(), ArbitraryProtoMessage3(), - ArbitraryProtoMessage3(), ArbitraryProtoMessage3()}; - deduped_messages = {ArbitraryProtoMessage3(), ArbitraryProtoMessage2(), - ArbitraryProtoMessage1()}; - InefficientProtoSortAndDedup(messages); - InefficientProtoSort(deduped_messages); - EXPECT_THAT(messages, EqualsProtoSequence(deduped_messages)); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/proto_string_error_collector.h b/gutil/gutil/proto_string_error_collector.h deleted file mode 100644 index c0f3a94cc..000000000 --- a/gutil/gutil/proto_string_error_collector.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright 2024 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef PINS_GUTIL_GUTIL_PROTO_STRING_ERROR_COLLECTOR_H_ -#define PINS_GUTIL_GUTIL_PROTO_STRING_ERROR_COLLECTOR_H_ - -#include - -#include "absl/strings/string_view.h" -#include "absl/strings/substitute.h" -#include "google/protobuf/io/tokenizer.h" - -namespace gutil { - -// Collects errors by appending them to a given string. -class StringErrorCollector : public google::protobuf::io::ErrorCollector { - public: - // String error_text is unowned and must remain valid during the use of - // StringErrorCollector. - explicit StringErrorCollector(std::string* error_text) - : error_text_{error_text} {}; - StringErrorCollector(const StringErrorCollector&) = delete; - StringErrorCollector& operator=(const StringErrorCollector&) = delete; - - // Implementation of protobuf::io::ErrorCollector::AddError. - void AddError(int line, int column, const std::string& message) override { - if (error_text_ != nullptr) { - absl::SubstituteAndAppend(error_text_, "$0($1): $2\n", line, column, - message); - } - } - - // Implementation of protobuf::io::ErrorCollector::AddWarning. - void AddWarning(int line, int column, const std::string& message) override { - AddError(line, column, message); - } - - private: - std::string* const error_text_; -}; - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_PROTO_STRING_ERROR_COLLECTOR_H_ diff --git a/gutil/gutil/proto_test.cc b/gutil/gutil/proto_test.cc deleted file mode 100644 index 2788aa544..000000000 --- a/gutil/gutil/proto_test.cc +++ /dev/null @@ -1,241 +0,0 @@ -#include "gutil/gutil/proto.h" - -#include -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/proto_test.pb.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" - -namespace gutil { -namespace { - -using ::gutil::IsOkAndHolds; -using ::gutil::StatusIs; -using ::testing::Eq; -using ::testing::IsEmpty; -using ::testing::Not; -using ::testing::ResultOf; - -// Get a writeable directory where bazel tests can save output files to. -// https://docs.bazel.build/versions/main/test-encyclopedia.html#initial-conditions -absl::StatusOr GetTestTmpDir() { - char* test_tmpdir = std::getenv("TEST_TMPDIR"); - if (test_tmpdir == nullptr) { - return gutil::InternalErrorBuilder() - << "Could not find environment variable ${TEST_TMPDIR}. Is this a " - "bazel test run?"; - } - return test_tmpdir; -} - -TEST(IsEmptyProto, ReturnsTrueForEmptyProto) { - EXPECT_TRUE(IsEmptyProto(TestMessage())); - - // Same things, but a bit more convoluted. - TestMessage message; - message.set_int_field(42); - message.set_int_field(0); - EXPECT_TRUE(IsEmptyProto(message)) - << "where message = " << message.DebugString(); -} - -TEST(IsEmptyProto, ReturnsFalseForNonEmptyProto) { - EXPECT_THAT(ParseTextProto("int_field: 42"), - IsOkAndHolds(ResultOf(IsEmptyProto, Eq(false)))); -} - -TEST(ParseTextProto, EmptyTextProtoIsOk) { - EXPECT_THAT(ParseTextProto(""), IsOk()); -} - -TEST(ParseTextProto, InvalidTextProtoIsNotOk) { - EXPECT_THAT(ParseTextProto("bytes_field: true"), Not(IsOk())); -} - -TEST(ParseTextProto, NonEmptyValidTextProtoIsParsedCorrectly) { - auto proto = ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb"); - ASSERT_THAT(proto, IsOk()); - EXPECT_EQ(proto->int_field(), 42); - EXPECT_EQ(proto->string_field(), "hello!"); - EXPECT_EQ(proto->bool_field(), true); -} - -TEST(ProtoDiff, ReturnsErrorForIncompatibleMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK_AND_ASSIGN(auto message2, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - EXPECT_THAT(ProtoDiff(message1, message2).status(), - StatusIs(absl::StatusCode::kInvalidArgument)); -} - -TEST(ProtoDiff, ReturnsEmptyDiffForEqualMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - EXPECT_THAT(ProtoDiff(message1, message1), IsOkAndHolds(IsEmpty())); -} - -TEST(ProtoDiff, ReturnsNonEmptyDiffForUnequalMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK_AND_ASSIGN(auto message2, ParseTextProto(R"pb( - int_field: 43 - string_field: "bye" - bool_field: false - )pb")); - EXPECT_THAT(ProtoDiff(message1, message2), IsOkAndHolds(Not(IsEmpty()))); -} - -TEST(ProtoEqual, ReturnsErrorForIncompatibleMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK_AND_ASSIGN(auto message2, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - EXPECT_THAT(ProtoEqual(message1, message2), Eq(false)); -} - -TEST(ProtoEqual, ReturnsTrueForEqualMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - EXPECT_THAT(ProtoEqual(message1, message1), Eq(true)); -} - -TEST(ProtoEqual, ReturnsFalseForUnequalMessages) { - ASSERT_OK_AND_ASSIGN(auto message1, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK_AND_ASSIGN(auto message2, ParseTextProto(R"pb( - int_field: 43 - string_field: "bye" - bool_field: false - )pb")); - EXPECT_THAT(ProtoEqual(message1, message2), Eq(false)); -} - -TEST(TextProtoHelpers, PrintTextProto) { - TestMessage message; - message.set_int_field(42); - message.set_string_field("bye"); - message.set_bool_field(true); - EXPECT_THAT(PrintTextProto(message), - "int_field: 42\nstring_field: \"bye\"\nbool_field: true\n"); -} - -TEST(TextProtoHelpers, PrintShortTextProto) { - TestMessage message; - message.set_int_field(42); - message.set_string_field("bye"); - message.set_bool_field(true); - EXPECT_THAT(PrintShortTextProto(message), - "int_field: 42 string_field: \"bye\" bool_field: true"); -} - -TEST(ParseJsonAsProto, ParsesTestMessage) { - EXPECT_THAT(ParseJsonAsProto(R"json({ - "int_field" : 42, - "string_field" : "bye", - "bool_field" : true - })json"), - IsOkAndHolds(EqualsProto(R"pb( - int_field: 42 - string_field: "bye" - bool_field: true - )pb"))); -} - -TEST(ParseJsonAsProto, CanIgnoreUnknownFields) { - EXPECT_THAT(ParseJsonAsProto(R"json({ - "int_field" : 42, - "string_field" : "bye", - "bool_field" : true, - "unknown_field": "please ignore" - })json", - /*ignore_unknown_field=*/false), - Not(IsOk())); - EXPECT_THAT(ParseJsonAsProto(R"json({ - "int_field" : 42, - "string_field" : "bye", - "bool_field" : true, - "unknown_field": "please ignore" - })json", - /*ignore_unknown_field=*/true), - IsOkAndHolds(EqualsProto(R"pb( - int_field: 42 - string_field: "bye" - bool_field: true - )pb"))); -} - -TEST(SerializeProtoAsJson, RoundTripsWithParseJsonAsProto) { - ASSERT_OK_AND_ASSIGN(auto proto, ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK_AND_ASSIGN(std::string json, SerializeProtoAsJson(proto)); - EXPECT_THAT(ParseJsonAsProto(json), - IsOkAndHolds(EqualsProto(proto))); -} - -TEST(SaveProtoToFile, SavesProtoToFileTruncatesFileOnOverwrite) { - ASSERT_OK_AND_ASSIGN(std::string test_tmpdir, GetTestTmpDir()); - std::string proto_save_path = - absl::StrCat(test_tmpdir, "/forwarding_config.pb.txt"); - ASSERT_OK_AND_ASSIGN(gutil::TestMessage proto, - ParseTextProto(R"pb( - int_field: 42 - string_field: "hello!" - bool_field: true - )pb")); - ASSERT_OK(SaveProtoToFile(proto_save_path, proto)); - - gutil::TestMessage read_proto; - ASSERT_OK(gutil::ReadProtoFromFile(proto_save_path, &read_proto)); - EXPECT_THAT(read_proto, EqualsProto(proto)); - - gutil::TestMessage empty_proto; - // Overite the saved file with empty proto. - ASSERT_OK(SaveProtoToFile(proto_save_path, empty_proto)); - - gutil::TestMessage read_empty_proto; - ASSERT_OK(gutil::ReadProtoFromFile(proto_save_path, &read_empty_proto)); - // Verify the file is truncated. - EXPECT_THAT(read_empty_proto, EqualsProto(empty_proto)); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/proto_test.proto b/gutil/gutil/proto_test.proto deleted file mode 100644 index d6021caa7..000000000 --- a/gutil/gutil/proto_test.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; - -package gutil; - -message TestMessage { - int32 int_field = 1; - string string_field = 2; - bool bool_field = 3; -} - -message AnotherTestMessage { - int32 int_field = 1; - string string_field = 2; - bool bool_field = 3; -} - -message TestMessageWithOneof { - oneof foo { - string string_foo = 1; - int32 int_foo = 2; - bool bool_foo = 3; - bytes bytes_foo = 4; - } -} diff --git a/gutil/gutil/status.cc b/gutil/gutil/status.cc deleted file mode 100644 index ec9ecae75..000000000 --- a/gutil/gutil/status.cc +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include "gutil/gutil/status.h" - -#include - -#include "absl/status/status.h" -#include "absl/strings/str_cat.h" -#include "grpcpp/grpcpp.h" - -namespace gutil { - -std::string StableStatusToString(const absl::Status& status) { - return absl::StrCat(absl::StatusCodeToString(status.code()), ": ", - status.message(), "\n"); -} - -absl::Status gutil::StatusBuilder::GetStatusAndLog() const { - std::string message = source_; - switch (join_style_) { - case MessageJoinStyle::kPrepend: - absl::StrAppend(&message, stream_.str(), status_.message()); - break; - case MessageJoinStyle::kAppend: - absl::StrAppend(&message, status_.message(), stream_.str()); - break; - case MessageJoinStyle::kAnnotate: - default: { - if (!status_.message().empty() && !stream_.str().empty()) { - absl::StrAppend(&message, status_.message(), "; ", stream_.str()); - } else if (status_.message().empty()) { - absl::StrAppend(&message, stream_.str()); - } else { - absl::StrAppend(&message, status_.message()); - } - break; - } - } - if (log_error_ && status_.code() != absl::StatusCode::kOk) { - std::cout << message << std::endl; - } - absl::Status new_status(status_.code(), message); - status_.ForEachPayload( - [&new_status](absl::string_view url, const absl::Cord& cord) { - new_status.SetPayload(url, cord); - }); - return new_status; -} - -grpc::Status AbslStatusToGrpcStatus(const absl::Status& status) { - return grpc::Status(static_cast(status.code()), - std::string(status.message())); -} - -absl::Status GrpcStatusToAbslStatus(const grpc::Status& status) { - return absl::Status(static_cast(status.error_code()), - status.error_message()); -} - -} // namespace gutil diff --git a/gutil/gutil/status.h b/gutil/gutil/status.h deleted file mode 100644 index f3dccb638..000000000 --- a/gutil/gutil/status.h +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_STATUS_H_ -#define PINS_GUTIL_GUTIL_STATUS_H_ - -#include -#include -#include -#include - -#include "absl/base/attributes.h" -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/cord.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/string_view.h" -#include "absl/types/optional.h" -#include "grpcpp/grpcpp.h" - -namespace gutil { - -// Converts `status` to a readable string. The current absl `ToString` method is -// not stable, which causes issues while golden testing. This function is -// stable. -std::string StableStatusToString(const absl::Status& status); - -// Protobuf and some other Google projects use Status classes that are isomorph, -// but not equal to absl::Status (outside of google3). -// This auxiliary function converts such Status classes to absl::Status. -template -absl::Status ToAbslStatus(T status) { - return absl::Status( - static_cast(status.code()), - absl::string_view(status.message().data(), status.message().size())); -} - -// A proxy type and function for template type deduction for logging -// `absl::StatusOr`s. -// -// Can be removed once `absl::StatusOr` supports `operator<<`. -template -class StreamableStatusOrProxy { - public: - explicit StreamableStatusOrProxy(const absl::StatusOr& status_or) - : status_or_(status_or) {} - - StreamableStatusOrProxy(const StreamableStatusOrProxy&) = delete; - StreamableStatusOrProxy& operator=(const StreamableStatusOrProxy&) = delete; - - friend std::ostream& operator<<(std::ostream& os, - const StreamableStatusOrProxy& logger) { - if (logger.status_or_.ok()) return os << *logger.status_or_; - return os << logger.status_or_.status().code() << ": " - << logger.status_or_.status().message(); - } - - private: - const absl::StatusOr& status_or_; -}; - -template -StreamableStatusOrProxy StreamableStatusOr( - const absl::StatusOr& status_or) { - return StreamableStatusOrProxy(status_or); -} - -// Convert between gRPC and Abseil statuses. -grpc::Status AbslStatusToGrpcStatus(const absl::Status& status); -absl::Status GrpcStatusToAbslStatus(const grpc::Status& status); - -// StatusBuilder facilitates easier construction of Status objects with streamed -// message building. -// -// Example usage: -// absl::Status foo(int i) { -// if (i < 0) { -// return StatusBuilder(absl::StatusCode::kInvalidArgument) << "i=" << i; -// } -// } -class ABSL_MUST_USE_RESULT StatusBuilder { - public: - StatusBuilder(std::string file, int line, absl::StatusCode code) - : status_(absl::Status(code, "")), - log_error_(false), - join_style_(MessageJoinStyle::kAnnotate) { - source_ = absl::StrCat("[", file, ":", line, "]: "); - } - - explicit StatusBuilder(absl::StatusCode code) - : status_(absl::Status(code, "")), - log_error_(false), - join_style_(MessageJoinStyle::kAnnotate) {} - - explicit StatusBuilder(absl::Status status) - : status_(status), - log_error_(false), - join_style_(MessageJoinStyle::kAnnotate) {} - - StatusBuilder(const StatusBuilder& other) - : source_(other.source_), - status_(other.status_), - log_error_(other.log_error_), - join_style_(other.join_style_) { - stream_ << other.stream_.str(); - } - - // Streaming to the StatusBuilder appends to the error message. - template - ABSL_MUST_USE_RESULT StatusBuilder& operator<<(t val) { - stream_ << val; - return *this; - } - - // Makes the StatusBuilder print the error message (with source) when - // converting to a different type. - ABSL_MUST_USE_RESULT StatusBuilder& LogError() { - log_error_ = true; - return *this; - } - - // The additional message is prepended to the pre-existing status error - // message. No separator is placed between the messages. - ABSL_MUST_USE_RESULT StatusBuilder& SetPrepend() { - join_style_ = MessageJoinStyle::kPrepend; - return *this; - } - - // The additional message is appended to the pre-existing status error - // message. No separator is placed between the messages. - ABSL_MUST_USE_RESULT StatusBuilder& SetAppend() { - join_style_ = MessageJoinStyle::kAppend; - return *this; - } - - // Override the StatusCode in status_ to the given value. - ABSL_MUST_USE_RESULT StatusBuilder& SetCode(absl::StatusCode code) { - status_ = absl::Status(code, status_.message()); - return *this; - } - - ABSL_MUST_USE_RESULT StatusBuilder& SetPayload(absl::string_view url, - absl::Cord payload) { - status_.SetPayload(url, std::move(payload)); - return *this; - } - - // Implicit type conversions. - operator absl::Status() const { return GetStatusAndLog(); } - template - operator absl::StatusOr() const { - return absl::StatusOr(static_cast(*this)); - } - - private: - enum class MessageJoinStyle { - kAnnotate, - kAppend, - kPrepend, - }; - - std::string source_; - absl::Status status_; - std::stringstream stream_; - bool log_error_; - MessageJoinStyle join_style_; - - absl::Status GetStatusAndLog() const; -}; - -// Custom allocators for default StatusCodes. -class ABSL_MUST_USE_RESULT CancelledErrorBuilder : public StatusBuilder { - public: - CancelledErrorBuilder() : StatusBuilder(absl::StatusCode::kCancelled) {} -}; -class ABSL_MUST_USE_RESULT UnknownErrorBuilder : public StatusBuilder { - public: - UnknownErrorBuilder() : StatusBuilder(absl::StatusCode::kUnknown) {} -}; -class ABSL_MUST_USE_RESULT InvalidArgumentErrorBuilder : public StatusBuilder { - public: - InvalidArgumentErrorBuilder() - : StatusBuilder(absl::StatusCode::kInvalidArgument) {} -}; -class ABSL_MUST_USE_RESULT DeadlineExceededErrorBuilder : public StatusBuilder { - public: - DeadlineExceededErrorBuilder() - : StatusBuilder(absl::StatusCode::kDeadlineExceeded) {} -}; -class ABSL_MUST_USE_RESULT NotFoundErrorBuilder : public StatusBuilder { - public: - NotFoundErrorBuilder() : StatusBuilder(absl::StatusCode::kNotFound) {} -}; -class ABSL_MUST_USE_RESULT AlreadyExistsErrorBuilder : public StatusBuilder { - public: - AlreadyExistsErrorBuilder() - : StatusBuilder(absl::StatusCode::kAlreadyExists) {} -}; -class ABSL_MUST_USE_RESULT PermissionDeniedErrorBuilder : public StatusBuilder { - public: - PermissionDeniedErrorBuilder() - : StatusBuilder(absl::StatusCode::kPermissionDenied) {} -}; -class ABSL_MUST_USE_RESULT ResourceExhaustedErrorBuilder - : public StatusBuilder { - public: - ResourceExhaustedErrorBuilder() - : StatusBuilder(absl::StatusCode::kResourceExhausted) {} -}; -class ABSL_MUST_USE_RESULT FailedPreconditionErrorBuilder - : public StatusBuilder { - public: - FailedPreconditionErrorBuilder() - : StatusBuilder(absl::StatusCode::kFailedPrecondition) {} -}; -class ABSL_MUST_USE_RESULT AbortedErrorBuilder : public StatusBuilder { - public: - AbortedErrorBuilder() : StatusBuilder(absl::StatusCode::kAborted) {} -}; -class ABSL_MUST_USE_RESULT OutOfRangeErrorBuilder : public StatusBuilder { - public: - OutOfRangeErrorBuilder() : StatusBuilder(absl::StatusCode::kOutOfRange) {} -}; -class ABSL_MUST_USE_RESULT UnimplementedErrorBuilder : public StatusBuilder { - public: - UnimplementedErrorBuilder() - : StatusBuilder(absl::StatusCode::kUnimplemented) {} -}; -class ABSL_MUST_USE_RESULT InternalErrorBuilder : public StatusBuilder { - public: - InternalErrorBuilder() : StatusBuilder(absl::StatusCode::kInternal) {} -}; -class ABSL_MUST_USE_RESULT UnavailableErrorBuilder : public StatusBuilder { - public: - UnavailableErrorBuilder() : StatusBuilder(absl::StatusCode::kUnavailable) {} -}; -class ABSL_MUST_USE_RESULT DataLossErrorBuilder : public StatusBuilder { - public: - DataLossErrorBuilder() : StatusBuilder(absl::StatusCode::kDataLoss) {} -}; -class ABSL_MUST_USE_RESULT UnauthenticatedErrorBuilder : public StatusBuilder { - public: - UnauthenticatedErrorBuilder() - : StatusBuilder(absl::StatusCode::kUnauthenticated) {} -}; - -// status.h internal classes. Not for public use. -namespace status_internal { -// Holds a status builder in the '_' parameter. -class StatusBuilderHolder { - public: - StatusBuilderHolder(const absl::Status& status) : builder_(status) {} - StatusBuilderHolder(absl::Status&& status) : builder_(std::move(status)) {} - - StatusBuilder builder_; -}; -} // namespace status_internal - -} // namespace gutil - -// RETURN_IF_ERROR evaluates an expression that returns a absl::Status. If the -// result is not ok, returns a StatusBuilder for the result. Otherwise, -// continues. Because the macro ends in an unterminated StatusBuilder, all -// StatusBuilder extensions can be used. -// -// Example: -// absl::Status Foo() {...} -// absl::Status Bar() { -// RETURN_IF_ERROR(Foo()).LogError() << "Additional Info"; -// return absl::OkStatus() -// } -#define RETURN_IF_ERROR(expr) \ - for (absl::Status status = expr; !status.ok();) \ - return gutil::StatusBuilder(std::move(status)) - -// These macros help create unique variable names for ASSIGN_OR_RETURN. Not for -// public use. -#define __ASSIGN_OR_RETURN_VAL_DIRECT(arg) __ASSIGN_OR_RETURN_RESULT_##arg -#define __ASSIGN_OR_RETURN_VAL(arg) __ASSIGN_OR_RETURN_VAL_DIRECT(arg) - -// An implementation of ASSIGN_OR_RETURN that does not include a StatusBuilder. -// Not for public use. -#define __ASSIGN_OR_RETURN(dest, expr) \ - auto __ASSIGN_OR_RETURN_VAL(__LINE__) = expr; \ - if (!__ASSIGN_OR_RETURN_VAL(__LINE__).ok()) { \ - return __ASSIGN_OR_RETURN_VAL(__LINE__).status(); \ - } \ - dest = std::move(__ASSIGN_OR_RETURN_VAL(__LINE__)).value() - -// An implementation of ASSIGN_OR_RETURN that provides a StatusBuilder for extra -// processing. Not for public use. -#define __ASSIGN_OR_RETURN_STREAM(dest, expr, stream) \ - auto __ASSIGN_OR_RETURN_VAL(__LINE__) = expr; \ - if (!__ASSIGN_OR_RETURN_VAL(__LINE__).ok()) { \ - return ::gutil::status_internal::StatusBuilderHolder( \ - __ASSIGN_OR_RETURN_VAL(__LINE__).status()) \ - .builder##stream; \ - } \ - dest = std::move(__ASSIGN_OR_RETURN_VAL(__LINE__)).value() - -// Macro to choose the correct implementation for ASSIGN_OR_RETURN based on -// the number of inputs. Not for public use. -#define __ASSIGN_OR_RETURN_PICK(dest, expr, stream, func, ...) func - -// ASSIGN_OR_RETURN evaluates an expression that returns a StatusOr. If the -// result is ok, the value is saved to dest. Otherwise, the status is returned. -// -// Example: -// absl::StatusOr Foo() {...} -// absl::Status Bar() { -// ASSIGN_OR_RETURN(int value, Foo()); -// std::cout << "value: " << value; -// return absl::OkStatus(); -// } -// -// ASSIGN_OR_RETURN optionally takes in a third parameter that takes in -// absl::StatusBuilder commands. Usage should assume a StatusBuilder object is -// available and referred to as '_'. -// -// Example: -// absl::StatusOr Foo() {...} -// absl::Status Bar() { -// ASSIGN_OR_RETURN(int value, Foo(), _.LogError() << "Additional Info"); -// std::cout << "value: " << value; -// return absl::OkStatus(); -// } -#define ASSIGN_OR_RETURN(...) \ - __ASSIGN_OR_RETURN_PICK(__VA_ARGS__, __ASSIGN_OR_RETURN_STREAM, \ - __ASSIGN_OR_RETURN) \ - (__VA_ARGS__) - -// Returns an error if `cond` doesn't hold. -#define RET_CHECK(cond) \ - while (!(cond)) \ - return gutil::InternalErrorBuilder() << "(" << #cond << ") failed" - -#endif // PINS_GUTIL_GUTIL_STATUS_H_ diff --git a/gutil/gutil/status_matchers.h b/gutil/gutil/status_matchers.h deleted file mode 100644 index d1dac3ce7..000000000 --- a/gutil/gutil/status_matchers.h +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_STATUS_MATCHERS_H_ -#define PINS_GUTIL_GUTIL_STATUS_MATCHERS_H_ - -#include -#include -#include -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/str_format.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -namespace internal { - -template -const Status& GetStatus(const Status& status) { - return status; -} - -template -const absl::Status& GetStatus(const absl::StatusOr& statusor) { - return statusor.status(); -} - -} // namespace internal - -MATCHER(IsOk, negation ? "is not OK" : "is OK") { - return internal::GetStatus(arg).ok(); -} - -// Convenience macros for checking that a status return type is okay. -#define EXPECT_OK(expression) EXPECT_THAT(expression, ::gutil::IsOk()) -#define ASSERT_OK(expression) ASSERT_THAT(expression, ::gutil::IsOk()) - -#ifndef __ASSIGN_OR_RETURN_VAL_DIRECT -#define __ASSIGN_OR_RETURN_VAL_DIRECT(arg) __ASSIGN_OR_RETURN_RESULT_##arg -#define __ASSIGN_OR_RETURN_VAL(arg) __ASSIGN_OR_RETURN_VAL_DIRECT(arg) -#endif - -// ASSERT_OK_AND_ASSIGN evaluates the expression (which needs to evaluate to a -// StatusOr) and asserts that the expression has status OK. It then assigns the -// result to lhs, and otherwise fails. -#define ASSERT_OK_AND_ASSIGN(lhs, expression) \ - auto __ASSIGN_OR_RETURN_VAL(__LINE__) = expression; \ - if (!__ASSIGN_OR_RETURN_VAL(__LINE__).status().ok()) { \ - FAIL() << #expression \ - << " failed: " << __ASSIGN_OR_RETURN_VAL(__LINE__).status(); \ - } \ - lhs = std::move(__ASSIGN_OR_RETURN_VAL(__LINE__)).value(); - -MATCHER_P(StatusIs, status_code, - absl::StrCat(negation ? "is not " : "is ", - absl::StatusCodeToString(status_code))) { - return internal::GetStatus(arg).code() == status_code; -} - -MATCHER_P2(StatusIs, status_code, message_matcher, - absl::StrFormat("is %s%s, %s has a status message that %s", - negation ? "not " : "", - absl::StatusCodeToString(status_code), - negation ? "or" : "and", - testing::DescribeMatcher( - message_matcher, negation))) { - const absl::Status& status = internal::GetStatus(arg); - return status.code() == status_code && - testing::ExplainMatchResult(message_matcher, status.message(), - result_listener); -} - -template -class IsOkAndHoldsMatcherImpl : public testing::MatcherInterface { - public: - using T = typename std::remove_reference_t::value_type; - - template - explicit IsOkAndHoldsMatcherImpl(InnerMatcher&& inner_matcher) - : inner_matcher_(testing::SafeMatcherCast( - std::forward(inner_matcher))) {} - - bool MatchAndExplain(StatusOrT t, - testing::MatchResultListener* listener) const override { - if (!t.ok()) { - *listener << "which has status " << t.status(); - return false; - } - return inner_matcher_.MatchAndExplain(*t, listener); - } - - void DescribeTo(std::ostream* os) const override { - *os << "is OK and has a value that "; - inner_matcher_.DescribeTo(os); - } - void DescribeNegationTo(std::ostream* os) const override { - *os << "is not OK or has a value that "; - inner_matcher_.DescribeNegationTo(os); - } - - private: - testing::Matcher inner_matcher_; -}; - -template -class IsOkAndHoldsMatcher { - public: - explicit IsOkAndHoldsMatcher(InnerMatcher&& inner_matcher) - : inner_matcher_(std::forward(inner_matcher)) {} - - template - operator testing::Matcher() const { // NOLINT - return testing::Matcher( - new IsOkAndHoldsMatcherImpl(inner_matcher_)); - } - - private: - InnerMatcher inner_matcher_; -}; - -template -IsOkAndHoldsMatcher IsOkAndHolds(InnerMatcher&& inner_matcher) { - return IsOkAndHoldsMatcher( - std::forward(inner_matcher)); -} - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_STATUS_MATCHERS_H_ diff --git a/gutil/gutil/status_matchers_test.cc b/gutil/gutil/status_matchers_test.cc deleted file mode 100644 index 6e06a02cd..000000000 --- a/gutil/gutil/status_matchers_test.cc +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include "gutil/gutil/status_matchers.h" - -#include - -#include "absl/memory/memory.h" -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status.h" - -namespace gutil { -namespace { - -using ::testing::_; -using ::testing::Eq; -using ::testing::HasSubstr; -using ::testing::Not; - -TEST(AbseilStatusMatcher, IsOk) { EXPECT_THAT(absl::Status(), IsOk()); } - -TEST(AbseilStatusMatcher, IsNotOk) { - EXPECT_THAT(absl::UnknownError("unknown error"), Not(IsOk())); -} - -TEST(AbseilStatusMatcher, StatusIs) { - EXPECT_THAT(absl::UnknownError("unknown error"), - StatusIs(absl::StatusCode::kUnknown)); -} - -TEST(AbseilStatusMatcher, StatusIsNot) { - EXPECT_THAT(absl::UnknownError("unknown error"), - Not(StatusIs(absl::StatusCode::kInvalidArgument))); -} - -TEST(AbseilStatusMatcher, StatusIsWithMessage) { - EXPECT_THAT(absl::UnknownError("unknown error"), - StatusIs(absl::StatusCode::kUnknown, "unknown error")); -} - -TEST(AbseilStatusMatcher, StatusIsWithMessageNot) { - EXPECT_THAT(absl::UnknownError("unknown error"), - Not(StatusIs(absl::StatusCode::kInvalidArgument, "unknown"))); -} - -TEST(AbslStatusOrMatcher, IsOk) { EXPECT_THAT(absl::StatusOr(1), IsOk()); } - -TEST(AbslStatusOrMatcher, IsNotOk) { - EXPECT_THAT(absl::StatusOr(absl::UnknownError("unknown error")), - Not(IsOk())); -} - -TEST(AbslStatusOrMatcher, StatusIs) { - EXPECT_THAT(absl::StatusOr(absl::UnknownError("unknown error")), - StatusIs(absl::StatusCode::kUnknown)); -} - -TEST(AbslStatusOrMatcher, StatusIsNot) { - EXPECT_THAT(absl::StatusOr(absl::UnknownError("unknown error")), - Not(StatusIs(absl::StatusCode::kInvalidArgument))); -} - -TEST(AbslStatusOrMatcher, StatusIsWithMessage) { - EXPECT_THAT(absl::StatusOr(absl::UnknownError("unknown error")), - StatusIs(absl::StatusCode::kUnknown, HasSubstr("unknown"))); -} - -TEST(AbslStatusOrMatcher, StatusIsWithMessageNot) { - EXPECT_THAT(absl::StatusOr(absl::UnknownError("unknown error")), - Not(StatusIs(absl::StatusCode::kInvalidArgument, "unknown"))); -} - -TEST(AbslStatusOrMatcher, StatusIsOkAndHolds) { - EXPECT_THAT(absl::StatusOr(1320), IsOkAndHolds(1320)); -} - -TEST(AbslStatusOrMatcher, StatusIsNotOkAndHolds) { - EXPECT_THAT(absl::StatusOr(1320), Not(IsOkAndHolds(0))); -} - -TEST(AbslStatusOrMatcher, StatusIsOkAndHoldsWithExpectation) { - EXPECT_THAT(absl::StatusOr("The quick brown fox"), - IsOkAndHolds(HasSubstr("fox"))); -} - -// This test will fail to build if the macro doesn't work. -TEST(AbslStatusOrMatcher, AssignOrReturnWorksWithMoveOnlyTypes) { - ASSERT_OK_AND_ASSIGN( - auto value_from_expression, - absl::StatusOr>(absl::make_unique(0))); -} - -TEST(IsOkAndHoldsTest, Description) { - auto describe = [](const auto& matcher) { - return testing::DescribeMatcher>(matcher); - }; - EXPECT_EQ(describe(IsOkAndHolds(_)), - "is OK and has a value that is anything"); - EXPECT_EQ(describe(Not(IsOkAndHolds(Eq(4)))), - "is not OK or has a value that isn't equal to 4"); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/syslog_sink.cc b/gutil/gutil/syslog_sink.cc deleted file mode 100644 index 7859ecd16..000000000 --- a/gutil/gutil/syslog_sink.cc +++ /dev/null @@ -1,65 +0,0 @@ -#include "gutil/gutil/syslog_sink.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "absl/log/log_entry.h" -#include "absl/log/log_sink_registry.h" - -namespace gutil { -namespace { - -// Abseil log severity uses integers in the range [0-3]: -// https://github.com/abseil/abseil-cpp/blob/master/absl/base/log_severity.h -constexpr std::array kLogSeverityToSyslog = { - LOG_INFO, - LOG_WARNING, - LOG_ERR, - LOG_EMERG, -}; -constexpr std::array kLogSeverityLetter = { - 'I', - 'W', - 'E', - 'F', -}; - -} // namespace - -SyslogSink::SyslogSink(const char* process_name) { - openlog(process_name, LOG_NDELAY, LOG_USER); - absl::AddLogSink(this); -} - -SyslogSink::~SyslogSink() { - absl::RemoveLogSink(this); - closelog(); -} - -void SyslogSink::Send(const absl::LogEntry& entry) { - // Create a timestamp with microsecond resolution. - struct timeval tv; - struct timezone tz; - struct tm time; - gettimeofday(&tv, &tz); - localtime_r(&tv.tv_sec, &time); - - // Output format: - // I0104 23:00:59.123456 71 filename.cc:100] Your Message Here! - int severity = static_cast(entry.log_severity()); - syslog(kLogSeverityToSyslog[severity], - "%c%02d%02d %02d:%02d:%02d.%06ld %5ld %s:%d] %.*s", - kLogSeverityLetter[severity], 1 + time.tm_mon, time.tm_mday, - time.tm_hour, time.tm_min, time.tm_sec, static_cast(tv.tv_usec), - syscall(SYS_gettid), std::string(entry.source_basename()).c_str(), - entry.source_line(), static_cast(entry.text_message().size()), - entry.text_message().data()); -} - -} // namespace gutil diff --git a/gutil/gutil/syslog_sink.h b/gutil/gutil/syslog_sink.h deleted file mode 100644 index 0db9e62b7..000000000 --- a/gutil/gutil/syslog_sink.h +++ /dev/null @@ -1,47 +0,0 @@ -// Exposes functions to write test artifacts understood by Bazel. - -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_SYSLOG_SINK_H_ -#define PINS_GUTIL_GUTIL_SYSLOG_SINK_H_ - -#include "absl/log/log_entry.h" -#include "absl/log/log_sink.h" - -namespace gutil { - -// When constructed SyslogSink will automatically register an Abseil LogSink and -// begin forwarding all LOG() messages to syslog. In the dtor we unregister the -// LogSink so the SyslogSink should outlive the program. These messages are -// treated as user-level (i.e. a LOG_USER facility), and serverities are mapped -// as follows: -// LOG(INFO) -> LOG_INFO -// LOG(WARNING) -> LOG_WARNING -// LOG(ERROR) -> LOG_ERR -// LOG(FATAL) -> LOG_EMERG -// -// The syslog message will be formatted similar to the default Abseil Log -// message except with a microsecond timestamp. -class SyslogSink final : public absl::LogSink { - public: - SyslogSink(const char* process_name); - ~SyslogSink(); - - void Send(const absl::LogEntry& entry) override; -}; - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_SYSLOG_SINK_H_ diff --git a/gutil/gutil/test_artifact_writer.cc b/gutil/gutil/test_artifact_writer.cc deleted file mode 100644 index 323ac97a9..000000000 --- a/gutil/gutil/test_artifact_writer.cc +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright 2024 Google LLC - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "gutil/gutil/test_artifact_writer.h" - -#include -#include -#include // NOLINT: open source code -#include -#include -#include -#include // NOLINT: open source code -#include - -#include "absl/container/flat_hash_map.h" -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/string_view.h" -#include "absl/synchronization/mutex.h" -#include "google/protobuf/message.h" -#include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" - -namespace gutil { -namespace { - -// Gets a Bazel artifact directory based on the currently running test if `path` -// is empty. Otherwise, create a new subdirectory `path` under Bazel artifact -// directory and returns the full path. -absl::StatusOr ArtifactDirectory(absl::string_view path) { - // Pick appropriate artifact directory using Bazel environment variables, see - // https://docs.bazel.build/versions/main/test-encyclopedia.html#initial-conditions - char* base_dir = std::getenv("TEST_UNDECLARED_OUTPUTS_DIR"); - if (base_dir == nullptr) { - base_dir = std::getenv("TEST_TMPDIR"); - } - if (base_dir == nullptr) { - return gutil::InternalErrorBuilder() - << "Environment variables TEST_UNDECLARED_OUTPUTS_DIR and " - "TEST_TMPDIR undefined; is this a Bazel test run?"; - } - std::string dir = base_dir; - if (auto* test_info = testing::UnitTest::GetInstance()->current_test_info(); - test_info != nullptr) { - absl::StrAppend(&dir, "/", test_info->test_case_name(), "/", - test_info->name()); - } - if (!path.empty()) { - absl::StrAppend(&dir, "/", path); - } - - // Ensure the directory exists. - std::error_code error; - std::filesystem::create_directories(dir, error); - if (error) { - return gutil::InternalErrorBuilder() - << "failed to create test artifact directory '" << dir - << "': " << error; - } - return dir; -} - -// Splits a path into its directory and filename components. -std::pair SplitPath( - absl::string_view path) { - size_t last_slash_pos = path.find_last_of('/'); - if (last_slash_pos == std::string::npos) { - return std::make_pair("", path); - } - return std::make_pair(path.substr(0, last_slash_pos), - path.substr(last_slash_pos + 1)); -} - -// Writes an artifact with `contents` to a `path` under an artifact directory -// determined by the currently running test. The mode to write the contents -// under is determined by `mode` supporting e.g. `std::ios_base::trunc` or -// `std::ios_base::app`. -// `open_file_by_filepath` is used to continue to use the same file descriptor, -// instead of creating a new one, when appending. -absl::Status WriteToTestArtifact( - absl::string_view path, absl::string_view contents, - std::ios_base::openmode mode, - absl::flat_hash_map& open_file_by_filepath) { - // Check if the filename contains any subdirectories. - auto [subdirectory, filename] = SplitPath(path); - ASSIGN_OR_RETURN(std::string directory, ArtifactDirectory(subdirectory)); - - std::string filepath = absl::StrCat(directory, "/", filename); - // Note that pointer-stability of values is not a concern here because the - // reference is local and nothing is added to the map while the reference is - // live. - std::ofstream& file = open_file_by_filepath[filepath]; - if (file.is_open() && mode == std::ios_base::trunc) { - // If we have an open file descriptor and we want to truncate the file, then - // we close it and reopen it in truncation mode. - file.close(); - } - // If the file is not open, then we just want to open it in the given mode. - if (!file.is_open()) { - file.open(filepath, mode); - // If the file is still not open, we have a problem. - if (!file.is_open()) { - return gutil::InternalErrorBuilder() - << "unable to open test artifact file: '" << filepath << "'"; - } - } - file << contents; - - // We flush the contents to persist them, but leave the file open so that we - // can continue to append to it. - file.flush(); - if (file.good()) return absl::OkStatus(); - return gutil::InternalErrorBuilder() - << "failed to store test artifact: '" << filepath << "'"; -} - -} // namespace - -// -- TestArtifactWriter ------------------------------------------------------- - -absl::Status TestArtifactWriter::StoreTestArtifact( - absl::string_view filename, const google::protobuf::Message& proto) { - return StoreTestArtifact(filename, PrintTextProto(proto)); -} -absl::Status TestArtifactWriter::AppendToTestArtifact( - absl::string_view filename, const google::protobuf::Message& proto) { - return AppendToTestArtifact(filename, - absl::StrCat(PrintTextProto(proto), "\n")); -} - -// -- BazelTestArtifactWriter -------------------------------------------------- - -absl::Status BazelTestArtifactWriter::StoreTestArtifact( - absl::string_view filename, absl::string_view contents) { - absl::MutexLock lock(&this->write_mutex_); - return WriteToTestArtifact(filename, contents, std::ios_base::trunc, - open_file_by_filepath_); -} -absl::Status BazelTestArtifactWriter::AppendToTestArtifact( - absl::string_view filename, absl::string_view contents) { - absl::MutexLock lock(&this->write_mutex_); - return WriteToTestArtifact(filename, contents, std::ios_base::app, - open_file_by_filepath_); -} - -} // namespace gutil diff --git a/gutil/gutil/test_artifact_writer.h b/gutil/gutil/test_artifact_writer.h deleted file mode 100644 index 9bba9e09f..000000000 --- a/gutil/gutil/test_artifact_writer.h +++ /dev/null @@ -1,86 +0,0 @@ -// Exposes functions to write test artifacts understood by Bazel. - -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_TEST_WRITER_H_ -#define PINS_GUTIL_GUTIL_TEST_WRITER_H_ - -#include -#include -#include - -#include "absl/container/flat_hash_map.h" -#include "absl/status/status.h" -#include "absl/strings/string_view.h" -#include "absl/synchronization/mutex.h" -#include "google/protobuf/message.h" - -namespace gutil { - -// Abstract base class for storing test artifacts. -class TestArtifactWriter { - public: - virtual ~TestArtifactWriter() = default; - - // Stores a test artifact with the specified filename and contents. Overwrites - // existing files. - virtual absl::Status StoreTestArtifact(absl::string_view filename, - absl::string_view contents) = 0; - absl::Status StoreTestArtifact(absl::string_view filename, - const google::protobuf::Message& proto); - - // Appends contents to an existing test artifact with the specified filename. - // Creates a new file if it doesn't exist. - virtual absl::Status AppendToTestArtifact(absl::string_view filename, - absl::string_view contents) = 0; - absl::Status AppendToTestArtifact(absl::string_view filename, - const google::protobuf::Message& proto); -}; - -// A thread-safe class for storing test artifacts. -// -// Calls to {Store,AppendTo}TestArtifact within a BazelTestArtifactWriter -// object are guaranteed to be thread-safe due to writes being sequential. -// -// NOTE: This class assumes a Bazel test environment! See -// https://docs.bazel.build/versions/main/test-encyclopedia.html#initial-conditions -class BazelTestArtifactWriter : public TestArtifactWriter { - public: - // Stores a test artifact with the specified filename and contents. Overwrites - // existing files. - absl::Status StoreTestArtifact(absl::string_view filename, - absl::string_view contents) - ABSL_LOCKS_EXCLUDED(write_mutex_) override; - using TestArtifactWriter::StoreTestArtifact; // Inherit second overload. - - // Appends contents to an existing test artifact with the specified filename. - // Creates a new file if it doesn't exist. - absl::Status AppendToTestArtifact(absl::string_view filename, - absl::string_view contents) - ABSL_LOCKS_EXCLUDED(write_mutex_) override; - using TestArtifactWriter::AppendToTestArtifact; // Inherit second overload. - - private: - // Open files are cached to avoid closing them after every append. On certain - // file systems (e.g. b/111316875) closing files is abnormally slow and this - // avoids it. However, this approach should also generally be faster. - absl::flat_hash_map open_file_by_filepath_; - // The mutex is used to ensure that writes to disk are sequential. - absl::Mutex write_mutex_; -}; - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_TEST_WRITER_H_ diff --git a/gutil/gutil/test_artifact_writer_test.cc b/gutil/gutil/test_artifact_writer_test.cc deleted file mode 100644 index d010c3794..000000000 --- a/gutil/gutil/test_artifact_writer_test.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* Copyright 2024 Google LLC - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "gutil/gutil/test_artifact_writer.h" - -#include -#include - -// Switching benchmark dependency to third_party seems to not output any -// benchmarking information when run. -#include "absl/strings/str_cat.h" -#include "absl/strings/string_view.h" -#include "benchmark/benchmark.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/test_artifact_writer_test.pb.h" - -namespace gutil { -namespace { - -using ::gutil::IsOk; - -// -- Tests -------------------------------------------------------------------- - -constexpr absl::string_view kTestArtifact = "my_test_artifact.txt"; - -ArtifactWriterTestMessage GetTestProto() { - ArtifactWriterTestMessage proto; - proto.set_int_field(42); - proto.set_string_field("Test proto string"); - return proto; -} - -TEST(BazelTestArtifactWriterTest, StoreTestArtifact) { - BazelTestArtifactWriter artifact_writer; - EXPECT_OK( - artifact_writer.StoreTestArtifact(kTestArtifact, "Hello, World!\n")); - EXPECT_OK(artifact_writer.StoreTestArtifact(kTestArtifact, GetTestProto())); -} - -TEST(BazelTestArtifactWriterTest, AppendToTestArtifact) { - BazelTestArtifactWriter artifact_writer; - EXPECT_OK( - artifact_writer.AppendToTestArtifact(kTestArtifact, "Hello, World!\n")); - EXPECT_OK( - artifact_writer.AppendToTestArtifact(kTestArtifact, GetTestProto())); - EXPECT_OK(artifact_writer.AppendToTestArtifact( - absl::StrCat("a/b/c/", kTestArtifact), GetTestProto())); - EXPECT_OK(artifact_writer.AppendToTestArtifact( - absl::StrCat("a/b/d/", kTestArtifact), GetTestProto())); -} - -// Sanity check to rule out crashes and error statuses with mixed appends and -// stores. -TEST(BazelTestArtifactWriterTest, AppendStoreAppendTestArtifact) { - BazelTestArtifactWriter artifact_writer; - EXPECT_OK( - artifact_writer.AppendToTestArtifact(kTestArtifact, "Hello, World!\n")); - EXPECT_OK(artifact_writer.StoreTestArtifact(kTestArtifact, "Hello, Test!\n")); - EXPECT_OK(artifact_writer.AppendToTestArtifact(kTestArtifact, - "Hello again, World!\n")); - EXPECT_OK(artifact_writer.StoreTestArtifact(kTestArtifact, GetTestProto())); - EXPECT_OK( - artifact_writer.AppendToTestArtifact(kTestArtifact, GetTestProto())); -} - -// -- Benchmarks --------------------------------------------------------------- -// -// Best run with 'blaze test --test_arg=--benchmark_filter=all '. -// -// Ideally, we would like to use 'benchy' for benchmarking purposes, but, -// because we are benchmarking a testing environment, it relies on being set -// up as a test environment. -// -// For now, one can manually set the environment variable TEST_TMPDIR, then run -// it with benchy, but do not expect that to remain feasible since we may rely -// on additional parts of the test environment in the future. - -// The state specifies the size of the written string in Bytes. -void RunBenchmark(benchmark::State& state, bool truncate) { - const int size = state.range(0); - const std::string filename = "benchmark_file"; - BazelTestArtifactWriter artifact_writer; - - std::string str(size, 'a'); - if (truncate) { - for (auto s : state) { - ASSERT_THAT(artifact_writer.StoreTestArtifact(filename, str), IsOk()); - } - } else { - for (auto s : state) { - ASSERT_THAT(artifact_writer.AppendToTestArtifact(filename, str), IsOk()); - } - } - // Outputs number of iterations (items) per second. - state.SetItemsProcessed(static_cast(state.iterations())); -} - -void BM_AppendToTestArtifact(benchmark::State& state) { - RunBenchmark(state, /*truncate=*/false); -} - -BENCHMARK(BM_AppendToTestArtifact) - ->Args({/*write_size in bytes=*/1}) - ->Args({1024}) - ->Args({1024 * 1024}); - -void BM_StoreTestArtifact(benchmark::State& state) { - RunBenchmark(state, /*truncate=*/true); -} - -BENCHMARK(BM_StoreTestArtifact) - ->Args({/*write_size in bytes=*/1}) - ->Args({1024}) - ->Args({1024 * 1024}); - -// Benchmarks how performance of Append changes based on the size of the file -// that is appended to. Ideally, performance should not change at all, but this -// problem came up in a previous issue (b/193839478). -void BenchmarkAppendTimeBasedOnStartingSize(benchmark::State& state, - int start_size, int append_size) { - const std::string filename = "benchmark_file"; - BazelTestArtifactWriter artifact_writer; - - // We create a file of the given size to start, then benchmark the time that - // appends take. - ASSERT_THAT( - artifact_writer.StoreTestArtifact(filename, std::string(start_size, 'a')), - IsOk()); - std::string str(append_size, 'a'); - for (auto s : state) { - ASSERT_THAT(artifact_writer.AppendToTestArtifact(filename, str), IsOk()); - } - - // Causes number of iterations (items) per second to be output. - state.SetItemsProcessed(static_cast(state.iterations())); -} - -void BM_AppendTimeBasedOnStartingSize(benchmark::State& state) { - BenchmarkAppendTimeBasedOnStartingSize(state, /*start_size=*/state.range(0), - /*append_size=*/state.range(1)); -} - -BENCHMARK(BM_AppendTimeBasedOnStartingSize) - ->Args({ - /*start_size in bytes=*/1, - /*write_size in bytes=*/1024, - }) - ->Args({1024, 1024}) - ->Args({1024 * 1024, 1024}) - ->Args({1024 * 1024 * 1024, 1024}); - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/test_artifact_writer_test.proto b/gutil/gutil/test_artifact_writer_test.proto deleted file mode 100644 index 226e77611..000000000 --- a/gutil/gutil/test_artifact_writer_test.proto +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package gutil; - -message ArtifactWriterTestMessage { - int32 int_field = 1; - string string_field = 2; -} diff --git a/gutil/gutil/testing.cc b/gutil/gutil/testing.cc deleted file mode 100644 index cbb53ab49..000000000 --- a/gutil/gutil/testing.cc +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include "gutil/gutil/testing.h" - -#include "absl/strings/ascii.h" - -namespace gutil { - -// Implementation taken from protobuf descriptor library. -std::string SnakeCaseToCamelCase(absl::string_view input, bool lower_first) { - bool capitalize_next = true; - std::string result; - result.reserve(input.size()); - - for (char character : input) { - if (character == '_') { - capitalize_next = true; - } else if (capitalize_next) { - result.push_back(absl::ascii_toupper(character)); - capitalize_next = false; - } else { - result.push_back(character); - } - } - - // Lower-case the first letter. - if (lower_first && !result.empty()) { - result[0] = absl::ascii_tolower(result[0]); - } - - return result; -} - -} // namespace gutil diff --git a/gutil/gutil/testing.h b/gutil/gutil/testing.h deleted file mode 100644 index 0564dcb97..000000000 --- a/gutil/gutil/testing.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_TESTING_H -#define PINS_GUTIL_TESTING_H - -#include "absl/log/check.h" -#include "absl/log/log.h" -#include "absl/status/status.h" -#include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" - -namespace gutil { - -// Parses a protobuf from a string, and crashes if parsing failed. Only use in -// tests. -template -T ParseProtoOrDie(absl::string_view proto_string) { - T message; - CHECK_OK(ReadProtoFromString(proto_string, &message)); // Crash OK - return message; -} - -// Parses a protobuf from a file, and crashes if parsing failed. Only use in -// tests. -template -T ParseProtoFileOrDie(absl::string_view proto_file) { - T message; - CHECK_OK(ReadProtoFromFile(proto_file, &message)); // Crash OK - return message; -} - -// Takes a snake_case string and returns a CamelCase string. If `lower_first` is -// set, the first character will be lowercase (if a letter) and otherwise it -// will be uppercase. -// Used to e.g. convert snake case strings to GTEST compatible test names. -std::string SnakeCaseToCamelCase(absl::string_view input, - bool lower_first = false); - -} // namespace gutil - -#endif // PINS_GUTIL_TESTING_H diff --git a/gutil/gutil/testing_test.cc b/gutil/gutil/testing_test.cc deleted file mode 100644 index 9c5fe32b9..000000000 --- a/gutil/gutil/testing_test.cc +++ /dev/null @@ -1,47 +0,0 @@ -#include "gutil/gutil/testing.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -namespace gutil { -namespace { - -TEST(SnakeCaseToCamelCaseTest, WorksForSomeStandardInputs) { - EXPECT_EQ(SnakeCaseToCamelCase("my_camel_case"), "MyCamelCase"); - EXPECT_EQ(SnakeCaseToCamelCase("word"), "Word"); - EXPECT_EQ(SnakeCaseToCamelCase("two_words"), "TwoWords"); - EXPECT_EQ(SnakeCaseToCamelCase("3_words"), "3Words"); - EXPECT_EQ(SnakeCaseToCamelCase("_my_camel_case_"), "MyCamelCase"); -} - -TEST(SnakeCaseToCamelCaseTest, LowerFirstWorks) { - EXPECT_EQ(SnakeCaseToCamelCase("my_camel_case", /*lower_first=*/true), - "myCamelCase"); - EXPECT_EQ(SnakeCaseToCamelCase("word", /*lower_first=*/true), "word"); - EXPECT_EQ(SnakeCaseToCamelCase("two_words", /*lower_first=*/true), - "twoWords"); - EXPECT_EQ(SnakeCaseToCamelCase("3_words", /*lower_first=*/true), "3Words"); - EXPECT_EQ(SnakeCaseToCamelCase("_my_camel_case_", /*lower_first=*/true), - "myCamelCase"); -} - -TEST(SnakeCaseToCamelCaseTest, WorksForWeirdInputs) { - for (bool lower_first : {true, false}) { - EXPECT_EQ(SnakeCaseToCamelCase("_with__extra_underlines_", lower_first), - absl::StrCat(lower_first ? "w" : "W", "ithExtraUnderlines")); - EXPECT_EQ(SnakeCaseToCamelCase("alreadyCamelCase", lower_first), - absl::StrCat(lower_first ? "a" : "A", "lreadyCamelCase")); - // Note that only the first letter after each '_' and the first letter - // changes case. - EXPECT_EQ(SnakeCaseToCamelCase("wEiRd_cASiNg", lower_first), - absl::StrCat(lower_first ? "w" : "W", "EiRdCASiNg")); - EXPECT_EQ(SnakeCaseToCamelCase("?weird_first_character", lower_first), - "?weirdFirstCharacter"); - EXPECT_EQ( - SnakeCaseToCamelCase("many_\nnon-letter..._char:acters", lower_first), - absl::StrCat(lower_first ? "m" : "M", "any\nnon-letter...Char:acters")); - } -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/timer.h b/gutil/gutil/timer.h deleted file mode 100644 index 617923840..000000000 --- a/gutil/gutil/timer.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_TIMER_H_ -#define PINS_GUTIL_GUTIL_TIMER_H_ - -#include "absl/time/clock.h" -#include "absl/time/time.h" - -namespace gutil { - -// A simple timer implementation. -class Timer { - public: - // Returns the duration between the current time and the last reset (or - // initialization). - absl::Duration GetDuration() { return absl::Now() - start_time_; } - - // Same as GetDuration. Resets the timer as well. - absl::Duration GetDurationAndReset() { - absl::Duration duration = GetDuration(); - Reset(); - return duration; - } - - // Subsequent calls to GetDuration will measure the duration between the last - // call to Reset and those calls. - void Reset() { start_time_ = absl::Now(); } - - private: - absl::Time start_time_ = absl::Now(); -}; - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_TIMER_H_ diff --git a/gutil/gutil/timer_test.cc b/gutil/gutil/timer_test.cc deleted file mode 100644 index 1909d463d..000000000 --- a/gutil/gutil/timer_test.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/timer.h" - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -namespace gutil { -namespace { - -using ::testing::Gt; -using ::testing::Lt; - -TEST(TimerTest, GetDurationReturnsApproximatelyCorrectDuration) { - Timer timer; - absl::SleepFor(absl::Milliseconds(1001)); - ASSERT_THAT(timer.GetDuration(), Gt(absl::Milliseconds(1000))); -} - -TEST(TimerTest, GetDurationAfterResetReturnsApproximatelyCorrectDuration) { - Timer timer; - absl::SleepFor(absl::Milliseconds(1000)); - timer.Reset(); - absl::SleepFor(absl::Milliseconds(1001)); - auto duration = timer.GetDuration(); - ASSERT_THAT(duration, Gt(absl::Milliseconds(1000))); - ASSERT_THAT(duration, Lt(absl::Milliseconds(2000))); -} - -TEST(TimerTest, - GetDurationAndResetReturnsApproximatelyCorrectDurationAndResets) { - Timer timer; - absl::SleepFor(absl::Milliseconds(1001)); - ASSERT_THAT(timer.GetDurationAndReset(), Gt(absl::Milliseconds(1000))); - absl::SleepFor(absl::Milliseconds(1001)); - auto duration = timer.GetDuration(); - ASSERT_THAT(duration, Gt(absl::Milliseconds(1000))); - ASSERT_THAT(duration, Lt(absl::Milliseconds(2000))); -} - -} // namespace -} // namespace gutil diff --git a/gutil/gutil/version.cc b/gutil/gutil/version.cc deleted file mode 100644 index bd7ef9d27..000000000 --- a/gutil/gutil/version.cc +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/version.h" - -#include -#include -#include - -#include "absl/log/log.h" -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/str_format.h" -#include "gutil/gutil/status.h" -#include "re2/re2.h" - -namespace gutil { - -namespace { - -// Returns the given version as a tuple. -inline constexpr std::tuple Tupled(Version v) { - return std::make_tuple(v.major_version, v.minor_version, v.patch_version); -} - -} // namespace - -bool operator==(const Version& x, const Version& y) { - return Tupled(x) == Tupled(y); -} -bool operator!=(const Version& x, const Version& y) { - return Tupled(x) != Tupled(y); -} -bool operator<=(const Version& x, const Version& y) { - return Tupled(x) <= Tupled(y); -} -bool operator<(const Version& x, const Version& y) { - return Tupled(x) < Tupled(y); -} -bool operator>=(const Version& x, const Version& y) { - return Tupled(x) >= Tupled(y); -} -bool operator>(const Version& x, const Version& y) { - return Tupled(x) > Tupled(y); -} - -absl::StatusOr ParseVersion(absl::string_view version_string) { - static const LazyRE2 kSemanticVersionRegex = {R"((\d+).(\d+).(\d+))"}; - Version version; - if (!RE2::FullMatch(version_string, *kSemanticVersionRegex, - &version.major_version, &version.minor_version, - &version.patch_version)) { - return gutil::InvalidArgumentErrorBuilder() - << "unable to parse '" << version_string - << "' as a semantic version string; expected string of the form " - "`MAJOR.MINOR.PATCH`, where each sub-string is a decimal string"; - } - return version; -} - -Version ParseVersionOrDie(absl::string_view version_string) { - absl::StatusOr version = ParseVersion(version_string); - if (!version.ok()) { - LOG(FATAL) << version.status(); // Crash OK since that's the point of the - // function. - } - return std::move(*version); -} - -std::string VersionToString(const Version& v) { return absl::StrCat(v); } - -std::ostream& operator<<(std::ostream& os, const Version& v) { - return os << absl::StrCat(v); -} - -} // namespace gutil diff --git a/gutil/gutil/version.h b/gutil/gutil/version.h deleted file mode 100644 index b58a58993..000000000 --- a/gutil/gutil/version.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef PINS_GUTIL_GUTIL_VERSION_H_ -#define PINS_GUTIL_GUTIL_VERSION_H_ - -#include - -#include "absl/status/statusor.h" -#include "absl/strings/str_cat.h" -#include "absl/strings/str_format.h" -#include "absl/strings/string_view.h" - -namespace gutil { - -// Semantic version number (see https://semver.org/), consisting of: -// - `major_version` - incremented when making breaking API changes. -// - `minor_version` - incremented when adding functionality in -// backward-compatible manner. -// - `patch_version` - incremented when making backward-compatible bug fixes. -// -// We don't support extensions such as pre-release and build metadata labels at -// this time. -struct Version { - int major_version = 0; - int minor_version = 0; - int patch_version = 0; -}; - -// Parses semantic version string of the form `MAJOR.MINOR.PATCH`, where each -// of `MAJOR`, `MINOR`, and `PATCH` is an unsigned decimal string. -absl::StatusOr ParseVersion(absl::string_view version_string); - -// Parses semantic version string of the form `MAJOR.MINOR.PATCH`, where each -// of `MAJOR`, `MINOR`, and `PATCH` is an unsigned decimal string. Causes a -// fatal error if the given `version_string` is malformed. -Version ParseVersionOrDie(absl::string_view version_string); - -// Returns semantic version string of the form `MAJOR.MINOR.PATCH`. -std::string VersionToString(const Version& v); - -// Pretty printer. -std::ostream& operator<<(std::ostream& os, const Version& v); - -// Absl pretty printer (https://abseil.io/blog/20221115-stringify). -template -void AbslStringify(Sink& sink, const Version& v); - -// Comparison operators. -bool operator==(const Version& x, const Version& y); -bool operator!=(const Version& x, const Version& y); -bool operator<=(const Version& x, const Version& y); -bool operator<(const Version& x, const Version& y); -bool operator>=(const Version& x, const Version& y); -bool operator>(const Version& x, const Version& y); - -// -- END OF PUBLIC INTERFACE -- implementation details follow ----------------- - -template -void AbslStringify(Sink& sink, const Version& v) { - absl::Format(&sink, "%d.%d.%d", v.major_version, v.minor_version, - v.patch_version); -} - -} // namespace gutil - -#endif // PINS_GUTIL_GUTIL_VERSION_H_ diff --git a/gutil/gutil/version_test.cc b/gutil/gutil/version_test.cc deleted file mode 100644 index dffd34114..000000000 --- a/gutil/gutil/version_test.cc +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "gutil/gutil/version.h" - -#include - -#include "absl/status/status.h" -#include "absl/status/statusor.h" -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" - -namespace gutil { -namespace { - -using ::gutil::IsOkAndHolds; -using ::gutil::StatusIs; -using ::testing::Eq; - -bool VersionToStringRoundTrips(const Version& version) { - absl::StatusOr roundtripped_version = - ParseVersion(VersionToString(version)); - return roundtripped_version.ok() && *roundtripped_version == version; -} - -bool StreamInsertionOperatorRoundTrips(const Version& version) { - std::ostringstream stream; - stream << version; - absl::StatusOr roundtripped_version = ParseVersion(stream.str()); - return roundtripped_version.ok() && *roundtripped_version == version; -} - -TEST(ParseVersionTest, PositiveExamples) { - EXPECT_THAT(ParseVersion("1.2.3"), IsOkAndHolds(Eq(Version{1, 2, 3}))); - EXPECT_THAT(ParseVersion("01.2.3"), IsOkAndHolds(Eq(Version{1, 2, 3}))); - EXPECT_THAT(ParseVersion("255.512.1024"), - IsOkAndHolds(Eq(Version{255, 512, 1024}))); -} - -TEST(ParseVersionTest, NegativeExamples) { - EXPECT_THAT(ParseVersion("100"), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion("1.1"), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion("1.1.1."), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion("1.1.1.1"), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion("1.1.1,0"), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion("hello"), - StatusIs(absl::StatusCode::kInvalidArgument)); - EXPECT_THAT(ParseVersion(""), StatusIs(absl::StatusCode::kInvalidArgument)); -} - -TEST(ParseVersionOrDieTest, PositiveExamples) { - EXPECT_THAT(ParseVersionOrDie("1.2.3"), Eq(Version{1, 2, 3})); - EXPECT_THAT(ParseVersionOrDie("01.2.3"), Eq(Version{1, 2, 3})); - EXPECT_THAT(ParseVersionOrDie("255.512.1024"), Eq(Version{255, 512, 1024})); -} - -TEST(ParseVersionOrDieTest, NegativeExamples) { - // ParseVersionOrDie should die on not-OK input. - // Only testing two failures since EXPECT_DEATH takes a long time to run. - EXPECT_DEATH(ParseVersionOrDie("100"), /*regex=*/""); - EXPECT_DEATH(ParseVersionOrDie("1.1"), /*regex=*/""); -} - -TEST(VersionTest, VersionToStringAndParseVersionRoundTrip) { - EXPECT_TRUE(VersionToStringRoundTrips(Version{1, 2, 3})); - EXPECT_TRUE(VersionToStringRoundTrips(Version{0, 2, 0})); - EXPECT_TRUE(VersionToStringRoundTrips(Version{1024, 987654321, 0})); -} - -TEST(VersionTest, StreamInsertionOperatorAndParseVersionRoundTrip) { - EXPECT_TRUE(StreamInsertionOperatorRoundTrips(Version{1, 2, 3})); - EXPECT_TRUE(StreamInsertionOperatorRoundTrips(Version{0, 2, 0})); - EXPECT_TRUE(StreamInsertionOperatorRoundTrips(Version{1024, 987654321, 0})); -} - -TEST(ComparisonTest, OrderingIsLexicographic) { - EXPECT_GT((Version{1, 0, 1}), (Version{1, 0, 0})); - EXPECT_GT((Version{1, 1, 1}), (Version{1, 0, 1})); - EXPECT_GT((Version{2, 0, 0}), (Version{1, 255, 255})); - EXPECT_GT((Version{0, 1, 0}), (Version{0, 0, 255})); - EXPECT_GT((Version{10, 0, 0}), (Version{2, 0, 0})); -} - -} // namespace -} // namespace gutil diff --git a/lib/BUILD.bazel b/lib/BUILD.bazel index 9ed368723..2377975f9 100644 --- a/lib/BUILD.bazel +++ b/lib/BUILD.bazel @@ -25,8 +25,6 @@ cc_library( srcs = ["pins_control_device.cc"], hdrs = ["pins_control_device.h"], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_programming_context", "//lib/p4rt:packet_listener", @@ -62,6 +60,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -103,7 +103,7 @@ cc_test( srcs = ["basic_switch_test.cc"], deps = [ ":basic_switch", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", "@com_github_gnoi//cert:cert_cc_grpc_proto", "@com_github_gnoi//diag:diag_cc_grpc_proto", @@ -123,10 +123,6 @@ cc_library( hdrs = ["ixia_helper.h"], deps = [ ":ixia_helper_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:overload", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//lib/utils:json_utils", "//p4_pdpi/netaddr:ipv4_address", @@ -146,6 +142,10 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:overload", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -155,9 +155,6 @@ cc_test( deps = [ ":ixia_helper", ":ixia_helper_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//lib/utils:json_test_utils", "//lib/utils:json_utils", "//thinkit:generic_testbed", @@ -168,6 +165,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -189,11 +189,11 @@ cc_library( hdrs = ["lacp_ixia_helper.h"], deps = [ ":ixia_helper", - "//gutil/gutil:overload", "//thinkit:generic_testbed", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:overload", ], ) @@ -203,12 +203,12 @@ cc_test( deps = [ ":ixia_helper", ":lacp_ixia_helper", - "//gutil/gutil:status_matchers", "//lib/utils:json_test_utils", "//thinkit:generic_testbed", "//thinkit:mock_generic_testbed", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -232,11 +232,11 @@ cc_test( srcs = ["ixia_protocol_helper_test.cc"], deps = [ ":ixia_protocol_helper", - "//gutil/gutil:status_matchers", "//lib/utils:json_test_utils", "//thinkit:generic_testbed", "//thinkit:mock_generic_testbed", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/lib/basic_switch_test.cc b/lib/basic_switch_test.cc index 279987277..4df0ad1c2 100644 --- a/lib/basic_switch_test.cc +++ b/lib/basic_switch_test.cc @@ -25,7 +25,7 @@ #include "gmock/gmock.h" #include "grpcpp/support/channel_arguments.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "os/os.grpc.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/lib/basic_traffic/BUILD.bazel b/lib/basic_traffic/BUILD.bazel index 7793b364a..da6f6287c 100644 --- a/lib/basic_traffic/BUILD.bazel +++ b/lib/basic_traffic/BUILD.bazel @@ -25,7 +25,6 @@ cc_library( srcs = ["basic_p4rt_util.cc"], hdrs = ["basic_p4rt_util.h"], deps = [ - "//gutil/gutil:proto", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", @@ -39,6 +38,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:proto", ], ) @@ -47,14 +47,14 @@ cc_test( srcs = ["basic_p4rt_util_test.cc"], deps = [ ":basic_p4rt_util", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//sai_p4/instantiations/google:instantiations", "//sai_p4/instantiations/google:sai_p4info_cc", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -65,7 +65,6 @@ cc_library( hdrs = ["basic_traffic.h"], deps = [ ":basic_p4rt_util", - "//gutil/gutil:collections", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_programming_context", "//lib/utils:generic_testbed_utils", @@ -86,6 +85,7 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:collections", ], ) @@ -94,9 +94,6 @@ cc_test( srcs = ["basic_traffic_test.cc"], deps = [ ":basic_traffic", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:p4_runtime_session", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:packetlib_cc_proto", @@ -120,5 +117,8 @@ cc_test( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/lib/basic_traffic/basic_p4rt_util.cc b/lib/basic_traffic/basic_p4rt_util.cc index bbeaf27f6..c4c0cdc1d 100644 --- a/lib/basic_traffic/basic_p4rt_util.cc +++ b/lib/basic_traffic/basic_p4rt_util.cc @@ -21,8 +21,8 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/lib/basic_traffic/basic_p4rt_util_test.cc b/lib/basic_traffic/basic_p4rt_util_test.cc index 319939fd0..d0072baca 100644 --- a/lib/basic_traffic/basic_p4rt_util_test.cc +++ b/lib/basic_traffic/basic_p4rt_util_test.cc @@ -17,8 +17,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/lib/basic_traffic/basic_traffic.cc b/lib/basic_traffic/basic_traffic.cc index 34e98e387..e39f65df9 100644 --- a/lib/basic_traffic/basic_traffic.cc +++ b/lib/basic_traffic/basic_traffic.cc @@ -35,8 +35,8 @@ #include "absl/time/clock.h" #include "absl/time/time.h" #include "absl/types/span.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "lib/basic_traffic/basic_p4rt_util.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_programming_context.h" diff --git a/lib/basic_traffic/basic_traffic_test.cc b/lib/basic_traffic/basic_traffic_test.cc index 23c50e8d5..6d8e45467 100644 --- a/lib/basic_traffic/basic_traffic_test.cc +++ b/lib/basic_traffic/basic_traffic_test.cc @@ -36,10 +36,10 @@ #include "gmock/gmock.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4_pdpi/packetlib/packetlib.h" diff --git a/lib/gnmi/BUILD.bazel b/lib/gnmi/BUILD.bazel index 2c51847ba..e83e4a997 100644 --- a/lib/gnmi/BUILD.bazel +++ b/lib/gnmi/BUILD.bazel @@ -27,9 +27,6 @@ cc_library( hdrs = ["gnmi_helper.h"], deps = [ ":openconfig_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//lib/p4rt:p4rt_port", "//lib/utils:json_utils", "//p4_pdpi:p4_runtime_session", @@ -57,6 +54,9 @@ cc_library( "@com_google_protobuf//:protobuf", "@com_googlesource_code_re2//:re2", "@com_jsoncpp//:json", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -66,9 +66,9 @@ cc_test( deps = [ ":gnmi_helper", ":openconfig_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", "@com_github_gnmi//proto/gnmi:gnmi_cc_proto", "@com_github_gnoi//types:types_cc_proto", diff --git a/lib/gnmi/gnmi_helper.cc b/lib/gnmi/gnmi_helper.cc index 60745f059..5beac2d65 100644 --- a/lib/gnmi/gnmi_helper.cc +++ b/lib/gnmi/gnmi_helper.cc @@ -54,9 +54,9 @@ #include "google/protobuf/any.pb.h" #include "google/protobuf/text_format.h" #include "grpcpp/client_context.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/p4rt/p4rt_port.h" #include "lib/utils/json_utils.h" diff --git a/lib/gnmi/gnmi_helper_test.cc b/lib/gnmi/gnmi_helper_test.cc index 43a150292..6f6b7b7b9 100644 --- a/lib/gnmi/gnmi_helper_test.cc +++ b/lib/gnmi/gnmi_helper_test.cc @@ -37,9 +37,9 @@ #include "google/protobuf/text_format.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/openconfig.pb.h" #include "proto/gnmi/gnmi.pb.h" diff --git a/lib/gnoi/BUILD.bazel b/lib/gnoi/BUILD.bazel index f5fe64b72..4367047ae 100644 --- a/lib/gnoi/BUILD.bazel +++ b/lib/gnoi/BUILD.bazel @@ -24,7 +24,7 @@ cc_library( srcs = ["gnoi_helper.cc"], hdrs = ["gnoi_helper.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", ], ) @@ -33,8 +33,8 @@ cc_test( srcs = ["gnoi_helper_test.cc"], deps = [ ":gnoi_helper", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", ], ) diff --git a/lib/gnoi/gnoi_helper.cc b/lib/gnoi/gnoi_helper.cc index 2e48c18b3..9ed834953 100644 --- a/lib/gnoi/gnoi_helper.cc +++ b/lib/gnoi/gnoi_helper.cc @@ -14,6 +14,6 @@ #include "lib/gnoi/gnoi_helper.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pins_test {} // namespace pins_test diff --git a/lib/gnoi/gnoi_helper_test.cc b/lib/gnoi/gnoi_helper_test.cc index 07773c449..f701bec8f 100644 --- a/lib/gnoi/gnoi_helper_test.cc +++ b/lib/gnoi/gnoi_helper_test.cc @@ -15,8 +15,8 @@ #include "lib/gnoi/gnoi_helper.h" #include "gmock/gmock.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" namespace pins_test { namespace { diff --git a/lib/ixia_helper.cc b/lib/ixia_helper.cc index 6a0816eea..bc858a5f8 100644 --- a/lib/ixia_helper.cc +++ b/lib/ixia_helper.cc @@ -41,10 +41,10 @@ #include "absl/time/time.h" #include "absl/types/span.h" #include "google/protobuf/struct.pb.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/overload.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/ixia_helper.pb.h" diff --git a/lib/ixia_helper_test.cc b/lib/ixia_helper_test.cc index c453c5f16..17285935e 100644 --- a/lib/ixia_helper_test.cc +++ b/lib/ixia_helper_test.cc @@ -21,9 +21,9 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "include/nlohmann/json.hpp" #include "lib/ixia_helper.pb.h" #include "lib/utils/json_test_utils.h" diff --git a/lib/ixia_protocol_helper.cc b/lib/ixia_protocol_helper.cc index a296e003a..f988e419d 100644 --- a/lib/ixia_protocol_helper.cc +++ b/lib/ixia_protocol_helper.cc @@ -9,7 +9,7 @@ #include "absl/strings/str_join.h" #include "absl/strings/substitute.h" #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/ixia_helper.h" #include "thinkit/generic_testbed.h" diff --git a/lib/ixia_protocol_helper_test.cc b/lib/ixia_protocol_helper_test.cc index 249fc908e..91ea76b89 100644 --- a/lib/ixia_protocol_helper_test.cc +++ b/lib/ixia_protocol_helper_test.cc @@ -4,7 +4,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/utils/json_test_utils.h" #include "thinkit/generic_testbed.h" #include "thinkit/mock_generic_testbed.h" diff --git a/lib/lacp_ixia_helper.cc b/lib/lacp_ixia_helper.cc index c62c5f61b..4260d0cc6 100644 --- a/lib/lacp_ixia_helper.cc +++ b/lib/lacp_ixia_helper.cc @@ -20,8 +20,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/status.h" +#include "gutil/overload.h" +#include "gutil/status.h" #include "lib/ixia_helper.h" #include "thinkit/generic_testbed.h" diff --git a/lib/lacp_ixia_helper_test.cc b/lib/lacp_ixia_helper_test.cc index bbcf0a51f..f217822ce 100644 --- a/lib/lacp_ixia_helper_test.cc +++ b/lib/lacp_ixia_helper_test.cc @@ -20,7 +20,7 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/ixia_helper.h" #include "lib/utils/json_test_utils.h" #include "thinkit/generic_testbed.h" diff --git a/lib/p4rt/BUILD.bazel b/lib/p4rt/BUILD.bazel index c2826ecba..05f028f2c 100644 --- a/lib/p4rt/BUILD.bazel +++ b/lib/p4rt/BUILD.bazel @@ -24,7 +24,6 @@ cc_library( hdrs = ["packet_listener.h"], deps = [ ":p4rt_programming_context", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", @@ -40,6 +39,7 @@ cc_library( "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:testing", ], ) @@ -61,13 +61,13 @@ cc_test( srcs = ["p4rt_programming_context_test.cc"], deps = [ ":p4rt_programming_context", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:p4_runtime_session", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -76,7 +76,6 @@ cc_library( srcs = ["p4rt_port.cc"], hdrs = ["p4rt_port.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi/string_encodings:byte_string", "//p4_pdpi/string_encodings:decimal_string", "//p4_pdpi/string_encodings:hex_string", @@ -86,6 +85,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", ], ) @@ -94,7 +94,7 @@ cc_test( srcs = ["p4rt_port_test.cc"], deps = [ ":p4rt_port", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", diff --git a/lib/p4rt/p4rt_port.cc b/lib/p4rt/p4rt_port.cc index acc1d8b5b..0f5ae86e9 100644 --- a/lib/p4rt/p4rt_port.cc +++ b/lib/p4rt/p4rt_port.cc @@ -25,7 +25,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/byte_string.h" #include "p4_pdpi/string_encodings/decimal_string.h" #include "p4_pdpi/string_encodings/hex_string.h" diff --git a/lib/p4rt/p4rt_port_test.cc b/lib/p4rt/p4rt_port_test.cc index dc8ff712a..f7a42f7f0 100644 --- a/lib/p4rt/p4rt_port_test.cc +++ b/lib/p4rt/p4rt_port_test.cc @@ -24,7 +24,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pins_test { namespace { diff --git a/lib/p4rt/p4rt_programming_context.cc b/lib/p4rt/p4rt_programming_context.cc index 3ab836dc9..67cec8a87 100644 --- a/lib/p4rt/p4rt_programming_context.cc +++ b/lib/p4rt/p4rt_programming_context.cc @@ -21,7 +21,7 @@ #include "absl/log/log.h" #include "absl/status/status.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" namespace pins_test { diff --git a/lib/p4rt/p4rt_programming_context_test.cc b/lib/p4rt/p4rt_programming_context_test.cc index 23640eb6f..3d3414179 100644 --- a/lib/p4rt/p4rt_programming_context_test.cc +++ b/lib/p4rt/p4rt_programming_context_test.cc @@ -19,9 +19,9 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/lib/p4rt/packet_listener.cc b/lib/p4rt/packet_listener.cc index 8ecccdd57..8f5f8edb8 100644 --- a/lib/p4rt/packet_listener.cc +++ b/lib/p4rt/packet_listener.cc @@ -21,8 +21,8 @@ #include "absl/log/log.h" #include "absl/status/status.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "lib/p4rt/p4rt_programming_context.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/lib/pins_control_device.cc b/lib/pins_control_device.cc index 94e178e5e..8eb5bb655 100644 --- a/lib/pins_control_device.cc +++ b/lib/pins_control_device.cc @@ -35,8 +35,8 @@ #include "diag/diag.pb.h" #include "grpcpp/client_context.h" #include "grpcpp/impl/codegen/client_context.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_programming_context.h" diff --git a/lib/ssh/BUILD.bazel b/lib/ssh/BUILD.bazel index a7eec7de1..e7c405b6a 100644 --- a/lib/ssh/BUILD.bazel +++ b/lib/ssh/BUILD.bazel @@ -60,7 +60,6 @@ cc_library( hdrs = ["ssh_wrapper_client.h"], deps = [ ":linux_ssh_helper", - "//gutil/gutil:status", "//thinkit:ssh_client", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status", @@ -68,6 +67,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], ) diff --git a/lib/ssh/ssh_wrapper_client.cc b/lib/ssh/ssh_wrapper_client.cc index cf55a585f..c2f604704 100644 --- a/lib/ssh/ssh_wrapper_client.cc +++ b/lib/ssh/ssh_wrapper_client.cc @@ -22,7 +22,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/ssh/linux_ssh_helper.h" #include "thinkit/ssh_client.h" diff --git a/lib/utils/BUILD.bazel b/lib/utils/BUILD.bazel index 30514b6ee..74a8d9921 100644 --- a/lib/utils/BUILD.bazel +++ b/lib/utils/BUILD.bazel @@ -28,7 +28,7 @@ cc_library( copts = ["-fexceptions"], features = ["-use_header_modules"], # Incompatible with -fexceptions. deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_github_nlohmann_json//:nlohmann_json", "@com_google_absl//absl/container:btree", "@com_google_absl//absl/container:flat_hash_map", @@ -46,7 +46,7 @@ cc_test( srcs = ["json_utils_test.cc"], deps = [ ":json_utils", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_github_nlohmann_json//:nlohmann_json", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -83,7 +83,6 @@ cc_library( srcs = ["generic_testbed_utils.cc"], hdrs = ["generic_testbed_utils.h"], deps = [ - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//lib/validator:validator_lib", "//thinkit:generic_testbed", @@ -94,6 +93,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", ], ) @@ -102,9 +102,6 @@ cc_test( srcs = ["generic_testbed_utils_test.cc"], deps = [ ":generic_testbed_utils", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//thinkit:generic_testbed", "//thinkit:mock_control_device", "//thinkit:mock_generic_testbed", @@ -119,6 +116,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -140,10 +140,10 @@ cc_test( srcs = ["merging_status_bundle_test.cc"], deps = [ ":merging_status_bundle", - "//gutil/gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_absl//absl/synchronization", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers" ], ) diff --git a/lib/utils/generic_testbed_utils.cc b/lib/utils/generic_testbed_utils.cc index fbba6340b..3ddcf97ee 100644 --- a/lib/utils/generic_testbed_utils.cc +++ b/lib/utils/generic_testbed_utils.cc @@ -25,7 +25,7 @@ #include "absl/status/statusor.h" #include "absl/types/span.h" #include "artifacts/otg.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/validator/validator_lib.h" #include "thinkit/generic_testbed.h" diff --git a/lib/utils/generic_testbed_utils_test.cc b/lib/utils/generic_testbed_utils_test.cc index 123e6ed20..2e5040ef2 100644 --- a/lib/utils/generic_testbed_utils_test.cc +++ b/lib/utils/generic_testbed_utils_test.cc @@ -31,9 +31,9 @@ #include "gmock/gmock.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "proto/gnmi/gnmi.pb.h" #include "proto/gnmi/gnmi_mock.grpc.pb.h" diff --git a/lib/utils/json_utils.cc b/lib/utils/json_utils.cc index ac03430dc..45dc08851 100644 --- a/lib/utils/json_utils.cc +++ b/lib/utils/json_utils.cc @@ -27,7 +27,7 @@ #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" namespace json_yang { diff --git a/lib/utils/json_utils_test.cc b/lib/utils/json_utils_test.cc index 310aae5dc..5cce6e7cf 100644 --- a/lib/utils/json_utils_test.cc +++ b/lib/utils/json_utils_test.cc @@ -20,7 +20,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "include/json/reader.h" #include "include/nlohmann/json.hpp" diff --git a/lib/utils/merging_status_bundle_test.cc b/lib/utils/merging_status_bundle_test.cc index fb0d70da5..df09f1ad4 100644 --- a/lib/utils/merging_status_bundle_test.cc +++ b/lib/utils/merging_status_bundle_test.cc @@ -6,7 +6,7 @@ #include "absl/synchronization/mutex.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pins_test { namespace { diff --git a/lib/validator/BUILD.bazel b/lib/validator/BUILD.bazel index 5a5dc58c9..660206a19 100644 --- a/lib/validator/BUILD.bazel +++ b/lib/validator/BUILD.bazel @@ -69,7 +69,7 @@ cc_test( srcs = ["validator_backend_test.cc"], deps = [ ":validator_backend", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", @@ -103,7 +103,6 @@ cc_library( srcs = ["validator_lib.cc"], hdrs = ["validator_lib.h"], deps = [ - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//lib/gnoi:gnoi_helper", "//thinkit:ssh_client", @@ -120,6 +119,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", ], ) @@ -128,13 +128,13 @@ cc_test( srcs = ["validator_lib_test.cc"], deps = [ ":validator_lib", - "//gutil/gutil:status_matchers", "//thinkit:switch", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -168,15 +168,15 @@ cc_test( ":config_validator", "//thinkit:mock_switch", "//thinkit:mock_test_environment", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", "@com_github_grpc_grpc//:grpc++", "@com_github_nlohmann_json//:nlohmann_json", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/lib/validator/config_validator.cc b/lib/validator/config_validator.cc index 002a7a368..47a02635b 100644 --- a/lib/validator/config_validator.cc +++ b/lib/validator/config_validator.cc @@ -18,7 +18,7 @@ #include "absl/strings/string_view.h" #include "absl/time/clock.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/utils/json_utils.h" diff --git a/lib/validator/config_validator_test.cc b/lib/validator/config_validator_test.cc index 7b3a2085f..1eb3af2bc 100644 --- a/lib/validator/config_validator_test.cc +++ b/lib/validator/config_validator_test.cc @@ -9,9 +9,9 @@ #include "gmock/gmock.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "proto/gnmi/gnmi_mock.grpc.pb.h" #include "thinkit/mock_switch.h" diff --git a/lib/validator/validator_backend_test.cc b/lib/validator/validator_backend_test.cc index 0ce52a2a3..6b14cb074 100644 --- a/lib/validator/validator_backend_test.cc +++ b/lib/validator/validator_backend_test.cc @@ -23,7 +23,7 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pins_test { namespace testing { diff --git a/lib/validator/validator_lib.cc b/lib/validator/validator_lib.cc index 0a96f066f..f071ed35a 100644 --- a/lib/validator/validator_lib.cc +++ b/lib/validator/validator_lib.cc @@ -34,7 +34,7 @@ #include "absl/types/span.h" #include "grpcpp/client_context.h" #include "grpcpp/support/status.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnoi/gnoi_helper.h" #include "p4/v1/p4runtime.grpc.pb.h" diff --git a/lib/validator/validator_lib_test.cc b/lib/validator/validator_lib_test.cc index 8d9da1ef6..872bc83e7 100644 --- a/lib/validator/validator_lib_test.cc +++ b/lib/validator/validator_lib_test.cc @@ -27,7 +27,7 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "thinkit/switch.h" namespace pins_test { diff --git a/p4_fuzzer/BUILD.bazel b/p4_fuzzer/BUILD.bazel index 93b57e77f..cf3d1c46f 100644 --- a/p4_fuzzer/BUILD.bazel +++ b/p4_fuzzer/BUILD.bazel @@ -26,9 +26,6 @@ cc_library( srcs = ["switch_state.cc"], hdrs = ["switch_state.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:built_ins", "//p4_pdpi:entity_keys", "//p4_pdpi:ir", @@ -48,6 +45,9 @@ cc_library( "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -56,11 +56,6 @@ cc_test( srcs = ["switch_state_test.cc"], deps = [ ":switch_state", - "//gutil/gutil:collections", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -74,6 +69,11 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -88,8 +88,6 @@ cc_library( deps = [ ":fuzzer_cc_proto", ":switch_state", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//lib/p4rt:p4rt_port", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -106,6 +104,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -114,13 +114,13 @@ cc_test( srcs = ["fuzzer_config_test.cc"], deps = [ ":fuzzer_config", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -141,9 +141,6 @@ cc_library( ":fuzzer_cc_proto", ":fuzzer_config", ":switch_state", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//lib/p4rt:p4rt_port", "//p4_pdpi:built_ins", "//p4_pdpi:entity_keys", @@ -177,6 +174,9 @@ cc_library( "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -195,10 +195,6 @@ cc_test( ":mutation_and_fuzz_util", ":switch_state", ":test_utils", - "//gutil/gutil:collections", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:built_ins", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/testing:test_p4info_cc", @@ -213,6 +209,10 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -222,7 +222,6 @@ cc_library( hdrs = ["annotation_util.h"], deps = [ ":fuzzer_cc_proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:ir", @@ -233,6 +232,7 @@ cc_library( "@com_google_absl//absl/log:check", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -245,7 +245,6 @@ cc_library( deps = [ ":fuzzer_cc_proto", ":switch_state", - "//gutil/gutil:status", "//p4_pdpi:entity_keys", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -256,6 +255,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", ], ) @@ -268,9 +268,6 @@ cc_test( ":oracle_util", ":switch_state", ":test_utils", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/netaddr:ipv4_address", @@ -284,6 +281,9 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -317,10 +317,6 @@ cc_test( ":mutation_and_fuzz_util", ":switch_state", ":test_utils", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4_constraints//p4_constraints:ast_cc_proto", @@ -333,6 +329,10 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -389,10 +389,6 @@ cc_test( linkstatic = True, deps = [ ":switch_state", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/testing:test_p4info_cc", @@ -403,6 +399,10 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) diff --git a/p4_fuzzer/annotation_util.cc b/p4_fuzzer/annotation_util.cc index 9760c9b8f..6687f9bcf 100644 --- a/p4_fuzzer/annotation_util.cc +++ b/p4_fuzzer/annotation_util.cc @@ -17,7 +17,7 @@ #include "absl/log/check.h" #include "absl/log/log.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_fuzzer/fuzzer.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_fuzzer/constraints.cc b/p4_fuzzer/constraints.cc index 00a4447a1..24f8a3c45 100644 --- a/p4_fuzzer/constraints.cc +++ b/p4_fuzzer/constraints.cc @@ -25,8 +25,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_constraints/ast.h" diff --git a/p4_fuzzer/constraints_test.cc b/p4_fuzzer/constraints_test.cc index 6281ad906..553f2d8f0 100644 --- a/p4_fuzzer/constraints_test.cc +++ b/p4_fuzzer/constraints_test.cc @@ -27,11 +27,11 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_constraints/ast.pb.h" diff --git a/p4_fuzzer/fuzz_util.cc b/p4_fuzzer/fuzz_util.cc index 67e01c2a9..2a4fb8b68 100644 --- a/p4_fuzzer/fuzz_util.cc +++ b/p4_fuzzer/fuzz_util.cc @@ -39,9 +39,9 @@ #include "absl/types/span.h" #include "google/protobuf/repeated_field.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" diff --git a/p4_fuzzer/fuzz_util_test.cc b/p4_fuzzer/fuzz_util_test.cc index c1fefd36e..8000bdb8b 100644 --- a/p4_fuzzer/fuzz_util_test.cc +++ b/p4_fuzzer/fuzz_util_test.cc @@ -29,11 +29,11 @@ #include "absl/strings/str_split.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/fuzzer.pb.h" diff --git a/p4_fuzzer/fuzzer_config.cc b/p4_fuzzer/fuzzer_config.cc index e538eb2d4..7538b9259 100644 --- a/p4_fuzzer/fuzzer_config.cc +++ b/p4_fuzzer/fuzzer_config.cc @@ -11,9 +11,9 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" #include "p4_constraints/ast.h" #include "p4_constraints/backend/constraint_info.h" #include "p4_pdpi/ir.h" diff --git a/p4_fuzzer/fuzzer_config_test.cc b/p4_fuzzer/fuzzer_config_test.cc index 27f4bdf32..9c7ecb0ff 100644 --- a/p4_fuzzer/fuzzer_config_test.cc +++ b/p4_fuzzer/fuzzer_config_test.cc @@ -5,8 +5,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_fuzzer/mutation.cc b/p4_fuzzer/mutation.cc index 5c467efae..997b16a14 100644 --- a/p4_fuzzer/mutation.cc +++ b/p4_fuzzer/mutation.cc @@ -15,7 +15,7 @@ #include "absl/algorithm/container.h" #include "absl/status/status.h" -#include "gutil/gutil/collections.h" +#include "gutil/collections.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/fuzz_util.h" #include "p4_fuzzer/fuzzer_config.h" diff --git a/p4_fuzzer/oracle_util.cc b/p4_fuzzer/oracle_util.cc index 024c69f40..7d7b9cae6 100644 --- a/p4_fuzzer/oracle_util.cc +++ b/p4_fuzzer/oracle_util.cc @@ -20,7 +20,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/status.h" #include "absl/types/optional.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/fuzzer.pb.h" diff --git a/p4_fuzzer/oracle_util.h b/p4_fuzzer/oracle_util.h index 303cc7a22..3dbda4a33 100644 --- a/p4_fuzzer/oracle_util.h +++ b/p4_fuzzer/oracle_util.h @@ -23,7 +23,7 @@ #include #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/fuzzer.pb.h" #include "p4_fuzzer/switch_state.h" diff --git a/p4_fuzzer/oracle_util_test.cc b/p4_fuzzer/oracle_util_test.cc index f7f3bf865..5603cbfdf 100644 --- a/p4_fuzzer/oracle_util_test.cc +++ b/p4_fuzzer/oracle_util_test.cc @@ -25,9 +25,9 @@ #include "gmock/gmock.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/fuzz_util.h" diff --git a/p4_fuzzer/switch_state.cc b/p4_fuzzer/switch_state.cc index 067d24822..90931afd6 100644 --- a/p4_fuzzer/switch_state.cc +++ b/p4_fuzzer/switch_state.cc @@ -33,9 +33,9 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/built_ins.h" diff --git a/p4_fuzzer/switch_state.h b/p4_fuzzer/switch_state.h index 5b03313ef..06889bb88 100644 --- a/p4_fuzzer/switch_state.h +++ b/p4_fuzzer/switch_state.h @@ -29,7 +29,7 @@ #include "absl/status/statusor.h" #include "absl/types/optional.h" #include "absl/types/span.h" -#include "gutil/gutil/collections.h" +#include "gutil/collections.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" diff --git a/p4_fuzzer/switch_state_assert_entry_equality_test_runner.cc b/p4_fuzzer/switch_state_assert_entry_equality_test_runner.cc index 741b9a58b..2c411aa85 100644 --- a/p4_fuzzer/switch_state_assert_entry_equality_test_runner.cc +++ b/p4_fuzzer/switch_state_assert_entry_equality_test_runner.cc @@ -11,10 +11,10 @@ #include "absl/strings/substitute.h" #include "absl/types/span.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_fuzzer/switch_state.h" diff --git a/p4_fuzzer/switch_state_test.cc b/p4_fuzzer/switch_state_test.cc index e786c29fd..fb7017000 100644 --- a/p4_fuzzer/switch_state_test.cc +++ b/p4_fuzzer/switch_state_test.cc @@ -25,11 +25,11 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_fuzzer/test_utils.cc b/p4_fuzzer/test_utils.cc index d2aac99db..336f866b8 100644 --- a/p4_fuzzer/test_utils.cc +++ b/p4_fuzzer/test_utils.cc @@ -18,7 +18,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4_infra/p4_pdpi/netaddr/netaddr_files.sh b/p4_infra/p4_pdpi/netaddr/netaddr_files.sh new file mode 100755 index 000000000..88711d699 --- /dev/null +++ b/p4_infra/p4_pdpi/netaddr/netaddr_files.sh @@ -0,0 +1,13 @@ +vimdiff BUILD.bazel /home/sachin/pins-infra-external/p4_infra/netaddr/BUILD.bazel +vimdiff ipv6_address.cc /home/sachin/pins-infra-external/p4_infra/netaddr/ipv6_address.cc +vimdiff ipv4_address.h /home/sachin/pins-infra-external/p4_infra/netaddr/ipv4_address.h +vimdiff ipv4_address.cc /home/sachin/pins-infra-external/p4_infra/netaddr/ipv4_address.cc +vimdiff ipv4_address_and_network_address_test.cc /home/sachin/pins-infra-external/p4_infra/netaddr/ipv4_address_and_network_address_test.cc +vimdiff network_address.h /home/sachin/pins-infra-external/p4_infra/netaddr/network_address.h +vimdiff mac_address_test.cc /home/sachin/pins-infra-external/p4_infra/netaddr/mac_address_test.cc +vimdiff mac_address.h /home/sachin/pins-infra-external/p4_infra/netaddr/mac_address.h +vimdiff mac_address.cc /home/sachin/pins-infra-external/p4_infra/netaddr/mac_address.cc +vimdiff ipv6_address_test.cc /home/sachin/pins-infra-external/p4_infra/netaddr/ipv6_address_test.cc +vimdiff ipv6_address.h /home/sachin/pins-infra-external/p4_infra/netaddr/ipv6_address.h + + diff --git a/p4_pdpi/BUILD.bazel b/p4_pdpi/BUILD.bazel index 35bbe33ac..7b2f7af97 100644 --- a/p4_pdpi/BUILD.bazel +++ b/p4_pdpi/BUILD.bazel @@ -29,9 +29,6 @@ cc_library( ":built_ins", ":ir_cc_proto", ":reference_annotations", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/string_encodings:byte_string", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/container:btree", @@ -42,6 +39,9 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -65,7 +65,7 @@ cc_library( ], deps = [ ":ir_cc_proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", @@ -80,7 +80,7 @@ cc_test( deps = [ ":built_ins", ":ir_cc_proto", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_googletest//:gtest_main", ], ) @@ -96,8 +96,6 @@ cc_library( deps = [ ":built_ins", ":ir_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi/internal:ordered_map", "//p4_pdpi/utils:annotation_parser", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -108,6 +106,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -119,9 +119,6 @@ cc_test( deps = [ ":ir_cc_proto", ":reference_annotations", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/testing:test_p4info_cc", "//p4rt_app/utils:ir_builder", "@com_google_absl//absl/status", @@ -129,6 +126,9 @@ cc_test( "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -140,7 +140,7 @@ cc_library( local_defines = ["PDPI_DISABLE_TRANSLATION_OPTIONS_DEFAULT"], deps = [ ":ir_cc_proto", - "//gutil/gutil:collections", + "@com_google_gutil//gutil:collections", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/container:btree", "@com_google_absl//absl/container:flat_hash_map", @@ -174,8 +174,8 @@ cc_library( ":names", ":references", ":sequencing_util", - "//gutil/gutil:collections", - "//gutil/gutil:status", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", "@boost//:bimap", "@boost//:graph", "@com_github_grpc_grpc//:grpc++", @@ -205,9 +205,6 @@ cc_library( ":ir", ":ir_cc_proto", ":translation_options", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/internal:ordered_map", "//p4_pdpi/string_encodings:hex_string", "//p4_pdpi/utils:ir", @@ -223,6 +220,9 @@ cc_library( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googleapis//google/rpc:status_cc_proto", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -233,8 +233,8 @@ cc_binary( ":ir", ":ir_cc_proto", ":pdgenlib", - "//gutil/gutil:proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/flags:parse", @@ -254,13 +254,13 @@ cc_library( deps = [ ":ir_cc_proto", ":pd", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi/internal:ordered_map", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -271,7 +271,7 @@ cc_library( # Disable default arguments internally. Using them in PDPI itself is very likely a bug. local_defines = ["PDPI_DISABLE_TRANSLATION_OPTIONS_DEFAULT"], deps = [ - "//gutil/gutil:proto", + "@com_google_gutil//gutil:proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4types_cc_proto", "@com_google_absl//absl/status", @@ -288,9 +288,9 @@ cc_test( srcs = ["p4info_union_test.cc"], deps = [ ":p4info_union_lib", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4types_cc_proto", "@com_google_absl//absl/strings", @@ -303,7 +303,7 @@ cc_binary( srcs = ["p4info_union.cc"], deps = [ ":p4info_union_lib", - "//gutil/gutil:proto", + "@com_google_gutil//gutil:proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/flags:parse", @@ -325,9 +325,6 @@ cc_library( ":ir_cc_proto", ":reference_annotations", ":translation_options", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/utils:ir", "@com_github_grpc_grpc//:grpc++", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -345,6 +342,9 @@ cc_library( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googleapis//google/rpc:status_cc_proto", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -353,9 +353,9 @@ cc_test( srcs = ["ir_to_ir_test.cc"], deps = [ ":ir", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", ], ) @@ -403,9 +403,6 @@ cc_library( ":ir_cc_proto", ":names", ":sequencing", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:version", "//sai_p4/fixed:p4_roles", "//sai_p4/instantiations/google:p4_versions", "//thinkit:switch", @@ -426,6 +423,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:version", ], ) @@ -437,8 +437,6 @@ cc_library( local_defines = ["PDPI_DISABLE_TRANSLATION_OPTIONS_DEFAULT"], deps = [ ":ir_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi/utils:ir", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -446,6 +444,8 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -464,7 +464,7 @@ cc_test( srcs = ["ir_properties_test.cc"], deps = [ ":ir_properties", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", ], ) @@ -477,7 +477,7 @@ cc_library( local_defines = ["PDPI_DISABLE_TRANSLATION_OPTIONS_DEFAULT"], deps = [ ":ir_cc_proto", - "//gutil/gutil:collections", + "@com_google_gutil//gutil:collections", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4types_cc_proto", "@com_google_absl//absl/functional:any_invocable", @@ -495,10 +495,6 @@ cc_test( ":ir_cc_proto", ":ir_tools", ":pd", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/testing:main_p4_pd_cc_proto", "//p4_pdpi/testing:test_p4info_cc", "@com_github_p4lang_p4runtime//:p4types_cc_proto", @@ -507,6 +503,10 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -521,8 +521,8 @@ cc_library( ":p4_runtime_session", ":p4_runtime_session_extras_cc_proto", ":pd", - "//gutil/gutil:proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/algorithm:container", @@ -540,12 +540,12 @@ cc_library( testonly = True, hdrs = ["p4_runtime_matchers.h"], deps = [ - "//gutil/gutil:proto_matchers", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto_matchers", ], ) @@ -554,11 +554,11 @@ cc_test( srcs = ["p4_runtime_matchers_test.cc"], deps = [ ":p4_runtime_matchers", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:testing", "//p4_pdpi/packetlib", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -573,7 +573,7 @@ cc_library( srcs = ["entity_keys.cc"], hdrs = ["entity_keys.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/hash", "@com_google_absl//absl/log:check", @@ -589,8 +589,8 @@ cc_test( srcs = ["entity_keys_test.cc"], deps = [ ":entity_keys", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/hash:hash_testing", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -604,8 +604,8 @@ cc_library( deps = [ ":built_ins", ":ir_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", @@ -621,11 +621,11 @@ cc_test( ":built_ins", ":ir_cc_proto", ":names", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/testing:test_p4info_cc", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/p4_pdpi/built_ins.cc b/p4_pdpi/built_ins.cc index fbf621363..13e93bdf0 100644 --- a/p4_pdpi/built_ins.cc +++ b/p4_pdpi/built_ins.cc @@ -19,7 +19,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" namespace pdpi { diff --git a/p4_pdpi/built_ins_test.cc b/p4_pdpi/built_ins_test.cc index aaf291173..f2c087067 100644 --- a/p4_pdpi/built_ins_test.cc +++ b/p4_pdpi/built_ins_test.cc @@ -18,7 +18,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "p4_pdpi/ir.pb.h" namespace pdpi { diff --git a/p4_pdpi/entity_keys.cc b/p4_pdpi/entity_keys.cc index baa0adfae..502125f84 100644 --- a/p4_pdpi/entity_keys.cc +++ b/p4_pdpi/entity_keys.cc @@ -23,7 +23,7 @@ #include "google/protobuf/io/zero_copy_stream_impl_lite.h" #include "google/protobuf/message.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pdpi { diff --git a/p4_pdpi/entity_keys.h b/p4_pdpi/entity_keys.h index 71e48876a..3577aeb75 100644 --- a/p4_pdpi/entity_keys.h +++ b/p4_pdpi/entity_keys.h @@ -24,7 +24,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" namespace pdpi { diff --git a/p4_pdpi/entity_keys_test.cc b/p4_pdpi/entity_keys_test.cc index cff9bad10..4a04ccd0a 100644 --- a/p4_pdpi/entity_keys_test.cc +++ b/p4_pdpi/entity_keys_test.cc @@ -19,8 +19,8 @@ #include "absl/strings/match.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/proto.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep namespace pdpi { namespace { diff --git a/p4_pdpi/ir.cc b/p4_pdpi/ir.cc index 29a839622..8fd5bad1b 100644 --- a/p4_pdpi/ir.cc +++ b/p4_pdpi/ir.cc @@ -43,9 +43,9 @@ #include "google/rpc/code.pb.h" #include "google/rpc/status.pb.h" #include "grpcpp/support/status.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4_pdpi/ir_properties_test.cc b/p4_pdpi/ir_properties_test.cc index 602489fb2..2c8557536 100644 --- a/p4_pdpi/ir_properties_test.cc +++ b/p4_pdpi/ir_properties_test.cc @@ -15,7 +15,7 @@ #include "p4_pdpi/ir_properties.h" #include "gtest/gtest.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.pb.h" namespace pdpi { diff --git a/p4_pdpi/ir_to_ir_test.cc b/p4_pdpi/ir_to_ir_test.cc index ebd1300cc..e88226dad 100644 --- a/p4_pdpi/ir_to_ir_test.cc +++ b/p4_pdpi/ir_to_ir_test.cc @@ -16,9 +16,9 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" using gutil::EqualsProto; using gutil::IsOk; diff --git a/p4_pdpi/ir_tools.cc b/p4_pdpi/ir_tools.cc index 797ec2e60..88004e8a6 100644 --- a/p4_pdpi/ir_tools.cc +++ b/p4_pdpi/ir_tools.cc @@ -21,8 +21,8 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/ir_tools_test.cc b/p4_pdpi/ir_tools_test.cc index 6cc8cce54..ad34ec364 100644 --- a/p4_pdpi/ir_tools_test.cc +++ b/p4_pdpi/ir_tools_test.cc @@ -22,11 +22,11 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4types.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/pd.h" diff --git a/p4_pdpi/names.cc b/p4_pdpi/names.cc index f594e2714..e5af099c3 100644 --- a/p4_pdpi/names.cc +++ b/p4_pdpi/names.cc @@ -18,8 +18,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/built_ins.h" diff --git a/p4_pdpi/names_test.cc b/p4_pdpi/names_test.cc index 3865495c3..e40355a9f 100644 --- a/p4_pdpi/names_test.cc +++ b/p4_pdpi/names_test.cc @@ -18,8 +18,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/built_ins.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/netaddr/BUILD.bazel b/p4_pdpi/netaddr/BUILD.bazel index 76b021bae..58366be02 100644 --- a/p4_pdpi/netaddr/BUILD.bazel +++ b/p4_pdpi/netaddr/BUILD.bazel @@ -7,11 +7,11 @@ cc_library( name = "network_address", hdrs = ["network_address.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi/string_encodings:byte_string", "//p4_pdpi/string_encodings:hex_string", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -21,7 +21,7 @@ cc_library( hdrs = ["ipv4_address.h"], deps = [ ":network_address", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", @@ -34,12 +34,12 @@ cc_test( deps = [ ":ipv4_address", ":network_address", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi/string_encodings:safe", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -49,13 +49,13 @@ cc_library( hdrs = ["ipv6_address.h"], deps = [ ":network_address", - "//gutil/gutil:status", "//p4_pdpi/string_encodings:hex_string", "@com_google_absl//absl/log", "@com_google_absl//absl/numeric:int128", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -65,12 +65,12 @@ cc_test( deps = [ ":ipv6_address", ":network_address", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi/string_encodings:safe", "@com_google_absl//absl/numeric:int128", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -81,7 +81,7 @@ cc_library( deps = [ ":ipv6_address", ":network_address", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", @@ -94,10 +94,10 @@ cc_test( deps = [ ":mac_address", ":network_address", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi/string_encodings:safe", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4_pdpi/netaddr/ipv4_address.cc b/p4_pdpi/netaddr/ipv4_address.cc index 7ed3335e3..36bf34c4d 100644 --- a/p4_pdpi/netaddr/ipv4_address.cc +++ b/p4_pdpi/netaddr/ipv4_address.cc @@ -23,7 +23,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/network_address.h" namespace netaddr { diff --git a/p4_pdpi/netaddr/ipv4_address_and_network_address_test.cc b/p4_pdpi/netaddr/ipv4_address_and_network_address_test.cc index 21cbe4f85..d4da8055d 100644 --- a/p4_pdpi/netaddr/ipv4_address_and_network_address_test.cc +++ b/p4_pdpi/netaddr/ipv4_address_and_network_address_test.cc @@ -23,8 +23,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/netaddr/ipv4_address.h" #include "p4_pdpi/netaddr/network_address.h" #include "p4_pdpi/string_encodings/safe.h" diff --git a/p4_pdpi/netaddr/ipv6_address.cc b/p4_pdpi/netaddr/ipv6_address.cc index a01957542..a4e53bb8e 100644 --- a/p4_pdpi/netaddr/ipv6_address.cc +++ b/p4_pdpi/netaddr/ipv6_address.cc @@ -26,7 +26,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/network_address.h" #include "p4_pdpi/string_encodings/hex_string.h" diff --git a/p4_pdpi/netaddr/ipv6_address_test.cc b/p4_pdpi/netaddr/ipv6_address_test.cc index 2526cb806..74c6d0497 100644 --- a/p4_pdpi/netaddr/ipv6_address_test.cc +++ b/p4_pdpi/netaddr/ipv6_address_test.cc @@ -21,8 +21,8 @@ #include "absl/strings/ascii.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/netaddr/network_address.h" #include "p4_pdpi/string_encodings/safe.h" diff --git a/p4_pdpi/netaddr/mac_address.cc b/p4_pdpi/netaddr/mac_address.cc index d9741b9d2..8e54c0eae 100644 --- a/p4_pdpi/netaddr/mac_address.cc +++ b/p4_pdpi/netaddr/mac_address.cc @@ -24,7 +24,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/ipv6_address.h" #include "p4_pdpi/netaddr/network_address.h" diff --git a/p4_pdpi/netaddr/mac_address_test.cc b/p4_pdpi/netaddr/mac_address_test.cc index 994310b51..8f49955f8 100644 --- a/p4_pdpi/netaddr/mac_address_test.cc +++ b/p4_pdpi/netaddr/mac_address_test.cc @@ -20,8 +20,8 @@ #include "absl/strings/ascii.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/netaddr/network_address.h" #include "p4_pdpi/string_encodings/safe.h" diff --git a/p4_pdpi/netaddr/network_address.h b/p4_pdpi/netaddr/network_address.h index 7d84365d0..724f20bf5 100644 --- a/p4_pdpi/netaddr/network_address.h +++ b/p4_pdpi/netaddr/network_address.h @@ -23,7 +23,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/byte_string.h" #include "p4_pdpi/string_encodings/hex_string.h" diff --git a/p4_pdpi/p4_runtime_matchers.h b/p4_pdpi/p4_runtime_matchers.h index 836184ece..3fb36dd46 100644 --- a/p4_pdpi/p4_runtime_matchers.h +++ b/p4_pdpi/p4_runtime_matchers.h @@ -19,7 +19,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" +#include "gutil/proto_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/p4_pdpi/p4_runtime_matchers_test.cc b/p4_pdpi/p4_runtime_matchers_test.cc index 4a5377fdd..76c668208 100644 --- a/p4_pdpi/p4_runtime_matchers_test.cc +++ b/p4_pdpi/p4_runtime_matchers_test.cc @@ -16,8 +16,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/packetlib/packetlib.h" diff --git a/p4_pdpi/p4_runtime_session.cc b/p4_pdpi/p4_runtime_session.cc index 012165c50..f1e10727c 100644 --- a/p4_pdpi/p4_runtime_session.cc +++ b/p4_pdpi/p4_runtime_session.cc @@ -36,9 +36,9 @@ #include "absl/time/time.h" #include "absl/types/span.h" #include "grpcpp/create_channel.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/version.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/version.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" @@ -48,7 +48,7 @@ #include "p4_pdpi/sequencing.h" // TODO: A temporary dependence on SAI to mask a bug. Safe to remove // in April 2024. -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "sai_p4/instantiations/google/versions.h" #include "thinkit/switch.h" diff --git a/p4_pdpi/p4_runtime_session.h b/p4_pdpi/p4_runtime_session.h index 5158ff8e7..88220e41b 100644 --- a/p4_pdpi/p4_runtime_session.h +++ b/p4_pdpi/p4_runtime_session.h @@ -42,7 +42,7 @@ #include "grpcpp/support/channel_arguments.h" #include "grpcpp/support/status.h" #include "grpcpp/support/sync_stream.h" -#include "gutil/gutil/version.h" +#include "gutil/version.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/p4_runtime_session_extras.cc b/p4_pdpi/p4_runtime_session_extras.cc index 041bc38fd..932e9b06c 100644 --- a/p4_pdpi/p4_runtime_session_extras.cc +++ b/p4_pdpi/p4_runtime_session_extras.cc @@ -23,8 +23,8 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" #include "p4_pdpi/ir.h" diff --git a/p4_pdpi/p4_runtime_session_extras.h b/p4_pdpi/p4_runtime_session_extras.h index 2bbdc9889..d81a90a71 100644 --- a/p4_pdpi/p4_runtime_session_extras.h +++ b/p4_pdpi/p4_runtime_session_extras.h @@ -32,8 +32,8 @@ #include "absl/types/span.h" #include "google/protobuf/message.h" #include "google/protobuf/repeated_field.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/p4_runtime_session_test.cc b/p4_pdpi/p4_runtime_session_test.cc index 360e9b4aa..7a4e57909 100644 --- a/p4_pdpi/p4_runtime_session_test.cc +++ b/p4_pdpi/p4_runtime_session_test.cc @@ -24,9 +24,9 @@ #include "gmock/gmock.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session_mocking.h" diff --git a/p4_pdpi/p4info_union.cc b/p4_pdpi/p4info_union.cc index 637d79945..835934aba 100644 --- a/p4_pdpi/p4info_union.cc +++ b/p4_pdpi/p4info_union.cc @@ -25,7 +25,7 @@ #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/proto.h" +#include "gutil/proto.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/p4info_union_lib.h" diff --git a/p4_pdpi/p4info_union_lib.cc b/p4_pdpi/p4info_union_lib.cc index fd207e9ae..a135f8f5a 100644 --- a/p4_pdpi/p4info_union_lib.cc +++ b/p4_pdpi/p4info_union_lib.cc @@ -28,8 +28,8 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/message.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" diff --git a/p4_pdpi/p4info_union_test.cc b/p4_pdpi/p4info_union_test.cc index 0c7937b70..d41cfeeb8 100644 --- a/p4_pdpi/p4info_union_test.cc +++ b/p4_pdpi/p4info_union_test.cc @@ -18,9 +18,9 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" #include "p4_pdpi/p4info_union_lib.h" diff --git a/p4_pdpi/packetlib/BUILD.bazel b/p4_pdpi/packetlib/BUILD.bazel index 211925afd..a2dfdbfb2 100644 --- a/p4_pdpi/packetlib/BUILD.bazel +++ b/p4_pdpi/packetlib/BUILD.bazel @@ -30,9 +30,6 @@ cc_library( deps = [ ":bit_widths", ":packetlib_cc_proto", - "//gutil/gutil:overload", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/netaddr:ipv4_address", "//p4_pdpi/netaddr:ipv6_address", "//p4_pdpi/netaddr:mac_address", @@ -46,6 +43,9 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", "@com_google_absl//absl/types:variant", + "@com_google_gutil//gutil:overload", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -55,7 +55,7 @@ cc_library( hdrs = ["packetlib_matchers.h"], deps = [ ":packetlib_cc_proto", - "//gutil/gutil:proto_matchers", + "@com_google_gutil//gutil:proto_matchers", ], ) @@ -65,8 +65,6 @@ cc_test( deps = [ ":packetlib", ":packetlib_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//p4_pdpi/string_encodings:hex_string", "//p4_pdpi/string_encodings:readable_byte_string", "@com_google_absl//absl/log", @@ -77,6 +75,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -87,9 +87,9 @@ cc_test( ":bit_widths", ":packetlib", ":packetlib_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:testing", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:testing", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", @@ -106,14 +106,14 @@ cc_test( deps = [ ":packetlib", ":packetlib_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi/string_encodings:readable_byte_string", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -123,7 +123,7 @@ cc_test( deps = [ ":packetlib_cc_proto", ":packetlib_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", ], @@ -135,12 +135,12 @@ cc_test( deps = [ ":packetlib", ":packetlib_cc_proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi/string_encodings:readable_byte_string", "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/p4_pdpi/packetlib/packetlib.cc b/p4_pdpi/packetlib/packetlib.cc index 42d84d02d..4d1864c0a 100644 --- a/p4_pdpi/packetlib/packetlib.cc +++ b/p4_pdpi/packetlib/packetlib.cc @@ -32,9 +32,9 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "absl/types/variant.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/overload.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/ipv4_address.h" #include "p4_pdpi/netaddr/ipv6_address.h" #include "p4_pdpi/netaddr/mac_address.h" diff --git a/p4_pdpi/packetlib/packetlib_debugging_test.cc b/p4_pdpi/packetlib/packetlib_debugging_test.cc index 19dd11922..f001d5de7 100644 --- a/p4_pdpi/packetlib/packetlib_debugging_test.cc +++ b/p4_pdpi/packetlib/packetlib_debugging_test.cc @@ -17,8 +17,8 @@ #include "absl/log/log.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "p4_pdpi/string_encodings/readable_byte_string.h" diff --git a/p4_pdpi/packetlib/packetlib_fuzzer_test.cc b/p4_pdpi/packetlib/packetlib_fuzzer_test.cc index a65515013..41dd6df5f 100644 --- a/p4_pdpi/packetlib/packetlib_fuzzer_test.cc +++ b/p4_pdpi/packetlib/packetlib_fuzzer_test.cc @@ -24,8 +24,8 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/string_encodings/hex_string.h" #include "p4_pdpi/string_encodings/readable_byte_string.h" diff --git a/p4_pdpi/packetlib/packetlib_matchers.h b/p4_pdpi/packetlib/packetlib_matchers.h index 291cb31d4..ab168d93c 100644 --- a/p4_pdpi/packetlib/packetlib_matchers.h +++ b/p4_pdpi/packetlib/packetlib_matchers.h @@ -15,7 +15,7 @@ #ifndef PINS_P4_PDPI_PACKETLIB_PACKETLIB_MATCHERS_H_ #define PINS_P4_PDPI_PACKETLIB_PACKETLIB_MATCHERS_H_ -#include "gutil/gutil/proto_matchers.h" +#include "gutil/proto_matchers.h" #include "p4_pdpi/packetlib/packetlib.pb.h" namespace packetlib { diff --git a/p4_pdpi/packetlib/packetlib_matchers_test.cc b/p4_pdpi/packetlib/packetlib_matchers_test.cc index 20f6717a2..370bc2543 100644 --- a/p4_pdpi/packetlib/packetlib_matchers_test.cc +++ b/p4_pdpi/packetlib/packetlib_matchers_test.cc @@ -17,7 +17,7 @@ #include "gmock/gmock.h" #include "google/protobuf/repeated_ptr_field.h" #include "gtest/gtest.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.pb.h" namespace packetlib { diff --git a/p4_pdpi/packetlib/packetlib_test_runner.cc b/p4_pdpi/packetlib/packetlib_test_runner.cc index 6fd1c787c..d5ccb439d 100644 --- a/p4_pdpi/packetlib/packetlib_test_runner.cc +++ b/p4_pdpi/packetlib/packetlib_test_runner.cc @@ -21,9 +21,9 @@ #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "p4_pdpi/string_encodings/readable_byte_string.h" diff --git a/p4_pdpi/packetlib/packetlib_unit_test.cc b/p4_pdpi/packetlib/packetlib_unit_test.cc index cc1b27a5f..6aaffd42b 100644 --- a/p4_pdpi/packetlib/packetlib_unit_test.cc +++ b/p4_pdpi/packetlib/packetlib_unit_test.cc @@ -24,9 +24,9 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/bit_widths.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/p4_pdpi/pd.cc b/p4_pdpi/pd.cc index 44ec88810..5ce4a008d 100644 --- a/p4_pdpi/pd.cc +++ b/p4_pdpi/pd.cc @@ -36,9 +36,9 @@ #include "google/protobuf/message.h" #include "google/rpc/code.pb.h" #include "google/rpc/status.pb.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/internal/ordered_map.h" diff --git a/p4_pdpi/pd.h b/p4_pdpi/pd.h index 85cd17614..3361a2294 100644 --- a/p4_pdpi/pd.h +++ b/p4_pdpi/pd.h @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/types/span.h" #include "google/protobuf/message.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_pdpi/pdgen.cc b/p4_pdpi/pdgen.cc index d95386ccf..e98277854 100644 --- a/p4_pdpi/pdgen.cc +++ b/p4_pdpi/pdgen.cc @@ -26,8 +26,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/pdgenlib.cc b/p4_pdpi/pdgenlib.cc index c04fd58a4..a2b9ae6fe 100644 --- a/p4_pdpi/pdgenlib.cc +++ b/p4_pdpi/pdgenlib.cc @@ -30,8 +30,8 @@ #include "absl/strings/string_view.h" #include "absl/strings/strip.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/pdgenlib.h b/p4_pdpi/pdgenlib.h index f3bd68d77..89837f3bc 100644 --- a/p4_pdpi/pdgenlib.h +++ b/p4_pdpi/pdgenlib.h @@ -21,7 +21,7 @@ #include #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" namespace pdpi { diff --git a/p4_pdpi/pi.cc b/p4_pdpi/pi.cc index e55b46d9e..bd4936333 100644 --- a/p4_pdpi/pi.cc +++ b/p4_pdpi/pi.cc @@ -17,8 +17,8 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "google/protobuf/map.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/reference_annotations.cc b/p4_pdpi/reference_annotations.cc index 835b15d85..d71f1a2b0 100644 --- a/p4_pdpi/reference_annotations.cc +++ b/p4_pdpi/reference_annotations.cc @@ -25,8 +25,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/built_ins.h" #include "p4_pdpi/internal/ordered_map.h" diff --git a/p4_pdpi/reference_annotations_test.cc b/p4_pdpi/reference_annotations_test.cc index 329688029..732078547 100644 --- a/p4_pdpi/reference_annotations_test.cc +++ b/p4_pdpi/reference_annotations_test.cc @@ -9,9 +9,9 @@ #include "gmock/gmock.h" #include "google/protobuf/repeated_ptr_field.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/testing/test_p4info.h" #include "p4rt_app/utils/ir_builder.h" diff --git a/p4_pdpi/references.cc b/p4_pdpi/references.cc index 9b0cdcc4e..26c2e9570 100644 --- a/p4_pdpi/references.cc +++ b/p4_pdpi/references.cc @@ -25,9 +25,9 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/built_ins.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/sequencing.cc b/p4_pdpi/sequencing.cc index c30ad400d..3b61efa70 100644 --- a/p4_pdpi/sequencing.cc +++ b/p4_pdpi/sequencing.cc @@ -33,8 +33,8 @@ #include "absl/types/span.h" #include "boost/graph/adjacency_list.hpp" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/sequencing_util.cc b/p4_pdpi/sequencing_util.cc index b9665ec6e..c2e0a8b4f 100644 --- a/p4_pdpi/sequencing_util.cc +++ b/p4_pdpi/sequencing_util.cc @@ -24,8 +24,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/types/span.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/string_encodings/BUILD.bazel b/p4_pdpi/string_encodings/BUILD.bazel index b9c9cdb01..4880ea32a 100644 --- a/p4_pdpi/string_encodings/BUILD.bazel +++ b/p4_pdpi/string_encodings/BUILD.bazel @@ -10,7 +10,7 @@ cc_library( srcs = ["byte_string.cc"], hdrs = ["byte_string.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", ], @@ -22,8 +22,8 @@ cc_test( deps = [ ":byte_string", ":safe", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], @@ -41,13 +41,13 @@ cc_library( hdrs = ["bit_string.h"], deps = [ ":hex_string", - "//gutil/gutil:status", "//p4_pdpi/netaddr:ipv4_address", "//p4_pdpi/netaddr:ipv6_address", "//p4_pdpi/netaddr:mac_address", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -56,7 +56,7 @@ cc_test( srcs = ["bit_string_test.cc"], deps = [ ":bit_string", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", ], @@ -69,7 +69,7 @@ cc_library( deps = [ ":bit_string", ":hex_string", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", ], @@ -80,7 +80,7 @@ cc_test( srcs = ["readable_byte_string_test.cc"], deps = [ ":readable_byte_string", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_googletest//:gtest_main", ], ) @@ -90,10 +90,10 @@ cc_library( srcs = ["hex_string.cc"], hdrs = ["hex_string.h"], deps = [ - ":byte_string", + ":byte_string", ":safe", - "//gutil/gutil:status", - "@com_google_absl//absl/log", + "@com_google_absl//absl/log", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", @@ -125,7 +125,7 @@ cc_library( srcs = ["decimal_string.cc"], hdrs = ["decimal_string.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", diff --git a/p4_pdpi/string_encodings/bit_string.cc b/p4_pdpi/string_encodings/bit_string.cc index 40383000f..440085e29 100644 --- a/p4_pdpi/string_encodings/bit_string.cc +++ b/p4_pdpi/string_encodings/bit_string.cc @@ -18,7 +18,7 @@ #include "absl/status/status.h" #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/mac_address.h" namespace pdpi { diff --git a/p4_pdpi/string_encodings/bit_string_test.cc b/p4_pdpi/string_encodings/bit_string_test.cc index b1b44beca..2394c1060 100644 --- a/p4_pdpi/string_encodings/bit_string_test.cc +++ b/p4_pdpi/string_encodings/bit_string_test.cc @@ -16,7 +16,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pdpi { diff --git a/p4_pdpi/string_encodings/byte_string.h b/p4_pdpi/string_encodings/byte_string.h index 2e6fea100..3b34d8b51 100644 --- a/p4_pdpi/string_encodings/byte_string.h +++ b/p4_pdpi/string_encodings/byte_string.h @@ -38,7 +38,7 @@ #include "absl/status/statusor.h" #include "absl/strings/escaping.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pdpi { diff --git a/p4_pdpi/string_encodings/byte_string_test.cc b/p4_pdpi/string_encodings/byte_string_test.cc index 4d59b838c..093e6b5ae 100644 --- a/p4_pdpi/string_encodings/byte_string_test.cc +++ b/p4_pdpi/string_encodings/byte_string_test.cc @@ -26,8 +26,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/string_encodings/safe.h" namespace pdpi { diff --git a/p4_pdpi/string_encodings/decimal_string.cc b/p4_pdpi/string_encodings/decimal_string.cc index 7117a4fe8..094638f29 100644 --- a/p4_pdpi/string_encodings/decimal_string.cc +++ b/p4_pdpi/string_encodings/decimal_string.cc @@ -19,7 +19,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pdpi { namespace { diff --git a/p4_pdpi/string_encodings/hex_string.cc b/p4_pdpi/string_encodings/hex_string.cc index 93bdd4057..4d97f050c 100644 --- a/p4_pdpi/string_encodings/hex_string.cc +++ b/p4_pdpi/string_encodings/hex_string.cc @@ -24,7 +24,7 @@ #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/byte_string.h" #include "p4_pdpi/string_encodings/safe.h" diff --git a/p4_pdpi/string_encodings/hex_string.h b/p4_pdpi/string_encodings/hex_string.h index 995e69d35..e38191b39 100644 --- a/p4_pdpi/string_encodings/hex_string.h +++ b/p4_pdpi/string_encodings/hex_string.h @@ -31,7 +31,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/strings/strip.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pdpi { diff --git a/p4_pdpi/string_encodings/readable_byte_string.cc b/p4_pdpi/string_encodings/readable_byte_string.cc index e190d0d0e..f64fd3d64 100644 --- a/p4_pdpi/string_encodings/readable_byte_string.cc +++ b/p4_pdpi/string_encodings/readable_byte_string.cc @@ -19,7 +19,7 @@ #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/strings/strip.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/bit_string.h" #include "p4_pdpi/string_encodings/hex_string.h" diff --git a/p4_pdpi/string_encodings/readable_byte_string_test.cc b/p4_pdpi/string_encodings/readable_byte_string_test.cc index 29e607c52..bfaa43374 100644 --- a/p4_pdpi/string_encodings/readable_byte_string_test.cc +++ b/p4_pdpi/string_encodings/readable_byte_string_test.cc @@ -15,7 +15,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pdpi { diff --git a/p4_pdpi/testing/BUILD.bazel b/p4_pdpi/testing/BUILD.bazel index 771657dfc..3633aa2fd 100644 --- a/p4_pdpi/testing/BUILD.bazel +++ b/p4_pdpi/testing/BUILD.bazel @@ -14,7 +14,7 @@ load("@com_github_p4lang_p4c//:bazel/p4_library.bzl", "p4_library") load("@com_google_googleapis_imports//:imports.bzl", "cc_proto_library") -load("//gutil/gutil/embed_data:build_defs.bzl", "cc_embed_data") +load("@com_google_gutil//gutil/embed_data:build_defs.bzl", "cc_embed_data") load("//p4_pdpi:pdgen.bzl", "p4_pd_proto") load("//p4_pdpi/testing:diff_test.bzl", "cmd_diff_test", "diff_test") @@ -122,9 +122,6 @@ cc_library( testonly = True, hdrs = ["test_helper.h"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:translation_options", @@ -133,6 +130,9 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -158,8 +158,6 @@ cc_test( deps = [ ":main_p4_pd_cc_proto", ":test_helper", - "//gutil/gutil:proto", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -171,6 +169,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:testing", ], ) @@ -192,8 +192,6 @@ cc_test( ":main_p4_pd_cc_proto", ":test_helper", ":test_p4info_cc", - "//gutil/gutil:proto", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", "//p4_pdpi:sequencing_util", @@ -202,6 +200,8 @@ cc_test( "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:testing", ], ) @@ -220,9 +220,6 @@ cc_test( ":main_p4_pd_cc_proto", ":test_helper", ":test_p4info_cc", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", "//p4_pdpi:references", @@ -232,6 +229,9 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -251,9 +251,6 @@ cc_test( linkstatic = True, deps = [ ":test_helper", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -262,6 +259,9 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -285,9 +285,6 @@ cc_test( deps = [ ":main_p4_pd_cc_proto", ":test_helper", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -302,6 +299,9 @@ cc_test( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googleapis//google/rpc:status_cc_proto", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -325,8 +325,6 @@ cc_test( deps = [ ":main_p4_pd_cc_proto", ":test_helper", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -336,6 +334,8 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -359,8 +359,6 @@ cc_test( deps = [ ":test_helper", ":union_main_p4_pd_cc_proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -370,6 +368,8 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -388,9 +388,6 @@ cc_test( srcs = ["helper_function_test.cc"], deps = [ "main_p4_pd_cc_proto", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:pd", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", @@ -398,6 +395,9 @@ cc_test( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -407,10 +407,6 @@ cc_test( deps = [ ":main_p4_pd_cc_proto", ":test_p4info_cc", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -421,6 +417,10 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4_pdpi/testing/helper_function_test.cc b/p4_pdpi/testing/helper_function_test.cc index d5e2922e4..f2fde04d6 100644 --- a/p4_pdpi/testing/helper_function_test.cc +++ b/p4_pdpi/testing/helper_function_test.cc @@ -19,9 +19,9 @@ #include "google/protobuf/message.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/pd.h" #include "p4_pdpi/testing/main_p4_pd.pb.h" diff --git a/p4_pdpi/testing/info_test_runner.cc b/p4_pdpi/testing/info_test_runner.cc index 82b22dcd3..6b88f5995 100644 --- a/p4_pdpi/testing/info_test_runner.cc +++ b/p4_pdpi/testing/info_test_runner.cc @@ -23,9 +23,9 @@ #include "absl/strings/match.h" #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/testing/packet_io_test_runner.cc b/p4_pdpi/testing/packet_io_test_runner.cc index 99283b9d5..9af0735cc 100644 --- a/p4_pdpi/testing/packet_io_test_runner.cc +++ b/p4_pdpi/testing/packet_io_test_runner.cc @@ -17,8 +17,8 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_pdpi/testing/references_test_runner.cc b/p4_pdpi/testing/references_test_runner.cc index 4514f34ad..f9883c87d 100644 --- a/p4_pdpi/testing/references_test_runner.cc +++ b/p4_pdpi/testing/references_test_runner.cc @@ -23,9 +23,9 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/pd.h" diff --git a/p4_pdpi/testing/rpc_test_runner.cc b/p4_pdpi/testing/rpc_test_runner.cc index dd1b1babf..f859913c2 100644 --- a/p4_pdpi/testing/rpc_test_runner.cc +++ b/p4_pdpi/testing/rpc_test_runner.cc @@ -24,9 +24,9 @@ #include "google/rpc/code.pb.h" #include "google/rpc/status.pb.h" #include "grpcpp/grpcpp.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_pdpi/testing/sequencing_test_runner.cc b/p4_pdpi/testing/sequencing_test_runner.cc index 63cff793b..22f6ef797 100644 --- a/p4_pdpi/testing/sequencing_test_runner.cc +++ b/p4_pdpi/testing/sequencing_test_runner.cc @@ -24,8 +24,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/substitute.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/testing.h" #include "gutils/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4_pdpi/testing/sequencing_util_test_runner.cc b/p4_pdpi/testing/sequencing_util_test_runner.cc index 35bd5e9d5..6de2078b9 100644 --- a/p4_pdpi/testing/sequencing_util_test_runner.cc +++ b/p4_pdpi/testing/sequencing_util_test_runner.cc @@ -7,8 +7,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/pd.h" #include "p4_pdpi/sequencing_util.h" diff --git a/p4_pdpi/testing/table_entry_gunit_test.cc b/p4_pdpi/testing/table_entry_gunit_test.cc index c9793bcd0..607f68d00 100644 --- a/p4_pdpi/testing/table_entry_gunit_test.cc +++ b/p4_pdpi/testing/table_entry_gunit_test.cc @@ -8,10 +8,10 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_pdpi/testing/table_entry_test_runner.cc b/p4_pdpi/testing/table_entry_test_runner.cc index 7b057efa1..c899cbcbf 100644 --- a/p4_pdpi/testing/table_entry_test_runner.cc +++ b/p4_pdpi/testing/table_entry_test_runner.cc @@ -18,8 +18,8 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_pdpi/testing/test_helper.h b/p4_pdpi/testing/test_helper.h index f03f28d23..d071985fc 100644 --- a/p4_pdpi/testing/test_helper.h +++ b/p4_pdpi/testing/test_helper.h @@ -27,9 +27,9 @@ #include "absl/strings/string_view.h" #include "google/protobuf/message.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/translation_options.h" diff --git a/p4_pdpi/utils/BUILD.bazel b/p4_pdpi/utils/BUILD.bazel index 0f48c49da..7f3ba2d5f 100644 --- a/p4_pdpi/utils/BUILD.bazel +++ b/p4_pdpi/utils/BUILD.bazel @@ -26,7 +26,7 @@ cc_library( "annotation_parser.h", ], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", ], @@ -37,7 +37,7 @@ cc_test( srcs = ["annotation_parser_test.cc"], deps = [ ":annotation_parser", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", @@ -54,8 +54,6 @@ cc_library( "ir.h", ], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:translation_options", "//p4_pdpi/netaddr:ipv4_address", @@ -73,6 +71,8 @@ cc_library( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_protobuf//:protobuf", "@com_google_protobuf//third_party/utf8_range:utf8_validity", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -81,9 +81,6 @@ cc_test( srcs = ["ir_test.cc"], deps = [ ":ir", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/netaddr:ipv6_address", "@com_google_absl//absl/status", @@ -91,5 +88,8 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4_pdpi/utils/annotation_parser.cc b/p4_pdpi/utils/annotation_parser.cc index 501079012..7c3340d95 100644 --- a/p4_pdpi/utils/annotation_parser.cc +++ b/p4_pdpi/utils/annotation_parser.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace pdpi { namespace { diff --git a/p4_pdpi/utils/annotation_parser.h b/p4_pdpi/utils/annotation_parser.h index 0317ba688..715e5a257 100644 --- a/p4_pdpi/utils/annotation_parser.h +++ b/p4_pdpi/utils/annotation_parser.h @@ -24,7 +24,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" // This header file defines libraries for parsing P4 annotations. // diff --git a/p4_pdpi/utils/annotation_parser_test.cc b/p4_pdpi/utils/annotation_parser_test.cc index 386594d89..6106f64a7 100644 --- a/p4_pdpi/utils/annotation_parser_test.cc +++ b/p4_pdpi/utils/annotation_parser_test.cc @@ -28,7 +28,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace pdpi { namespace annotation { diff --git a/p4_pdpi/utils/ir.cc b/p4_pdpi/utils/ir.cc index 63d1b8669..648743f5d 100644 --- a/p4_pdpi/utils/ir.cc +++ b/p4_pdpi/utils/ir.cc @@ -44,8 +44,8 @@ #include "absl/strings/substitute.h" #include "google/protobuf/repeated_ptr_field.h" #include "google/rpc/code.pb.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/config/v1/p4types.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4_pdpi/utils/ir_test.cc b/p4_pdpi/utils/ir_test.cc index 878ce3514..109120cbc 100644 --- a/p4_pdpi/utils/ir_test.cc +++ b/p4_pdpi/utils/ir_test.cc @@ -28,9 +28,9 @@ #include "google/protobuf/repeated_ptr_field.h" #include "google/protobuf/util/message_differencer.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/netaddr/ipv6_address.h" diff --git a/p4_symbolic/BUILD.bazel b/p4_symbolic/BUILD.bazel index 0fcad3f0a..3c63b95ce 100644 --- a/p4_symbolic/BUILD.bazel +++ b/p4_symbolic/BUILD.bazel @@ -26,7 +26,6 @@ cc_binary( ], deps = [ ":test_util", - "//gutil/gutil:io", "//p4_pdpi/internal:ordered_map", "//p4_symbolic/symbolic", "//p4_symbolic/symbolic:solver_state", @@ -38,6 +37,7 @@ cc_binary( "@com_google_absl//absl/status", "@com_google_absl//absl/strings:str_format", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:io", ], ) @@ -46,7 +46,6 @@ cc_library( srcs = ["z3_util.cc"], hdrs = ["z3_util.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi/string_encodings:bit_string", "//p4_pdpi/string_encodings:hex_string", "@com_github_z3prover_z3//:api", @@ -56,6 +55,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:optional", + "@com_google_gutil//gutil:status", ], ) @@ -65,8 +65,8 @@ cc_library( srcs = ["test_util.cc"], hdrs = ["test_util.h"], deps = [ - "//gutil/gutil:io", - "//gutil/gutil:proto", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status:statusor", @@ -79,11 +79,11 @@ cc_test( srcs = ["z3_util_test.cc"], deps = [ ":z3_util", - "//gutil/gutil:status_matchers", "//p4_pdpi/string_encodings:bit_string", "@com_github_z3prover_z3//:api", "@com_google_absl//absl/numeric:int128", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4_symbolic/bmv2/BUILD.bazel b/p4_symbolic/bmv2/BUILD.bazel index e292a83f4..09e875c93 100644 --- a/p4_symbolic/bmv2/BUILD.bazel +++ b/p4_symbolic/bmv2/BUILD.bazel @@ -47,8 +47,8 @@ cc_library( ], deps = [ ":bmv2_cc_proto", - "//gutil/gutil:io", - "//gutil/gutil:status", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:status", "@com_google_protobuf//:protobuf", ], ) @@ -58,9 +58,9 @@ cc_binary( srcs = ["test.cc"], deps = [ ":bmv2", - "//gutil/gutil:io", - "//gutil/gutil:proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/flags:parse", "@com_google_absl//absl/flags:usage", diff --git a/p4_symbolic/bmv2/bmv2.cc b/p4_symbolic/bmv2/bmv2.cc index 191bd258c..08dec2564 100644 --- a/p4_symbolic/bmv2/bmv2.cc +++ b/p4_symbolic/bmv2/bmv2.cc @@ -17,8 +17,8 @@ #include #include "google/protobuf/util/json_util.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/status.h" namespace p4_symbolic { namespace bmv2 { diff --git a/p4_symbolic/bmv2/bmv2.h b/p4_symbolic/bmv2/bmv2.h index 0612e19b3..a4adc6292 100644 --- a/p4_symbolic/bmv2/bmv2.h +++ b/p4_symbolic/bmv2/bmv2.h @@ -17,7 +17,7 @@ #include -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_symbolic/bmv2/bmv2.pb.h" namespace p4_symbolic { diff --git a/p4_symbolic/bmv2/test.cc b/p4_symbolic/bmv2/test.cc index b97605756..a2b70d89d 100644 --- a/p4_symbolic/bmv2/test.cc +++ b/p4_symbolic/bmv2/test.cc @@ -28,9 +28,9 @@ #include "absl/status/status.h" #include "absl/strings/str_format.h" #include "google/protobuf/util/json_util.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_symbolic/bmv2/bmv2.h" ABSL_FLAG(std::string, bmv2, "", "The path to the bmv2 json file (required)"); diff --git a/p4_symbolic/ir/BUILD.bazel b/p4_symbolic/ir/BUILD.bazel index 62e42b2e3..5fa92df0e 100644 --- a/p4_symbolic/ir/BUILD.bazel +++ b/p4_symbolic/ir/BUILD.bazel @@ -44,7 +44,6 @@ cc_library( ], deps = [ ":ir_cc_proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:names", @@ -54,6 +53,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:status", ], ) @@ -69,7 +69,6 @@ cc_library( ":cfg", ":ir_cc_proto", ":table_entries", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:names", "//p4_pdpi/internal:ordered_map", @@ -82,6 +81,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", ], ) @@ -95,7 +95,6 @@ cc_library( deps = [ ":ir_cc_proto", ":table_entries", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_symbolic/bmv2:bmv2_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -106,6 +105,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", ], ) @@ -133,8 +133,8 @@ cc_test( ":cfg", ":ir", ":ir_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/container:btree", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", @@ -150,14 +150,14 @@ cc_binary( deps = [ ":ir_cc_proto", ":parser", - "//gutil/gutil:io", - "//gutil/gutil:proto", "//p4_symbolic:test_util", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/flags:parse", "@com_google_absl//absl/flags:usage", "@com_google_absl//absl/status", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", ], ) diff --git a/p4_symbolic/ir/cfg.cc b/p4_symbolic/ir/cfg.cc index 2484330af..12492f4fa 100644 --- a/p4_symbolic/ir/cfg.cc +++ b/p4_symbolic/ir/cfg.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_join.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_symbolic/ir/ir.h" namespace p4_symbolic::ir { diff --git a/p4_symbolic/ir/cfg_test.cc b/p4_symbolic/ir/cfg_test.cc index e6e8798f0..c88c1a871 100644 --- a/p4_symbolic/ir/cfg_test.cc +++ b/p4_symbolic/ir/cfg_test.cc @@ -10,8 +10,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "p4_symbolic/ir/ir.h" #include "p4_symbolic/ir/ir.pb.h" diff --git a/p4_symbolic/ir/ir.cc b/p4_symbolic/ir/ir.cc index aa3eb8b38..519a490e2 100644 --- a/p4_symbolic/ir/ir.cc +++ b/p4_symbolic/ir/ir.cc @@ -30,7 +30,7 @@ #include "absl/strings/strip.h" #include "google/protobuf/repeated_ptr_field.h" #include "google/protobuf/struct.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/internal/ordered_map.h" diff --git a/p4_symbolic/ir/parser.cc b/p4_symbolic/ir/parser.cc index aaf4a9e2e..6029afb0c 100644 --- a/p4_symbolic/ir/parser.cc +++ b/p4_symbolic/ir/parser.cc @@ -16,7 +16,7 @@ #include "absl/status/statusor.h" #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_symbolic/ir/table_entries.cc b/p4_symbolic/ir/table_entries.cc index 0417ad2d3..9615d5b62 100644 --- a/p4_symbolic/ir/table_entries.cc +++ b/p4_symbolic/ir/table_entries.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_symbolic/ir/test.cc b/p4_symbolic/ir/test.cc index af7680431..bae8abe99 100644 --- a/p4_symbolic/ir/test.cc +++ b/p4_symbolic/ir/test.cc @@ -23,8 +23,8 @@ #include "absl/flags/usage.h" #include "absl/status/status.h" #include "absl/strings/str_format.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" +#include "gutil/io.h" +#include "gutil/proto.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/ir/parser.h" #include "p4_symbolic/test_util.h" diff --git a/p4_symbolic/main.cc b/p4_symbolic/main.cc index 6fa15cd35..a0f11b036 100644 --- a/p4_symbolic/main.cc +++ b/p4_symbolic/main.cc @@ -31,8 +31,8 @@ #include "absl/status/status.h" #include "absl/strings/str_format.h" #include "google/protobuf/message_lite.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_symbolic/symbolic/context.h" diff --git a/p4_symbolic/packet_synthesizer/BUILD.bazel b/p4_symbolic/packet_synthesizer/BUILD.bazel index 3ae871028..859e9d430 100644 --- a/p4_symbolic/packet_synthesizer/BUILD.bazel +++ b/p4_symbolic/packet_synthesizer/BUILD.bazel @@ -24,7 +24,6 @@ cc_library( srcs = ["util.cc"], hdrs = ["util.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi/netaddr:ipv6_address", "//p4_pdpi/string_encodings:decimal_string", "//p4_pdpi/utils:ir", @@ -37,6 +36,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -85,7 +85,7 @@ cc_library( hdrs = ["packet_synthesis_criteria.h"], deps = [ ":packet_synthesis_criteria_cc_proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", @@ -100,9 +100,9 @@ cc_test( deps = [ ":packet_synthesis_criteria", ":packet_synthesis_criteria_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", ], @@ -118,8 +118,6 @@ cc_library( ":packet_synthesizer_cc_proto", ":util", ":z3_model_to_packet", - "//gutil/gutil:status", - "//gutil/gutil:timer", "//p4_pdpi:ir_cc_proto", "//p4_symbolic/ir:ir_cc_proto", "//p4_symbolic/symbolic", @@ -134,6 +132,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:timer", ], ) @@ -145,7 +145,6 @@ cc_library( ":coverage_goal_cc_proto", ":packet_synthesis_criteria", ":packet_synthesis_criteria_cc_proto", - "//gutil/gutil:proto", "//p4_pdpi:ir_cc_proto", "//p4_symbolic/ir:ir_cc_proto", "//p4_symbolic/symbolic", @@ -154,6 +153,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", ], ) diff --git a/p4_symbolic/packet_synthesizer/criteria_generator.cc b/p4_symbolic/packet_synthesizer/criteria_generator.cc index cc35f0b16..e856e7ca1 100644 --- a/p4_symbolic/packet_synthesizer/criteria_generator.cc +++ b/p4_symbolic/packet_synthesizer/criteria_generator.cc @@ -21,8 +21,8 @@ #include "absl/strings/match.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/packet_synthesizer/coverage_goal.pb.h" diff --git a/p4_symbolic/packet_synthesizer/packet_synthesis_criteria.cc b/p4_symbolic/packet_synthesizer/packet_synthesis_criteria.cc index 1ff782aa7..037eeedb2 100644 --- a/p4_symbolic/packet_synthesizer/packet_synthesis_criteria.cc +++ b/p4_symbolic/packet_synthesizer/packet_synthesis_criteria.cc @@ -21,7 +21,7 @@ #include "absl/strings/substitute.h" #include "absl/types/span.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_symbolic/packet_synthesizer/packet_synthesis_criteria.pb.h" namespace p4_symbolic::packet_synthesizer { diff --git a/p4_symbolic/packet_synthesizer/packet_synthesis_criteria_test.cc b/p4_symbolic/packet_synthesizer/packet_synthesis_criteria_test.cc index 9d8abefbf..000809ef6 100644 --- a/p4_symbolic/packet_synthesizer/packet_synthesis_criteria_test.cc +++ b/p4_symbolic/packet_synthesizer/packet_synthesis_criteria_test.cc @@ -5,9 +5,9 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_symbolic/packet_synthesizer/packet_synthesis_criteria.pb.h" namespace p4_symbolic::packet_synthesizer { diff --git a/p4_symbolic/packet_synthesizer/packet_synthesizer.cc b/p4_symbolic/packet_synthesizer/packet_synthesizer.cc index 4de877112..644faa9ef 100644 --- a/p4_symbolic/packet_synthesizer/packet_synthesizer.cc +++ b/p4_symbolic/packet_synthesizer/packet_synthesizer.cc @@ -28,8 +28,8 @@ #include "absl/strings/substitute.h" #include "absl/time/time.h" #include "google/protobuf/duration.pb.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/timer.h" +#include "gutil/status.h" +#include "gutil/timer.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.pb.h" diff --git a/p4_symbolic/packet_synthesizer/util.cc b/p4_symbolic/packet_synthesizer/util.cc index cfc7f2705..3ba1ebc0c 100644 --- a/p4_symbolic/packet_synthesizer/util.cc +++ b/p4_symbolic/packet_synthesizer/util.cc @@ -17,7 +17,7 @@ #include "absl/status/status.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/ipv6_address.h" #include "p4_pdpi/string_encodings/decimal_string.h" #include "p4_pdpi/utils/ir.h" diff --git a/p4_symbolic/packet_synthesizer/z3_model_to_packet.cc b/p4_symbolic/packet_synthesizer/z3_model_to_packet.cc index f920e7081..2994a1e35 100644 --- a/p4_symbolic/packet_synthesizer/z3_model_to_packet.cc +++ b/p4_symbolic/packet_synthesizer/z3_model_to_packet.cc @@ -23,7 +23,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_symbolic/sai/sai.h" #include "p4_symbolic/symbolic/context.h" diff --git a/p4_symbolic/sai/BUILD.bazel b/p4_symbolic/sai/BUILD.bazel index 6ac0ca2b7..dfc89b590 100644 --- a/p4_symbolic/sai/BUILD.bazel +++ b/p4_symbolic/sai/BUILD.bazel @@ -22,8 +22,6 @@ cc_library( srcs = ["sai.cc"], hdrs = ["sai.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/internal:ordered_map", "//p4_symbolic/ir", @@ -38,6 +36,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -46,7 +46,7 @@ cc_library( testonly = True, hdrs = ["sai_coverage_goals.h"], deps = [ - "//gutil/gutil:testing", + "@com_google_gutil//gutil:testing", "//p4_symbolic/packet_synthesizer:coverage_goal_cc_proto", ], ) @@ -56,10 +56,6 @@ cc_test( srcs = ["sai_test.cc"], deps = [ ":sai", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:test_artifact_writer", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:pd", "//p4_symbolic/symbolic", @@ -72,6 +68,10 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:testing", ], ) @@ -81,10 +81,6 @@ cc_test( srcs = ["packet_synthesizer_test.cc"], deps = [ ":sai", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:test_artifact_writer", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -99,6 +95,10 @@ cc_test( "@com_google_absl//absl/log", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:testing", ], ) @@ -106,9 +106,6 @@ cc_test( name = "criteria_generator_test", srcs = ["criteria_generator_test.cc"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", "//p4_symbolic/packet_synthesizer", @@ -125,5 +122,8 @@ cc_test( "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/p4_symbolic/sai/criteria_generator_test.cc b/p4_symbolic/sai/criteria_generator_test.cc index ea5351dd3..c7b209654 100644 --- a/p4_symbolic/sai/criteria_generator_test.cc +++ b/p4_symbolic/sai/criteria_generator_test.cc @@ -22,9 +22,9 @@ #include "gmock/gmock.h" #include "google/protobuf/message.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/pd.h" diff --git a/p4_symbolic/sai/packet_synthesizer_test.cc b/p4_symbolic/sai/packet_synthesizer_test.cc index a4ef80923..0c074638e 100644 --- a/p4_symbolic/sai/packet_synthesizer_test.cc +++ b/p4_symbolic/sai/packet_synthesizer_test.cc @@ -21,10 +21,10 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/test_artifact_writer.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/testing.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "p4_pdpi/pd.h" diff --git a/p4_symbolic/sai/sai.cc b/p4_symbolic/sai/sai.cc index 37df3c81a..fd9e1c8c4 100644 --- a/p4_symbolic/sai/sai.cc +++ b/p4_symbolic/sai/sai.cc @@ -29,8 +29,8 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.h" diff --git a/p4_symbolic/sai/sai_coverage_goals.h b/p4_symbolic/sai/sai_coverage_goals.h index f226ea0e8..778282f7d 100644 --- a/p4_symbolic/sai/sai_coverage_goals.h +++ b/p4_symbolic/sai/sai_coverage_goals.h @@ -1,7 +1,7 @@ #ifndef PINS_P4_SYMBOLIC_SAI_SAI_COVERAGE_GOALS_H_ #define PINS_P4_SYMBOLIC_SAI_SAI_COVERAGE_GOALS_H_ -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "p4_symbolic/packet_synthesizer/coverage_goal.pb.h" namespace p4_symbolic::packet_synthesizer { diff --git a/p4_symbolic/sai/sai_test.cc b/p4_symbolic/sai/sai_test.cc index 20b381d79..e4b99e885 100644 --- a/p4_symbolic/sai/sai_test.cc +++ b/p4_symbolic/sai/sai_test.cc @@ -20,10 +20,10 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/test_artifact_writer.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/pd.h" diff --git a/p4_symbolic/symbolic/BUILD.bazel b/p4_symbolic/symbolic/BUILD.bazel index b4a508326..58d42b061 100644 --- a/p4_symbolic/symbolic/BUILD.bazel +++ b/p4_symbolic/symbolic/BUILD.bazel @@ -29,7 +29,7 @@ cc_library( srcs = ["operators.cc"], hdrs = ["operators.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_github_z3prover_z3//:api", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", @@ -43,7 +43,6 @@ cc_library( srcs = ["values.cc"], hdrs = ["values.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/string_encodings:bit_string", "//p4_pdpi/utils:ir", @@ -56,6 +55,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", + "@com_google_gutil//gutil:status", ], ) @@ -80,8 +80,6 @@ cc_library( deps = [ ":operators", ":values", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/internal:ordered_map", "//p4_pdpi/string_encodings:bit_string", @@ -104,6 +102,8 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/strings:string_view", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -133,8 +133,6 @@ cc_library( ":solver_state", ":v1model_intrinsics", ":values", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:built_ins", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/internal:ordered_map", @@ -161,6 +159,8 @@ cc_library( "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -206,8 +206,6 @@ cc_test( srcs = ["values_test.cc"], deps = [ ":values", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_symbolic:z3_util", "@com_github_z3prover_z3//:api", @@ -215,6 +213,8 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -223,8 +223,6 @@ cc_test( srcs = ["parser_test.cc"], deps = [ ":symbolic", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//p4_symbolic/ir", "//p4_symbolic/ir:ir_cc_proto", "@com_github_z3prover_z3//:api", @@ -232,6 +230,8 @@ cc_test( "@com_google_absl//absl/log", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -240,11 +240,11 @@ cc_test( srcs = ["util_test.cc"], deps = [ ":solver_state", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_symbolic/ir:ir_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -261,7 +261,6 @@ cc_test( deps = [ ":solver_state", ":symbolic", - "//gutil/gutil:status_matchers", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:packetlib_cc_proto", "//p4_symbolic:test_util", @@ -271,6 +270,7 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -285,9 +285,6 @@ cc_test( deps = [ ":solver_state", ":symbolic", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_symbolic:test_util", "//p4_symbolic/ir", @@ -301,5 +298,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4_symbolic/symbolic/action.cc b/p4_symbolic/symbolic/action.cc index 585ba168d..bacab4a33 100644 --- a/p4_symbolic/symbolic/action.cc +++ b/p4_symbolic/symbolic/action.cc @@ -25,8 +25,8 @@ #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.h" diff --git a/p4_symbolic/symbolic/conditional.cc b/p4_symbolic/symbolic/conditional.cc index 656780c7d..fe3d58c04 100644 --- a/p4_symbolic/symbolic/conditional.cc +++ b/p4_symbolic/symbolic/conditional.cc @@ -22,7 +22,7 @@ #include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_symbolic/ir/ir.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/packet_synthesizer/packet_synthesizer.pb.h" diff --git a/p4_symbolic/symbolic/control.cc b/p4_symbolic/symbolic/control.cc index b6e088e77..a4eaedd01 100644 --- a/p4_symbolic/symbolic/control.cc +++ b/p4_symbolic/symbolic/control.cc @@ -25,7 +25,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "p4_symbolic/ir/ir.h" #include "p4_symbolic/ir/ir.pb.h" diff --git a/p4_symbolic/symbolic/deparser.cc b/p4_symbolic/symbolic/deparser.cc index 31acd1da5..2456f6d12 100644 --- a/p4_symbolic/symbolic/deparser.cc +++ b/p4_symbolic/symbolic/deparser.cc @@ -19,7 +19,7 @@ #include "absl/status/statusor.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/bit_string.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/symbolic/context.h" diff --git a/p4_symbolic/symbolic/deparser_test.cc b/p4_symbolic/symbolic/deparser_test.cc index 66773b652..d2bdfd872 100644 --- a/p4_symbolic/symbolic/deparser_test.cc +++ b/p4_symbolic/symbolic/deparser_test.cc @@ -24,7 +24,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/p4_symbolic/symbolic/guarded_map.cc b/p4_symbolic/symbolic/guarded_map.cc index 27713167f..c49416b30 100644 --- a/p4_symbolic/symbolic/guarded_map.cc +++ b/p4_symbolic/symbolic/guarded_map.cc @@ -24,7 +24,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/symbolic/operators.h" #include "p4_symbolic/symbolic/util.h" diff --git a/p4_symbolic/symbolic/operators.cc b/p4_symbolic/symbolic/operators.cc index 33095f662..34ffd8476 100644 --- a/p4_symbolic/symbolic/operators.cc +++ b/p4_symbolic/symbolic/operators.cc @@ -26,7 +26,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "z3++.h" #include "z3_api.h" diff --git a/p4_symbolic/symbolic/operators.h b/p4_symbolic/symbolic/operators.h index 9c98838c5..349d4ac01 100644 --- a/p4_symbolic/symbolic/operators.h +++ b/p4_symbolic/symbolic/operators.h @@ -23,7 +23,7 @@ #include -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "z3++.h" namespace p4_symbolic { diff --git a/p4_symbolic/symbolic/parser.cc b/p4_symbolic/symbolic/parser.cc index 3bdbfc774..9f165f52a 100644 --- a/p4_symbolic/symbolic/parser.cc +++ b/p4_symbolic/symbolic/parser.cc @@ -24,7 +24,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/types/optional.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_symbolic/ir/ir.h" #include "p4_symbolic/ir/ir.pb.h" diff --git a/p4_symbolic/symbolic/parser_test.cc b/p4_symbolic/symbolic/parser_test.cc index 1eecad4ea..dc5aafb4a 100644 --- a/p4_symbolic/symbolic/parser_test.cc +++ b/p4_symbolic/symbolic/parser_test.cc @@ -24,8 +24,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "p4_symbolic/ir/ir.h" #include "p4_symbolic/ir/ir.pb.h" #include "p4_symbolic/symbolic/v1model.h" diff --git a/p4_symbolic/symbolic/symbolic.cc b/p4_symbolic/symbolic/symbolic.cc index 171338f91..702e34be8 100644 --- a/p4_symbolic/symbolic/symbolic.cc +++ b/p4_symbolic/symbolic/symbolic.cc @@ -30,7 +30,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/types/optional.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/built_ins.h" #include "p4_pdpi/internal/ordered_map.h" diff --git a/p4_symbolic/symbolic/symbolic_table_entry.cc b/p4_symbolic/symbolic/symbolic_table_entry.cc index f4c30c6b5..2d2ecd344 100644 --- a/p4_symbolic/symbolic/symbolic_table_entry.cc +++ b/p4_symbolic/symbolic/symbolic_table_entry.cc @@ -32,8 +32,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/internal/ordered_map.h" diff --git a/p4_symbolic/symbolic/symbolic_table_entry_test.cc b/p4_symbolic/symbolic/symbolic_table_entry_test.cc index 34128d386..6ee89b8ac 100644 --- a/p4_symbolic/symbolic/symbolic_table_entry_test.cc +++ b/p4_symbolic/symbolic/symbolic_table_entry_test.cc @@ -26,9 +26,9 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_symbolic/symbolic/table.cc b/p4_symbolic/symbolic/table.cc index 583cb21a3..627a752f1 100644 --- a/p4_symbolic/symbolic/table.cc +++ b/p4_symbolic/symbolic/table.cc @@ -38,7 +38,7 @@ #include "absl/types/optional.h" #include "absl/types/span.h" #include "google/protobuf/map.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.h" diff --git a/p4_symbolic/symbolic/util.cc b/p4_symbolic/symbolic/util.cc index e2fec0bce..5e384acb7 100644 --- a/p4_symbolic/symbolic/util.cc +++ b/p4_symbolic/symbolic/util.cc @@ -27,7 +27,7 @@ #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/ir/ir.pb.h" diff --git a/p4_symbolic/symbolic/util_test.cc b/p4_symbolic/symbolic/util_test.cc index b232893a7..910828c69 100644 --- a/p4_symbolic/symbolic/util_test.cc +++ b/p4_symbolic/symbolic/util_test.cc @@ -17,8 +17,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_symbolic/ir/ir.pb.h" namespace p4_symbolic::symbolic::util { diff --git a/p4_symbolic/symbolic/v1model.cc b/p4_symbolic/symbolic/v1model.cc index 5f5f49aaf..bf88196f9 100644 --- a/p4_symbolic/symbolic/v1model.cc +++ b/p4_symbolic/symbolic/v1model.cc @@ -26,8 +26,8 @@ #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4_pdpi/built_ins.h" #include "p4_pdpi/internal/ordered_map.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_symbolic/symbolic/values.cc b/p4_symbolic/symbolic/values.cc index e38f08a1e..6dd0c97c4 100644 --- a/p4_symbolic/symbolic/values.cc +++ b/p4_symbolic/symbolic/values.cc @@ -34,7 +34,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "gmpxx.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/string_encodings/bit_string.h" #include "p4_pdpi/utils/ir.h" diff --git a/p4_symbolic/symbolic/values_test.cc b/p4_symbolic/symbolic/values_test.cc index 04dd236de..f43577a1d 100644 --- a/p4_symbolic/symbolic/values_test.cc +++ b/p4_symbolic/symbolic/values_test.cc @@ -9,8 +9,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.pb.h" #include "p4_symbolic/z3_util.h" #include "z3++.h" diff --git a/p4_symbolic/test_util.cc b/p4_symbolic/test_util.cc index b7a630019..4e5bcf448 100644 --- a/p4_symbolic/test_util.cc +++ b/p4_symbolic/test_util.cc @@ -6,8 +6,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" +#include "gutil/io.h" +#include "gutil/proto.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4_symbolic/tests/BUILD.bazel b/p4_symbolic/tests/BUILD.bazel index 6f34bce96..7355feda0 100644 --- a/p4_symbolic/tests/BUILD.bazel +++ b/p4_symbolic/tests/BUILD.bazel @@ -8,8 +8,6 @@ cc_test( timeout = "long", srcs = ["sai_p4_integration_test.cc"], deps = [ - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -34,6 +32,8 @@ cc_test( "@com_google_absl//absl/time", "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -46,10 +46,6 @@ cc_test( "//p4_symbolic/testdata:ipv4-routing/entries.pb.txt", ], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:test_artifact_writer", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -80,5 +76,9 @@ cc_test( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:testing", ], ) diff --git a/p4_symbolic/tests/sai_p4_integration_test.cc b/p4_symbolic/tests/sai_p4_integration_test.cc index 4b40da807..7f5c7853b 100644 --- a/p4_symbolic/tests/sai_p4_integration_test.cc +++ b/p4_symbolic/tests/sai_p4_integration_test.cc @@ -26,9 +26,9 @@ #include "absl/types/optional.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4_symbolic/tests/symbolic_table_entries_test.cc b/p4_symbolic/tests/symbolic_table_entries_test.cc index 4d8b21427..1c80f1854 100644 --- a/p4_symbolic/tests/symbolic_table_entries_test.cc +++ b/p4_symbolic/tests/symbolic_table_entries_test.cc @@ -26,10 +26,10 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/test_artifact_writer.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4_symbolic/z3_util.cc b/p4_symbolic/z3_util.cc index e24221183..aab9ed1ef 100644 --- a/p4_symbolic/z3_util.cc +++ b/p4_symbolic/z3_util.cc @@ -28,7 +28,7 @@ #include "absl/strings/strip.h" #include "absl/types/optional.h" #include "gmpxx.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/string_encodings/bit_string.h" #include "p4_pdpi/string_encodings/hex_string.h" #include "z3++.h" diff --git a/p4_symbolic/z3_util_test.cc b/p4_symbolic/z3_util_test.cc index c56097518..0e804a6a0 100644 --- a/p4_symbolic/z3_util_test.cc +++ b/p4_symbolic/z3_util_test.cc @@ -8,7 +8,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/string_encodings/bit_string.h" #include "z3++.h" diff --git a/p4rt_app/BUILD.bazel b/p4rt_app/BUILD.bazel index 2a314ea57..06b72ab68 100644 --- a/p4rt_app/BUILD.bazel +++ b/p4rt_app/BUILD.bazel @@ -41,8 +41,8 @@ cc_binary( "@com_github_grpc_grpc//:grpc++", "@com_github_grpc_grpc//:grpc++_authorization_provider", "@com_github_grpc_grpc//:grpc_security_base", - "//gutil/gutil:status", - "//gutil/gutil:syslog_sink", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:syslog_sink", "//p4rt_app/event_monitoring:app_state_db_port_table_event", "//p4rt_app/event_monitoring:app_state_db_send_to_ingress_port_table_event", "//p4rt_app/event_monitoring:config_db_node_cfg_table_event", diff --git a/p4rt_app/event_monitoring/BUILD.bazel b/p4rt_app/event_monitoring/BUILD.bazel index 3b0e65356..62264e8de 100644 --- a/p4rt_app/event_monitoring/BUILD.bazel +++ b/p4rt_app/event_monitoring/BUILD.bazel @@ -34,10 +34,10 @@ cc_test( srcs = ["app_state_db_port_table_event_test.cc"], deps = [ ":app_state_db_port_table_event", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -60,12 +60,12 @@ cc_test( srcs = ["app_state_db_send_to_ingress_port_table_event_test.cc"], deps = [ ":app_state_db_send_to_ingress_port_table_event", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "//p4rt_app/p4runtime:packetio_helpers", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -74,7 +74,7 @@ cc_library( srcs = ["state_event_monitor.cc"], hdrs = ["state_event_monitor.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log", "@com_google_absl//absl/status", @@ -90,7 +90,6 @@ cc_library( srcs = ["state_verification_events.cc"], hdrs = ["state_verification_events.h"], deps = [ - "//gutil/gutil:status", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/sonic/adapters:consumer_notifier_adapter", "//p4rt_app/sonic/adapters:table_adapter", @@ -101,6 +100,7 @@ cc_library( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -109,8 +109,6 @@ cc_library( srcs = ["debug_data_dump_events.cc"], hdrs = ["debug_data_dump_events.h"], deps = [ - "//gutil/gutil:io", - "//gutil/gutil:status", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/sonic/adapters:consumer_notifier_adapter", "//p4rt_app/sonic/adapters:notification_producer_adapter", @@ -121,6 +119,8 @@ cc_library( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:status", ], ) @@ -130,11 +130,11 @@ cc_library( hdrs = ["config_db_queue_table_event.h"], deps = [ ":state_event_monitor", - "//gutil/gutil:status", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/p4runtime:queue_translator", "@com_google_absl//absl/status", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -143,7 +143,6 @@ cc_library( srcs = ["warm_boot_events.cc"], hdrs = ["warm_boot_events.h"], deps = [ - "//gutil/gutil:status", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/sonic/adapters:consumer_notifier_adapter", "@com_google_absl//absl/base:core_headers", @@ -152,6 +151,7 @@ cc_library( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -160,13 +160,13 @@ cc_test( srcs = ["config_db_queue_table_event_test.cc"], deps = [ ":config_db_queue_table_event", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/p4runtime:queue_translator", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -190,7 +190,6 @@ cc_library( hdrs = ["config_db_port_table_event.h"], deps = [ ":state_event_monitor", - "//gutil/gutil:status", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/sonic:redis_connections", "//p4rt_app/sonic/adapters:table_adapter", @@ -198,6 +197,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:status", ], ) @@ -206,10 +206,10 @@ cc_test( srcs = ["config_db_port_table_event_test.cc"], deps = [ ":config_db_port_table_event", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -218,11 +218,11 @@ cc_test( srcs = ["config_db_node_cfg_table_event_test.cc"], deps = [ ":config_db_node_cfg_table_event", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -231,7 +231,6 @@ cc_test( srcs = ["state_verification_events_test.cc"], deps = [ ":state_verification_events", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_table_adapter", @@ -239,6 +238,7 @@ cc_test( "@com_google_absl//absl/synchronization", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -247,8 +247,6 @@ cc_test( srcs = ["debug_data_dump_events_test.cc"], deps = [ ":debug_data_dump_events", - "//gutil/gutil:io", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_notification_producer_adapter", @@ -257,6 +255,8 @@ cc_test( "@com_google_absl//absl/synchronization", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -265,12 +265,12 @@ cc_test( srcs = ["warm_boot_events_test.cc"], deps = [ ":warm_boot_events", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:mock_p4runtime_impl", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "@com_google_absl//absl/status", "@com_google_absl//absl/synchronization", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4rt_app/event_monitoring/app_state_db_port_table_event_test.cc b/p4rt_app/event_monitoring/app_state_db_port_table_event_test.cc index fb3360063..761029db0 100644 --- a/p4rt_app/event_monitoring/app_state_db_port_table_event_test.cc +++ b/p4rt_app/event_monitoring/app_state_db_port_table_event_test.cc @@ -19,7 +19,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" namespace p4rt_app { diff --git a/p4rt_app/event_monitoring/app_state_db_send_to_ingress_port_table_event_test.cc b/p4rt_app/event_monitoring/app_state_db_send_to_ingress_port_table_event_test.cc index 062f355f8..750af961e 100644 --- a/p4rt_app/event_monitoring/app_state_db_send_to_ingress_port_table_event_test.cc +++ b/p4rt_app/event_monitoring/app_state_db_send_to_ingress_port_table_event_test.cc @@ -3,7 +3,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "p4rt_app/p4runtime/packetio_helpers.h" #include "swss/schema.h" diff --git a/p4rt_app/event_monitoring/config_db_node_cfg_table_event_test.cc b/p4rt_app/event_monitoring/config_db_node_cfg_table_event_test.cc index 5def87f99..a11a1895e 100644 --- a/p4rt_app/event_monitoring/config_db_node_cfg_table_event_test.cc +++ b/p4rt_app/event_monitoring/config_db_node_cfg_table_event_test.cc @@ -16,7 +16,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "swss/schema.h" diff --git a/p4rt_app/event_monitoring/config_db_port_table_event.cc b/p4rt_app/event_monitoring/config_db_port_table_event.cc index c2fc97369..235206861 100644 --- a/p4rt_app/event_monitoring/config_db_port_table_event.cc +++ b/p4rt_app/event_monitoring/config_db_port_table_event.cc @@ -20,7 +20,7 @@ #include "absl/log/log.h" #include "absl/status/status.h" #include "absl/strings/match.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "swss/schema.h" diff --git a/p4rt_app/event_monitoring/config_db_port_table_event_test.cc b/p4rt_app/event_monitoring/config_db_port_table_event_test.cc index f3d114586..ff7eb30e3 100644 --- a/p4rt_app/event_monitoring/config_db_port_table_event_test.cc +++ b/p4rt_app/event_monitoring/config_db_port_table_event_test.cc @@ -20,7 +20,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" namespace p4rt_app { diff --git a/p4rt_app/event_monitoring/config_db_queue_table_event.cc b/p4rt_app/event_monitoring/config_db_queue_table_event.cc index d53750b20..85fc2ed31 100644 --- a/p4rt_app/event_monitoring/config_db_queue_table_event.cc +++ b/p4rt_app/event_monitoring/config_db_queue_table_event.cc @@ -20,7 +20,7 @@ #include "absl/status/status.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4rt_app/p4runtime/queue_translator.h" #include "swss/schema.h" diff --git a/p4rt_app/event_monitoring/config_db_queue_table_event_test.cc b/p4rt_app/event_monitoring/config_db_queue_table_event_test.cc index 332f7a67e..28f8834d4 100644 --- a/p4rt_app/event_monitoring/config_db_queue_table_event_test.cc +++ b/p4rt_app/event_monitoring/config_db_queue_table_event_test.cc @@ -20,7 +20,7 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "p4rt_app/p4runtime/queue_translator.h" diff --git a/p4rt_app/event_monitoring/debug_data_dump_events.cc b/p4rt_app/event_monitoring/debug_data_dump_events.cc index c93b87c2b..71d7fce22 100644 --- a/p4rt_app/event_monitoring/debug_data_dump_events.cc +++ b/p4rt_app/event_monitoring/debug_data_dump_events.cc @@ -23,8 +23,8 @@ #include "absl/synchronization/mutex.h" #include "absl/time/clock.h" #include "absl/time/time.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/status.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "p4rt_app/sonic/adapters/consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/notification_producer_adapter.h" diff --git a/p4rt_app/event_monitoring/debug_data_dump_events_test.cc b/p4rt_app/event_monitoring/debug_data_dump_events_test.cc index d6adb55db..62eeb3af4 100644 --- a/p4rt_app/event_monitoring/debug_data_dump_events_test.cc +++ b/p4rt_app/event_monitoring/debug_data_dump_events_test.cc @@ -23,8 +23,8 @@ #include "absl/synchronization/notification.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/io.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/mock_notification_producer_adapter.h" diff --git a/p4rt_app/event_monitoring/state_event_monitor.cc b/p4rt_app/event_monitoring/state_event_monitor.cc index 311ec6881..ab04c762d 100644 --- a/p4rt_app/event_monitoring/state_event_monitor.cc +++ b/p4rt_app/event_monitoring/state_event_monitor.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "swss/rediscommand.h" #include "swss/select.h" #include "swss/selectable.h" diff --git a/p4rt_app/event_monitoring/state_verification_events.cc b/p4rt_app/event_monitoring/state_verification_events.cc index 3435fa589..062af97a2 100644 --- a/p4rt_app/event_monitoring/state_verification_events.cc +++ b/p4rt_app/event_monitoring/state_verification_events.cc @@ -21,7 +21,7 @@ #include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "p4rt_app/sonic/adapters/consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/table_adapter.h" diff --git a/p4rt_app/event_monitoring/state_verification_events_test.cc b/p4rt_app/event_monitoring/state_verification_events_test.cc index 6036b3f47..ff8442715 100644 --- a/p4rt_app/event_monitoring/state_verification_events_test.cc +++ b/p4rt_app/event_monitoring/state_verification_events_test.cc @@ -19,7 +19,7 @@ #include "absl/synchronization/notification.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/mock_table_adapter.h" diff --git a/p4rt_app/event_monitoring/warm_boot_events.cc b/p4rt_app/event_monitoring/warm_boot_events.cc index 9c2234c2d..a1b1e0b99 100644 --- a/p4rt_app/event_monitoring/warm_boot_events.cc +++ b/p4rt_app/event_monitoring/warm_boot_events.cc @@ -21,7 +21,7 @@ #include "absl/status/status.h" #include "absl/log/log.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "p4rt_app/sonic/adapters/consumer_notifier_adapter.h" #include "swss/rediscommand.h" diff --git a/p4rt_app/event_monitoring/warm_boot_events_test.cc b/p4rt_app/event_monitoring/warm_boot_events_test.cc index 6551d2972..f327cb7e9 100644 --- a/p4rt_app/event_monitoring/warm_boot_events_test.cc +++ b/p4rt_app/event_monitoring/warm_boot_events_test.cc @@ -22,7 +22,7 @@ #include "absl/synchronization/notification.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/p4runtime/mock_p4runtime_impl.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" #include "swss/rediscommand.h" diff --git a/p4rt_app/p4rt.cc b/p4rt_app/p4rt.cc index 97b561d4e..080289278 100644 --- a/p4rt_app/p4rt.cc +++ b/p4rt_app/p4rt.cc @@ -43,8 +43,8 @@ #include "grpcpp/security/tls_credentials_options.h" #include "grpcpp/server.h" #include "grpcpp/server_builder.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/syslog_sink.h" +#include "gutil/status.h" +#include "gutil/syslog_sink.h" #include "p4rt_app/event_monitoring/app_state_db_port_table_event.h" #include "p4rt_app/event_monitoring/app_state_db_send_to_ingress_port_table_event.h" #include "p4rt_app/event_monitoring/config_db_node_cfg_table_event.h" diff --git a/p4rt_app/p4runtime/BUILD.bazel b/p4rt_app/p4runtime/BUILD.bazel index bc587a053..ee392995d 100644 --- a/p4rt_app/p4runtime/BUILD.bazel +++ b/p4rt_app/p4runtime/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@com_google_googleapis_imports//:imports.bzl", "cc_proto_library") -load("//gutil/gutil/embed_data:build_defs.bzl", "cc_embed_data") +load("@com_google_gutil//gutil/embed_data:build_defs.bzl", "cc_embed_data") package( default_visibility = ["//visibility:public"], @@ -47,9 +47,6 @@ cc_library( deps = [ "p4info_verification_schema_cc_proto", "p4info_verification_schema_embed", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:table_utility", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -57,6 +54,9 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -66,10 +66,6 @@ cc_test( deps = [ ":p4info_verification_schema", ":p4info_verification_schema_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:ir_builder", @@ -78,6 +74,10 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -88,8 +88,6 @@ cc_library( deps = [ ":p4info_verification_schema", ":p4info_verification_schema_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic:app_db_acl_def_table_manager", @@ -101,6 +99,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:cord", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -109,10 +109,6 @@ cc_test( srcs = ["p4info_verification_test.cc"], deps = [ ":p4info_verification", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi/utils:ir", "//p4rt_app/utils:status_utility", "//sai_p4/instantiations/google:instantiations", @@ -124,6 +120,10 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -140,10 +140,6 @@ cc_library( ":queue_translator", ":resource_utilization", ":sdn_controller_manager", - "//gutil/gutil:collections", - "//gutil/gutil:io", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:entity_keys", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -186,6 +182,10 @@ cc_library( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -210,7 +210,6 @@ cc_library( deps = [ ":ir_translation", ":queue_translator", - "//gutil/gutil:status", "//p4_pdpi:entity_keys", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic:app_db_manager", @@ -224,6 +223,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:status", ], ) @@ -233,7 +233,6 @@ cc_library( hdrs = ["packetio_helpers.h"], deps = [ ":ir_translation", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:ir", @@ -246,6 +245,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:status", ], ) @@ -255,8 +255,6 @@ cc_test( deps = [ ":p4info_verification", ":packetio_helpers", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi/utils:ir", "//p4rt_app/sonic:packetio_impl", "//p4rt_app/sonic:packetio_port", @@ -270,6 +268,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -279,8 +279,6 @@ cc_library( hdrs = ["ir_translation.h"], deps = [ ":queue_translator", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:translation_options", @@ -296,6 +294,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -305,8 +305,6 @@ cc_test( deps = [ ":ir_translation", ":queue_translator", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:ir_builder", "//sai_p4/instantiations/google:instantiations", @@ -316,6 +314,8 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -324,8 +324,6 @@ cc_library( srcs = ["sdn_controller_manager.cc"], hdrs = ["sdn_controller_manager.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", "//sai_p4/fixed:p4_roles", "@com_github_p4lang_p4runtime//:p4runtime_cc_grpc", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -338,6 +336,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:optional", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -346,8 +346,6 @@ cc_library( srcs = ["resource_utilization.cc"], hdrs = ["resource_utilization.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:entity_keys", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic:app_db_manager", @@ -358,6 +356,8 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -366,9 +366,6 @@ cc_test( srcs = ["resource_utilization_test.cc"], deps = [ ":resource_utilization", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:entity_keys", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -382,6 +379,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -390,14 +390,14 @@ cc_library( srcs = ["queue_translator.cc"], hdrs = ["queue_translator.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/memory", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -406,7 +406,7 @@ cc_test( srcs = ["queue_translator_test.cc"], deps = [ ":queue_translator", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], @@ -418,8 +418,6 @@ cc_library( hdrs = ["p4info_reconcile.h"], deps = [ ":resource_utilization", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic:app_db_acl_def_table_manager", "//p4rt_app/sonic:hashing", @@ -431,6 +429,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -440,8 +440,6 @@ cc_test( deps = [ ":p4info_reconcile", ":resource_utilization", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:ir_builder", "//p4rt_app/utils:table_utility", @@ -451,5 +449,7 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4rt_app/p4runtime/ir_translation.cc b/p4rt_app/p4runtime/ir_translation.cc index f83c83353..565cd7b27 100644 --- a/p4rt_app/p4runtime/ir_translation.cc +++ b/p4rt_app/p4runtime/ir_translation.cc @@ -19,8 +19,8 @@ #include "absl/strings/escaping.h" #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4types.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/p4runtime/ir_translation_test.cc b/p4rt_app/p4runtime/ir_translation_test.cc index 9318070f3..bac5d7217 100644 --- a/p4rt_app/p4runtime/ir_translation_test.cc +++ b/p4rt_app/p4runtime/ir_translation_test.cc @@ -18,8 +18,8 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/p4runtime/queue_translator.h" #include "p4rt_app/utils/ir_builder.h" diff --git a/p4rt_app/p4runtime/p4info_reconcile.cc b/p4rt_app/p4runtime/p4info_reconcile.cc index 3cdef0f31..019b07fbf 100644 --- a/p4rt_app/p4runtime/p4info_reconcile.cc +++ b/p4rt_app/p4runtime/p4info_reconcile.cc @@ -22,8 +22,8 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/p4runtime/resource_utilization.h" #include "p4rt_app/sonic/app_db_acl_def_table_manager.h" diff --git a/p4rt_app/p4runtime/p4info_reconcile_test.cc b/p4rt_app/p4runtime/p4info_reconcile_test.cc index 490e34a4f..d294f716b 100644 --- a/p4rt_app/p4runtime/p4info_reconcile_test.cc +++ b/p4rt_app/p4runtime/p4info_reconcile_test.cc @@ -24,8 +24,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/p4runtime/resource_utilization.h" diff --git a/p4rt_app/p4runtime/p4info_verification.cc b/p4rt_app/p4runtime/p4info_verification.cc index f19782c32..e858c7cc0 100644 --- a/p4rt_app/p4runtime/p4info_verification.cc +++ b/p4rt_app/p4runtime/p4info_verification.cc @@ -18,8 +18,8 @@ #include "absl/strings/str_join.h" #include "google/protobuf/text_format.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/p4runtime/p4info_verification_schema.cc b/p4rt_app/p4runtime/p4info_verification_schema.cc index 157ccf473..54ea45583 100644 --- a/p4rt_app/p4runtime/p4info_verification_schema.cc +++ b/p4rt_app/p4runtime/p4info_verification_schema.cc @@ -17,9 +17,9 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/p4runtime/p4info_verification_schema.pb.h" diff --git a/p4rt_app/p4runtime/p4info_verification_schema_test.cc b/p4rt_app/p4runtime/p4info_verification_schema_test.cc index 7060a4b1e..8a82e2bec 100644 --- a/p4rt_app/p4runtime/p4info_verification_schema_test.cc +++ b/p4rt_app/p4runtime/p4info_verification_schema_test.cc @@ -20,10 +20,10 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/p4runtime/p4info_verification_schema.pb.h" diff --git a/p4rt_app/p4runtime/p4info_verification_test.cc b/p4rt_app/p4runtime/p4info_verification_test.cc index e9e7786df..85ab5f15a 100644 --- a/p4rt_app/p4runtime/p4info_verification_test.cc +++ b/p4rt_app/p4runtime/p4info_verification_test.cc @@ -23,10 +23,10 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/utils/ir.h" #include "p4rt_app/utils/status_utility.h" diff --git a/p4rt_app/p4runtime/p4runtime_impl.cc b/p4rt_app/p4runtime/p4runtime_impl.cc index c534c99f7..942863be2 100644 --- a/p4rt_app/p4runtime/p4runtime_impl.cc +++ b/p4rt_app/p4runtime/p4runtime_impl.cc @@ -50,10 +50,10 @@ #include "grpcpp/server_context.h" #include "grpcpp/support/status.h" #include "grpcpp/support/sync_stream.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/io.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4rt_app/p4runtime/p4runtime_read.cc b/p4rt_app/p4runtime/p4runtime_read.cc index 2d459c7ea..b31bf78ae 100644 --- a/p4rt_app/p4runtime/p4runtime_read.cc +++ b/p4rt_app/p4runtime/p4runtime_read.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "boost/bimap.hpp" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/p4runtime/packetio_helpers.cc b/p4rt_app/p4runtime/packetio_helpers.cc index d6dcf23b4..b7648ad8a 100644 --- a/p4rt_app/p4runtime/packetio_helpers.cc +++ b/p4rt_app/p4runtime/packetio_helpers.cc @@ -18,7 +18,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "boost/bimap.hpp" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/p4runtime/packetio_helpers_test.cc b/p4rt_app/p4runtime/packetio_helpers_test.cc index 2323e8062..342ddb6b0 100644 --- a/p4rt_app/p4runtime/packetio_helpers_test.cc +++ b/p4rt_app/p4runtime/packetio_helpers_test.cc @@ -21,8 +21,8 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/utils/ir.h" #include "p4rt_app/p4runtime/p4info_verification.h" #include "p4rt_app/sonic/adapters/mock_system_call_adapter.h" diff --git a/p4rt_app/p4runtime/queue_translator.cc b/p4rt_app/p4runtime/queue_translator.cc index d9da36aa2..26f00f9b8 100644 --- a/p4rt_app/p4runtime/queue_translator.cc +++ b/p4rt_app/p4runtime/queue_translator.cc @@ -23,8 +23,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" namespace p4rt_app { diff --git a/p4rt_app/p4runtime/queue_translator_test.cc b/p4rt_app/p4runtime/queue_translator_test.cc index 2fe0346a2..82cdcaeab 100644 --- a/p4rt_app/p4runtime/queue_translator_test.cc +++ b/p4rt_app/p4runtime/queue_translator_test.cc @@ -5,7 +5,7 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace p4rt_app { namespace { diff --git a/p4rt_app/p4runtime/resource_utilization.cc b/p4rt_app/p4runtime/resource_utilization.cc index e30a83ce8..0ab245c92 100644 --- a/p4rt_app/p4runtime/resource_utilization.cc +++ b/p4rt_app/p4runtime/resource_utilization.cc @@ -21,8 +21,8 @@ #include "absl/container/flat_hash_map.h" #include "absl/log/log.h" #include "absl/status/statusor.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" diff --git a/p4rt_app/p4runtime/resource_utilization_test.cc b/p4rt_app/p4runtime/resource_utilization_test.cc index 806153503..b5b1fe328 100644 --- a/p4rt_app/p4runtime/resource_utilization_test.cc +++ b/p4rt_app/p4runtime/resource_utilization_test.cc @@ -26,9 +26,9 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/p4runtime/sdn_controller_manager.cc b/p4rt_app/p4runtime/sdn_controller_manager.cc index df58d24f1..3cd467f08 100644 --- a/p4rt_app/p4runtime/sdn_controller_manager.cc +++ b/p4rt_app/p4runtime/sdn_controller_manager.cc @@ -22,8 +22,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include "absl/types/optional.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" namespace p4rt_app { diff --git a/p4rt_app/scripts/BUILD.bazel b/p4rt_app/scripts/BUILD.bazel index be392e50d..1c51f563e 100644 --- a/p4rt_app/scripts/BUILD.bazel +++ b/p4rt_app/scripts/BUILD.bazel @@ -35,10 +35,6 @@ cc_binary( testonly = True, srcs = ["p4rt_route_measurement_test.cc"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:io", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -68,6 +64,10 @@ cc_binary( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -75,8 +75,6 @@ cc_binary( name = "p4rt_program_table", srcs = ["p4rt_program_table.cc"], deps = [ - "//gutil/gutil:io", - "//gutil/gutil:proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", "//sai_p4/instantiations/google:instantiations", @@ -90,6 +88,8 @@ cc_binary( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", ], ) @@ -97,9 +97,6 @@ cc_binary( name = "build_schema_from_p4info", srcs = ["build_schema_from_p4info.cc"], deps = [ - "//gutil/gutil:io", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4rt_app/p4runtime:p4info_verification_schema", "//p4rt_app/p4runtime:p4info_verification_schema_cc_proto", @@ -112,6 +109,9 @@ cc_binary( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -120,7 +120,6 @@ cc_binary( srcs = ["p4rt_read.cc"], deps = [ ":p4rt_tool_helpers", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -135,6 +134,7 @@ cc_binary( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:status", ], ) @@ -143,9 +143,6 @@ cc_binary( srcs = ["p4rt_set_forwarding_pipeline.cc"], deps = [ ":p4rt_tool_helpers", - "//gutil/gutil:io", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:p4_runtime_session", "//sai_p4/instantiations/google:instantiations", "//sai_p4/instantiations/google:sai_p4info_cc", @@ -160,6 +157,9 @@ cc_binary( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -168,8 +168,6 @@ cc_binary( srcs = ["p4rt_write.cc"], deps = [ ":p4rt_tool_helpers", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -182,6 +180,8 @@ cc_binary( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -189,9 +189,6 @@ cc_binary( name = "p4rt_hybridband_test_client", srcs = ["p4rt_hybridband_test_client.cc"], deps = [ - "//gutil/gutil:io", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -209,5 +206,8 @@ cc_binary( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:io", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) diff --git a/p4rt_app/scripts/build_schema_from_p4info.cc b/p4rt_app/scripts/build_schema_from_p4info.cc index ccfee9f69..7751136f7 100644 --- a/p4rt_app/scripts/build_schema_from_p4info.cc +++ b/p4rt_app/scripts/build_schema_from_p4info.cc @@ -27,9 +27,9 @@ #include "absl/strings/str_format.h" #include "absl/strings/substitute.h" #include "google/protobuf/text_format.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" #include "p4rt_app/p4runtime/p4info_verification_schema.h" diff --git a/p4rt_app/scripts/p4rt_hybridband_test_client.cc b/p4rt_app/scripts/p4rt_hybridband_test_client.cc index 0da53c093..29b291e7a 100644 --- a/p4rt_app/scripts/p4rt_hybridband_test_client.cc +++ b/p4rt_app/scripts/p4rt_hybridband_test_client.cc @@ -29,9 +29,9 @@ #include "grpcpp/client_context.h" #include "grpcpp/grpcpp.h" #include "grpcpp/security/credentials.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/scripts/p4rt_program_table.cc b/p4rt_app/scripts/p4rt_program_table.cc index 6774df6d8..49af45b88 100644 --- a/p4rt_app/scripts/p4rt_program_table.cc +++ b/p4rt_app/scripts/p4rt_program_table.cc @@ -26,8 +26,8 @@ #include "absl/strings/str_split.h" #include "google/protobuf/text_format.h" #include "grpcpp/grpcpp.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" +#include "gutil/io.h" +#include "gutil/proto.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4_pdpi/pd.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/p4rt_app/scripts/p4rt_read.cc b/p4rt_app/scripts/p4rt_read.cc index 6bb9af266..fcf61bb21 100644 --- a/p4rt_app/scripts/p4rt_read.cc +++ b/p4rt_app/scripts/p4rt_read.cc @@ -27,7 +27,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" #include "grpcpp/security/credentials.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/scripts/p4rt_route_measurement_test.cc b/p4rt_app/scripts/p4rt_route_measurement_test.cc index bb8d0f497..b6b9148c2 100644 --- a/p4rt_app/scripts/p4rt_route_measurement_test.cc +++ b/p4rt_app/scripts/p4rt_route_measurement_test.cc @@ -45,11 +45,11 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/collections.h" +#include "gutil/io.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/scripts/p4rt_set_forwarding_pipeline.cc b/p4rt_app/scripts/p4rt_set_forwarding_pipeline.cc index 4cd8a52c0..bef52994f 100644 --- a/p4rt_app/scripts/p4rt_set_forwarding_pipeline.cc +++ b/p4rt_app/scripts/p4rt_set_forwarding_pipeline.cc @@ -24,9 +24,9 @@ #include "absl/strings/ascii.h" #include "absl/strings/str_format.h" #include "grpcpp/security/credentials.h" -#include "gutil/gutil/io.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/io.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/p4rt_app/scripts/p4rt_write.cc b/p4rt_app/scripts/p4rt_write.cc index 89251c17f..625339456 100644 --- a/p4rt_app/scripts/p4rt_write.cc +++ b/p4rt_app/scripts/p4rt_write.cc @@ -23,8 +23,8 @@ #include "absl/strings/str_format.h" #include "grpcpp/client_context.h" #include "grpcpp/security/credentials.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/sonic/BUILD.bazel b/p4rt_app/sonic/BUILD.bazel index 2e3217efb..6d6c30633 100644 --- a/p4rt_app/sonic/BUILD.bazel +++ b/p4rt_app/sonic/BUILD.bazel @@ -23,7 +23,6 @@ cc_library( deps = [ ":redis_connections", ":response_handler", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:annotation_parser", "//p4rt_app/utils:table_utility", @@ -34,6 +33,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:optional", + "@com_google_gutil//gutil:status", ], ) @@ -44,7 +44,6 @@ cc_test( ":app_db_acl_def_table_manager", ":redis_connections", "//p4rt_app/sonic/adapters:fake_notification_producer_adapter", - "//gutil/gutil:status_matchers", "//p4rt_app/sonic/adapters:fake_sonic_db_table", "//p4rt_app/utils:ir_builder", "@com_github_nlohmann_json//:nlohmann_json", @@ -52,6 +51,7 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -68,8 +68,6 @@ cc_library( ":vlan_entry_translation", ":vrf_entry_translation", "//p4_pdpi:entity_keys", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:status_utility", "//p4rt_app/utils:table_utility", @@ -84,6 +82,8 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_googleapis//google/rpc:code_cc_proto", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -94,8 +94,6 @@ cc_test( ":app_db_manager", ":redis_connections", ":vlan_entry_translation", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_notification_producer_adapter", @@ -111,6 +109,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -119,8 +119,6 @@ cc_library( srcs = ["app_db_to_pdpi_ir_translator.cc"], hdrs = ["app_db_to_pdpi_ir_translator.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:ir", "//p4rt_app/utils:table_utility", @@ -130,6 +128,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -138,8 +138,6 @@ cc_test( srcs = ["app_db_to_pdpi_ir_translator_test.cc"], deps = [ ":app_db_to_pdpi_ir_translator", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//sai_p4/instantiations/google:sai_p4info_cc", "@com_google_absl//absl/log", @@ -147,6 +145,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -166,7 +166,7 @@ cc_library( ], # copts = ["-I /usr/include/libnl3/"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", @@ -200,8 +200,6 @@ cc_library( deps = [ ":packetio_selectables", ":receive_genetlink", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4_pdpi/utils:ir", "//p4rt_app/sonic/adapters:system_call_adapter", "@com_google_absl//absl/container:flat_hash_map", @@ -211,6 +209,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -222,8 +222,6 @@ cc_library( ":packetio_interface", ":packetio_port", ":receive_genetlink", - "//gutil/gutil:collections", - "//gutil/gutil:status", "//p4rt_app/sonic/adapters:system_call_adapter", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log", @@ -232,6 +230,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", ], ) @@ -240,12 +240,12 @@ cc_test( srcs = ["packetio_impl_test.cc"], deps = [ ":packetio_impl", - "//gutil/gutil:status_matchers", "//p4rt_app/sonic/adapters:mock_system_call_adapter", "@com_google_absl//absl/cleanup", "@com_google_absl//absl/memory", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -255,7 +255,7 @@ cc_library( hdrs = ["fake_packetio_interface.h"], deps = [ ":packetio_interface", - "//gutil/gutil:collections", + "@com_google_gutil//gutil:collections", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", @@ -272,10 +272,10 @@ cc_test( srcs = ["packetio_port_test.cc"], deps = [ ":packetio_port", - "//gutil/gutil:status_matchers", "//p4rt_app/sonic/adapters:mock_system_call_adapter", "@com_google_absl//absl/log", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -295,7 +295,6 @@ cc_library( srcs = ["response_handler.cc"], hdrs = ["response_handler.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:ir", "//p4rt_app/sonic/adapters:consumer_notifier_adapter", @@ -307,6 +306,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_googleapis//google/rpc:code_cc_proto", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -315,8 +315,6 @@ cc_test( srcs = ["response_handler_test.cc"], deps = [ ":response_handler", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", @@ -324,6 +322,8 @@ cc_test( "@com_google_absl//absl/log", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -336,7 +336,6 @@ cc_library( ":app_db_to_pdpi_ir_translator", ":packet_replication_entry_translation", ":redis_connections", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:table_adapter", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -347,6 +346,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -356,13 +356,13 @@ cc_test( deps = [ ":redis_connections", ":state_verification", - "//gutil/gutil:status_matchers", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_notification_producer_adapter", "//p4rt_app/sonic/adapters:mock_table_adapter", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -373,7 +373,6 @@ cc_library( deps = [ ":redis_connections", ":response_handler", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/log", @@ -383,6 +382,7 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/strings:string_view", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -392,8 +392,6 @@ cc_test( deps = [ ":redis_connections", ":vlan_entry_translation", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_producer_state_table_adapter", @@ -404,6 +402,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -415,7 +415,6 @@ cc_library( ":redis_connections", ":response_handler", "//p4_pdpi:ir", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4rt_app/utils:status_utility", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", @@ -425,6 +424,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -434,8 +434,6 @@ cc_test( deps = [ ":redis_connections", ":vrf_entry_translation", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_producer_state_table_adapter", @@ -446,6 +444,8 @@ cc_test( "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -456,7 +456,6 @@ cc_library( deps = [ ":app_db_to_pdpi_ir_translator", ":redis_connections", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "@com_github_nlohmann_json//:nlohmann_json", @@ -466,6 +465,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -475,8 +475,6 @@ cc_test( deps = [ ":packet_replication_entry_translation", ":redis_connections", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:mock_consumer_notifier_adapter", "//p4rt_app/sonic/adapters:mock_notification_producer_adapter", @@ -486,6 +484,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -496,7 +496,6 @@ cc_library( deps = [ ":redis_connections", ":response_handler", - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:annotation_parser", "@com_github_nlohmann_json//:nlohmann_json", @@ -511,6 +510,7 @@ cc_library( "@com_google_absl//absl/types:span", "@com_google_googleapis//google/rpc:code_cc_proto", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -520,8 +520,6 @@ cc_test( deps = [ ":hashing", ":redis_connections", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4rt_app/sonic/adapters:fake_consumer_notifier_adapter", @@ -538,6 +536,8 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -546,7 +546,7 @@ cc_library( srcs = ["swss_utils.cc"], hdrs = ["swss_utils.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", @@ -559,7 +559,7 @@ cc_test( srcs = ["swss_utils_test.cc"], deps = [ ":swss_utils", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", diff --git a/p4rt_app/sonic/adapters/BUILD.bazel b/p4rt_app/sonic/adapters/BUILD.bazel index dfbd3428f..b125cede3 100644 --- a/p4rt_app/sonic/adapters/BUILD.bazel +++ b/p4rt_app/sonic/adapters/BUILD.bazel @@ -197,7 +197,7 @@ cc_test( srcs = ["fake_sonic_db_table_test.cc"], deps = [ ":fake_sonic_db_table", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", diff --git a/p4rt_app/sonic/adapters/fake_sonic_db_table_test.cc b/p4rt_app/sonic/adapters/fake_sonic_db_table_test.cc index 1667e0d26..9930c1bd7 100644 --- a/p4rt_app/sonic/adapters/fake_sonic_db_table_test.cc +++ b/p4rt_app/sonic/adapters/fake_sonic_db_table_test.cc @@ -22,7 +22,7 @@ #include "absl/status/statusor.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" namespace p4rt_app { namespace sonic { diff --git a/p4rt_app/sonic/app_db_acl_def_table_manager.cc b/p4rt_app/sonic/app_db_acl_def_table_manager.cc index 8785736e4..462e6d7f4 100644 --- a/p4rt_app/sonic/app_db_acl_def_table_manager.cc +++ b/p4rt_app/sonic/app_db_acl_def_table_manager.cc @@ -29,7 +29,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "absl/types/optional.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "p4_pdpi/utils/annotation_parser.h" #include "p4rt_app/utils/table_utility.h" diff --git a/p4rt_app/sonic/app_db_acl_def_table_manager_test.cc b/p4rt_app/sonic/app_db_acl_def_table_manager_test.cc index dd8cc5b1e..3163665ba 100644 --- a/p4rt_app/sonic/app_db_acl_def_table_manager_test.cc +++ b/p4rt_app/sonic/app_db_acl_def_table_manager_test.cc @@ -21,7 +21,7 @@ #include "google/protobuf/text_format.h" #include "gtest/gtest.h" #include "include/nlohmann/json.hpp" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/sonic/adapters/fake_notification_producer_adapter.h" #include "p4rt_app/sonic/adapters/fake_sonic_db_table.h" #include "p4rt_app/sonic/redis_connections.h" diff --git a/p4rt_app/sonic/app_db_manager.cc b/p4rt_app/sonic/app_db_manager.cc index 8995df726..a3b44bf9b 100644 --- a/p4rt_app/sonic/app_db_manager.cc +++ b/p4rt_app/sonic/app_db_manager.cc @@ -32,8 +32,8 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "google/rpc/code.pb.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/sonic/app_db_manager_test.cc b/p4rt_app/sonic/app_db_manager_test.cc index c636f4e5a..7b32f96db 100644 --- a/p4rt_app/sonic/app_db_manager_test.cc +++ b/p4rt_app/sonic/app_db_manager_test.cc @@ -24,8 +24,8 @@ #include "google/protobuf/text_format.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/mock_notification_producer_adapter.h" diff --git a/p4rt_app/sonic/app_db_to_pdpi_ir_translator.cc b/p4rt_app/sonic/app_db_to_pdpi_ir_translator.cc index 9147ce55e..0151abfd7 100644 --- a/p4rt_app/sonic/app_db_to_pdpi_ir_translator.cc +++ b/p4rt_app/sonic/app_db_to_pdpi_ir_translator.cc @@ -25,8 +25,8 @@ #include "absl/strings/str_split.h" #include "absl/strings/strip.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/utils/ir.h" diff --git a/p4rt_app/sonic/app_db_to_pdpi_ir_translator_test.cc b/p4rt_app/sonic/app_db_to_pdpi_ir_translator_test.cc index 3a6c7ede9..2b1b057d6 100644 --- a/p4rt_app/sonic/app_db_to_pdpi_ir_translator_test.cc +++ b/p4rt_app/sonic/app_db_to_pdpi_ir_translator_test.cc @@ -22,8 +22,8 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.h" #include "sai_p4/instantiations/google/sai_p4info.h" diff --git a/p4rt_app/sonic/fake_packetio_interface.cc b/p4rt_app/sonic/fake_packetio_interface.cc index 8e3aa0c38..97be94879 100644 --- a/p4rt_app/sonic/fake_packetio_interface.cc +++ b/p4rt_app/sonic/fake_packetio_interface.cc @@ -17,7 +17,7 @@ #include "absl/status/status.h" #include "absl/strings/str_cat.h" #include "absl/synchronization/mutex.h" -#include "gutil/gutil/collections.h" +#include "gutil/collections.h" namespace p4rt_app { namespace sonic { diff --git a/p4rt_app/sonic/hashing.cc b/p4rt_app/sonic/hashing.cc index 510a04bbf..95a596535 100644 --- a/p4rt_app/sonic/hashing.cc +++ b/p4rt_app/sonic/hashing.cc @@ -31,7 +31,7 @@ #include "absl/types/span.h" #include "google/rpc/code.pb.h" #include "include/nlohmann/json.hpp" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/utils/annotation_parser.h" #include "p4rt_app/sonic/redis_connections.h" diff --git a/p4rt_app/sonic/hashing_test.cc b/p4rt_app/sonic/hashing_test.cc index 5fa362b05..697358cd6 100644 --- a/p4rt_app/sonic/hashing_test.cc +++ b/p4rt_app/sonic/hashing_test.cc @@ -27,8 +27,8 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/sonic/packet_replication_entry_translation.cc b/p4rt_app/sonic/packet_replication_entry_translation.cc index bd67aa056..2748dc871 100644 --- a/p4rt_app/sonic/packet_replication_entry_translation.cc +++ b/p4rt_app/sonic/packet_replication_entry_translation.cc @@ -29,7 +29,7 @@ #include "absl/strings/numbers.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/app_db_to_pdpi_ir_translator.h" diff --git a/p4rt_app/sonic/packet_replication_entry_translation.h b/p4rt_app/sonic/packet_replication_entry_translation.h index ee4a69034..a26f79d0a 100644 --- a/p4rt_app/sonic/packet_replication_entry_translation.h +++ b/p4rt_app/sonic/packet_replication_entry_translation.h @@ -17,7 +17,7 @@ #include #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/redis_connections.h" diff --git a/p4rt_app/sonic/packet_replication_entry_translation_test.cc b/p4rt_app/sonic/packet_replication_entry_translation_test.cc index 169fc71a1..5a7353cb2 100644 --- a/p4rt_app/sonic/packet_replication_entry_translation_test.cc +++ b/p4rt_app/sonic/packet_replication_entry_translation_test.cc @@ -23,8 +23,8 @@ #include "google/protobuf/text_format.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" diff --git a/p4rt_app/sonic/packetio_impl.cc b/p4rt_app/sonic/packetio_impl.cc index 9a7744fd8..faf9d05e7 100644 --- a/p4rt_app/sonic/packetio_impl.cc +++ b/p4rt_app/sonic/packetio_impl.cc @@ -22,8 +22,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4rt_app/sonic/receive_genetlink.h" #include "swss/selectable.h" diff --git a/p4rt_app/sonic/packetio_impl_test.cc b/p4rt_app/sonic/packetio_impl_test.cc index 682309d1e..9dab75ce3 100644 --- a/p4rt_app/sonic/packetio_impl_test.cc +++ b/p4rt_app/sonic/packetio_impl_test.cc @@ -25,7 +25,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/sonic/adapters/mock_system_call_adapter.h" namespace p4rt_app { diff --git a/p4rt_app/sonic/packetio_port.cc b/p4rt_app/sonic/packetio_port.cc index 4c0d35fc8..524d4cea9 100644 --- a/p4rt_app/sonic/packetio_port.cc +++ b/p4rt_app/sonic/packetio_port.cc @@ -34,8 +34,8 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4rt_app/sonic/adapters/system_call_adapter.h" namespace p4rt_app { diff --git a/p4rt_app/sonic/packetio_port_test.cc b/p4rt_app/sonic/packetio_port_test.cc index ab353a8d8..4fefa1058 100644 --- a/p4rt_app/sonic/packetio_port_test.cc +++ b/p4rt_app/sonic/packetio_port_test.cc @@ -18,7 +18,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/sonic/adapters/mock_system_call_adapter.h" namespace p4rt_app { diff --git a/p4rt_app/sonic/receive_genetlink.cc b/p4rt_app/sonic/receive_genetlink.cc index 1b58f8efa..bb478a097 100644 --- a/p4rt_app/sonic/receive_genetlink.cc +++ b/p4rt_app/sonic/receive_genetlink.cc @@ -20,7 +20,7 @@ #include #include "absl/log/log.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" namespace packet_metadata { diff --git a/p4rt_app/sonic/response_handler.cc b/p4rt_app/sonic/response_handler.cc index 0c6e1938b..0e502b687 100644 --- a/p4rt_app/sonic/response_handler.cc +++ b/p4rt_app/sonic/response_handler.cc @@ -26,7 +26,7 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_join.h" #include "google/rpc/code.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/table_adapter.h" diff --git a/p4rt_app/sonic/response_handler_test.cc b/p4rt_app/sonic/response_handler_test.cc index 8ccea5f98..6384e2d31 100644 --- a/p4rt_app/sonic/response_handler_test.cc +++ b/p4rt_app/sonic/response_handler_test.cc @@ -20,8 +20,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" diff --git a/p4rt_app/sonic/state_verification.cc b/p4rt_app/sonic/state_verification.cc index be5520763..b2fd0e7a9 100644 --- a/p4rt_app/sonic/state_verification.cc +++ b/p4rt_app/sonic/state_verification.cc @@ -26,7 +26,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/table_adapter.h" #include "p4rt_app/sonic/app_db_manager.h" diff --git a/p4rt_app/sonic/state_verification_test.cc b/p4rt_app/sonic/state_verification_test.cc index bb038c76e..89a509e30 100644 --- a/p4rt_app/sonic/state_verification_test.cc +++ b/p4rt_app/sonic/state_verification_test.cc @@ -22,7 +22,7 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" #include "p4rt_app/sonic/adapters/mock_notification_producer_adapter.h" #include "p4rt_app/sonic/adapters/mock_table_adapter.h" diff --git a/p4rt_app/sonic/swss_utils.cc b/p4rt_app/sonic/swss_utils.cc index cdf3b946f..1c488dcc9 100644 --- a/p4rt_app/sonic/swss_utils.cc +++ b/p4rt_app/sonic/swss_utils.cc @@ -5,7 +5,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "swss/rediscommand.h" #include "swss/table.h" diff --git a/p4rt_app/sonic/swss_utils_test.cc b/p4rt_app/sonic/swss_utils_test.cc index 4c9214087..9492d23d9 100644 --- a/p4rt_app/sonic/swss_utils_test.cc +++ b/p4rt_app/sonic/swss_utils_test.cc @@ -17,7 +17,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "swss/rediscommand.h" #include "swss/schema.h" #include "swss/table.h" diff --git a/p4rt_app/sonic/vlan_entry_translation.cc b/p4rt_app/sonic/vlan_entry_translation.cc index 2f009c98d..cf6374265 100644 --- a/p4rt_app/sonic/vlan_entry_translation.cc +++ b/p4rt_app/sonic/vlan_entry_translation.cc @@ -27,7 +27,7 @@ #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/redis_connections.h" #include "p4rt_app/sonic/response_handler.h" diff --git a/p4rt_app/sonic/vlan_entry_translation_test.cc b/p4rt_app/sonic/vlan_entry_translation_test.cc index df820afed..278ecaa7a 100644 --- a/p4rt_app/sonic/vlan_entry_translation_test.cc +++ b/p4rt_app/sonic/vlan_entry_translation_test.cc @@ -24,8 +24,8 @@ #include "google/protobuf/text_format.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" diff --git a/p4rt_app/sonic/vrf_entry_translation.cc b/p4rt_app/sonic/vrf_entry_translation.cc index aefc973d5..70726831f 100644 --- a/p4rt_app/sonic/vrf_entry_translation.cc +++ b/p4rt_app/sonic/vrf_entry_translation.cc @@ -24,7 +24,7 @@ #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "google/rpc/code.pb.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/redis_connections.h" #include "p4rt_app/sonic/response_handler.h" diff --git a/p4rt_app/sonic/vrf_entry_translation.h b/p4rt_app/sonic/vrf_entry_translation.h index c037ded46..c1a13dd9a 100644 --- a/p4rt_app/sonic/vrf_entry_translation.h +++ b/p4rt_app/sonic/vrf_entry_translation.h @@ -17,7 +17,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/redis_connections.h" diff --git a/p4rt_app/sonic/vrf_entry_translation_test.cc b/p4rt_app/sonic/vrf_entry_translation_test.cc index 1740e0fea..b4209f72f 100644 --- a/p4rt_app/sonic/vrf_entry_translation_test.cc +++ b/p4rt_app/sonic/vrf_entry_translation_test.cc @@ -21,8 +21,8 @@ #include "google/protobuf/text_format.h" #include "google/rpc/code.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4rt_app/sonic/adapters/mock_consumer_notifier_adapter.h" diff --git a/p4rt_app/tests/BUILD.bazel b/p4rt_app/tests/BUILD.bazel index 0deb97a5e..98955f93b 100644 --- a/p4rt_app/tests/BUILD.bazel +++ b/p4rt_app/tests/BUILD.bazel @@ -24,9 +24,6 @@ cc_test( srcs = ["acl_table_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", @@ -46,6 +43,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -54,8 +54,6 @@ cc_test( srcs = ["api_access_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/tests/lib:p4runtime_grpc_service", "@com_github_grpc_grpc//:grpc++", @@ -66,6 +64,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -74,8 +74,6 @@ cc_test( srcs = ["arbitration_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/tests/lib:p4runtime_grpc_service", "@com_github_grpc_grpc//:grpc++", @@ -87,6 +85,8 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googleapis//google/rpc:status_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -95,9 +95,6 @@ cc_test( srcs = ["action_set_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4rt_app/tests/lib:app_db_entry_builder", "//p4rt_app/tests/lib:p4runtime_component_test_fixture", @@ -111,6 +108,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -119,10 +119,6 @@ cc_test( srcs = ["fixed_l3_tables_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", @@ -142,6 +138,10 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -150,10 +150,6 @@ cc_test( srcs = ["forwarding_pipeline_config_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4_pdpi/utils:annotation_parser", "//p4rt_app/p4runtime:p4runtime_impl", @@ -181,6 +177,10 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -189,7 +189,6 @@ cc_test( srcs = ["p4_programs_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi/utils:annotation_parser", @@ -202,6 +201,7 @@ cc_test( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -211,8 +211,6 @@ cc_test( srcs = ["packetio_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", @@ -234,6 +232,8 @@ cc_test( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -244,7 +244,6 @@ cc_test( deps = [ "//p4_pdpi:p4_runtime_session", "//p4rt_app/event_monitoring:config_db_queue_table_event", - "//gutil/gutil:io", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/tests/lib:p4runtime_component_test_fixture", "//p4rt_app/tests/lib:p4runtime_grpc_service", @@ -255,6 +254,7 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:io", ], ) @@ -263,8 +263,6 @@ cc_test( srcs = ["port_name_and_id_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4rt_app/p4runtime:p4runtime_impl", @@ -278,6 +276,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -286,8 +286,6 @@ cc_test( srcs = ["cpu_queue_name_and_id_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4rt_app/event_monitoring:config_db_queue_table_event", "//p4rt_app/sonic/adapters:fake_sonic_db_table", @@ -298,6 +296,8 @@ cc_test( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -320,8 +320,6 @@ cc_test( srcs = ["packet_replication_table_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4rt_app/tests/lib:p4runtime_component_test_fixture", @@ -331,6 +329,8 @@ cc_test( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -339,9 +339,6 @@ cc_test( srcs = ["response_path_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4rt_app/p4runtime:p4runtime_impl", @@ -357,6 +354,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -365,9 +365,6 @@ cc_test( srcs = ["role_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4rt_app/p4runtime:p4runtime_impl", @@ -387,6 +384,9 @@ cc_test( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -395,7 +395,6 @@ cc_test( srcs = ["state_verification_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4rt_app/tests/lib:app_db_entry_builder", "//p4rt_app/tests/lib:p4runtime_component_test_fixture", @@ -404,6 +403,7 @@ cc_test( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -412,8 +412,6 @@ cc_test( srcs = ["vrf_table_test.cc"], tags = ["exclusive"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -426,6 +424,8 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -451,10 +451,6 @@ cc_test( name = "warm_restart_bootup_test", srcs = ["warm_restart_bootup_test.cc"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4rt_app/p4runtime:p4runtime_impl", "//p4rt_app/p4runtime:queue_translator", @@ -476,6 +472,10 @@ cc_test( "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", "@sonic_swss_common//:common", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -486,8 +486,6 @@ cc_test( linkstatic = True, tags = ["exclusive"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -502,6 +500,8 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -509,9 +509,6 @@ cc_test( name = "resource_limits_test", srcs = ["resource_limits_test.cc"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -524,6 +521,9 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -531,7 +531,6 @@ cc_test( name = "utf8_validity_test", srcs = ["utf8_validity_test.cc"], deps = [ - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:pd", "//p4_pdpi/string_encodings:hex_string", @@ -542,6 +541,7 @@ cc_test( "@com_github_grpc_grpc//:grpc++", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4rt_app/tests/acl_table_test.cc b/p4rt_app/tests/acl_table_test.cc index 2a6507d1c..5a5538ac5 100644 --- a/p4rt_app/tests/acl_table_test.cc +++ b/p4rt_app/tests/acl_table_test.cc @@ -23,10 +23,10 @@ #include "gmock/gmock.h" #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4rt_app/tests/action_set_test.cc b/p4rt_app/tests/action_set_test.cc index 147121d6b..d0c4d6cc5 100644 --- a/p4rt_app/tests/action_set_test.cc +++ b/p4rt_app/tests/action_set_test.cc @@ -20,10 +20,10 @@ #include "gmock/gmock.h" #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/p4rt_app/tests/api_access_test.cc b/p4rt_app/tests/api_access_test.cc index 5b11c94a1..619fc66f8 100644 --- a/p4rt_app/tests/api_access_test.cc +++ b/p4rt_app/tests/api_access_test.cc @@ -25,8 +25,8 @@ #include "grpcpp/client_context.h" #include "grpcpp/support/sync_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" diff --git a/p4rt_app/tests/arbitration_test.cc b/p4rt_app/tests/arbitration_test.cc index b34641aca..9610f6e5f 100644 --- a/p4rt_app/tests/arbitration_test.cc +++ b/p4rt_app/tests/arbitration_test.cc @@ -28,8 +28,8 @@ #include "grpcpp/support/status.h" #include "grpcpp/support/sync_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" diff --git a/p4rt_app/tests/cpu_queue_name_and_id_test.cc b/p4rt_app/tests/cpu_queue_name_and_id_test.cc index 824431b90..a3495c45d 100644 --- a/p4rt_app/tests/cpu_queue_name_and_id_test.cc +++ b/p4rt_app/tests/cpu_queue_name_and_id_test.cc @@ -14,8 +14,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4rt_app/event_monitoring/config_db_queue_table_event.h" diff --git a/p4rt_app/tests/debug_data_dump_test.cc b/p4rt_app/tests/debug_data_dump_test.cc index 7f016f5e0..925ed1d04 100644 --- a/p4rt_app/tests/debug_data_dump_test.cc +++ b/p4rt_app/tests/debug_data_dump_test.cc @@ -20,7 +20,7 @@ #include "gtest/gtest.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4rt_app/event_monitoring/config_db_queue_table_event.h" -#include "gutil/gutil/io.h" +#include "gutil/io.h" #include "p4rt_app/p4runtime/p4runtime_impl.h" #include "p4rt_app/tests/lib/p4runtime_component_test_fixture.h" #include "p4rt_app/tests/lib/p4runtime_grpc_service.h" diff --git a/p4rt_app/tests/fixed_l3_tables_test.cc b/p4rt_app/tests/fixed_l3_tables_test.cc index ee5acffc8..e92981cb6 100644 --- a/p4rt_app/tests/fixed_l3_tables_test.cc +++ b/p4rt_app/tests/fixed_l3_tables_test.cc @@ -26,10 +26,10 @@ #include "gmock/gmock.h" #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4rt_app/tests/forwarding_pipeline_config_test.cc b/p4rt_app/tests/forwarding_pipeline_config_test.cc index c2c227c3d..17f6e9eea 100644 --- a/p4rt_app/tests/forwarding_pipeline_config_test.cc +++ b/p4rt_app/tests/forwarding_pipeline_config_test.cc @@ -37,10 +37,10 @@ #include "grpcpp/security/credentials.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/tests/hashing_test.cc b/p4rt_app/tests/hashing_test.cc index 589c9012c..0950307a1 100644 --- a/p4rt_app/tests/hashing_test.cc +++ b/p4rt_app/tests/hashing_test.cc @@ -28,7 +28,7 @@ #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" #include "include/nlohmann/json.hpp" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/p4rt_app/tests/lib/BUILD.bazel b/p4rt_app/tests/lib/BUILD.bazel index 94b39d1f4..4cc64c752 100644 --- a/p4rt_app/tests/lib/BUILD.bazel +++ b/p4rt_app/tests/lib/BUILD.bazel @@ -44,7 +44,6 @@ cc_library( hdrs = ["p4runtime_component_test_fixture.h"], deps = [ ":p4runtime_grpc_service", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -56,6 +55,7 @@ cc_library( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -90,7 +90,6 @@ cc_library( srcs = ["p4runtime_request_helpers.cc"], hdrs = ["p4runtime_request_helpers.h"], deps = [ - "//gutil/gutil:proto", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", "//sai_p4/instantiations/google:sai_pd_cc_proto", @@ -98,5 +97,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", ], ) diff --git a/p4rt_app/tests/lib/p4runtime_component_test_fixture.h b/p4rt_app/tests/lib/p4runtime_component_test_fixture.h index fb827609a..4dda2b8e6 100644 --- a/p4rt_app/tests/lib/p4runtime_component_test_fixture.h +++ b/p4rt_app/tests/lib/p4runtime_component_test_fixture.h @@ -17,7 +17,7 @@ #include "absl/strings/str_cat.h" #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/tests/lib/p4runtime_request_helpers.cc b/p4rt_app/tests/lib/p4runtime_request_helpers.cc index 3b1be6adc..d4b9e4949 100644 --- a/p4rt_app/tests/lib/p4runtime_request_helpers.cc +++ b/p4rt_app/tests/lib/p4runtime_request_helpers.cc @@ -15,8 +15,8 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/pd.h" diff --git a/p4rt_app/tests/p4_constraints_test_runner.cc b/p4rt_app/tests/p4_constraints_test_runner.cc index f1b1f92d4..f68f82cc9 100644 --- a/p4rt_app/tests/p4_constraints_test_runner.cc +++ b/p4rt_app/tests/p4_constraints_test_runner.cc @@ -25,8 +25,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/tests/p4_programs_test.cc b/p4rt_app/tests/p4_programs_test.cc index 2a517764e..7162caff9 100644 --- a/p4rt_app/tests/p4_programs_test.cc +++ b/p4rt_app/tests/p4_programs_test.cc @@ -20,7 +20,7 @@ #include "grpcpp/security/credentials.h" #include "gtest/gtest.h" #include "include/nlohmann/json.hpp" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/tests/packet_replication_table_test.cc b/p4rt_app/tests/packet_replication_table_test.cc index e62aaabfc..dd6d36f9b 100644 --- a/p4rt_app/tests/packet_replication_table_test.cc +++ b/p4rt_app/tests/packet_replication_table_test.cc @@ -16,8 +16,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/p4rt_app/tests/packetio_test.cc b/p4rt_app/tests/packetio_test.cc index f83607554..0833c7194 100644 --- a/p4rt_app/tests/packetio_test.cc +++ b/p4rt_app/tests/packetio_test.cc @@ -30,9 +30,9 @@ #include "grpcpp/support/status.h" #include "grpcpp/support/sync_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/tests/port_name_and_id_test.cc b/p4rt_app/tests/port_name_and_id_test.cc index 9b2253f7c..4ca93ebd5 100644 --- a/p4rt_app/tests/port_name_and_id_test.cc +++ b/p4rt_app/tests/port_name_and_id_test.cc @@ -22,8 +22,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/p4rt_app/tests/resource_limits_test.cc b/p4rt_app/tests/resource_limits_test.cc index 737d30880..e8cf04c42 100644 --- a/p4rt_app/tests/resource_limits_test.cc +++ b/p4rt_app/tests/resource_limits_test.cc @@ -20,9 +20,9 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/p4rt_app/tests/response_path_test.cc b/p4rt_app/tests/response_path_test.cc index 57936aaff..187d4a978 100644 --- a/p4rt_app/tests/response_path_test.cc +++ b/p4rt_app/tests/response_path_test.cc @@ -23,9 +23,9 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/tests/role_test.cc b/p4rt_app/tests/role_test.cc index 9143f1baf..6b3e099d3 100644 --- a/p4rt_app/tests/role_test.cc +++ b/p4rt_app/tests/role_test.cc @@ -25,9 +25,9 @@ #include "grpcpp/security/credentials.h" #include "grpcpp/support/sync_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4rt_app/tests/state_verification_test.cc b/p4rt_app/tests/state_verification_test.cc index f656eb497..620cb2f50 100644 --- a/p4rt_app/tests/state_verification_test.cc +++ b/p4rt_app/tests/state_verification_test.cc @@ -14,7 +14,7 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4rt_app/tests/lib/app_db_entry_builder.h" diff --git a/p4rt_app/tests/utf8_validity_test.cc b/p4rt_app/tests/utf8_validity_test.cc index 513295d67..40910914c 100644 --- a/p4rt_app/tests/utf8_validity_test.cc +++ b/p4rt_app/tests/utf8_validity_test.cc @@ -19,7 +19,7 @@ #include "gmock/gmock.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4_pdpi/pd.h" #include "p4_pdpi/string_encodings/hex_string.h" diff --git a/p4rt_app/tests/vrf_table_test.cc b/p4rt_app/tests/vrf_table_test.cc index 890ecb376..db7cf375b 100644 --- a/p4rt_app/tests/vrf_table_test.cc +++ b/p4rt_app/tests/vrf_table_test.cc @@ -20,9 +20,9 @@ #include "absl/status/statusor.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/p4rt_app/tests/warm_restart_bootup_test.cc b/p4rt_app/tests/warm_restart_bootup_test.cc index 51356d64c..d61499deb 100644 --- a/p4rt_app/tests/warm_restart_bootup_test.cc +++ b/p4rt_app/tests/warm_restart_bootup_test.cc @@ -33,10 +33,10 @@ #include "grpcpp/security/credentials.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/p4rt_app/utils/BUILD.bazel b/p4rt_app/utils/BUILD.bazel index c7a3a4042..3f610c443 100644 --- a/p4rt_app/utils/BUILD.bazel +++ b/p4rt_app/utils/BUILD.bazel @@ -21,7 +21,6 @@ cc_library( srcs = ["table_utility.cc"], hdrs = ["table_utility.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi/utils:annotation_parser", "@com_github_p4lang_p4runtime//:p4info_cc_proto", @@ -30,6 +29,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", "@sonic_swss_common//:libswsscommon", + "@com_google_gutil//gutil:status", ], ) @@ -38,13 +38,13 @@ cc_test( srcs = ["table_utility_test.cc"], deps = [ ":table_utility", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/p4rt_app/utils/table_utility.cc b/p4rt_app/utils/table_utility.cc index 1933606f7..083956d21 100644 --- a/p4rt_app/utils/table_utility.cc +++ b/p4rt_app/utils/table_utility.cc @@ -23,7 +23,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "google/protobuf/map.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/utils/annotation_parser.h" diff --git a/p4rt_app/utils/table_utility_test.cc b/p4rt_app/utils/table_utility_test.cc index 3a25b05c7..53396d7c6 100644 --- a/p4rt_app/utils/table_utility_test.cc +++ b/p4rt_app/utils/table_utility_test.cc @@ -20,9 +20,9 @@ #include "google/protobuf/map.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" // NOLINT +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" // NOLINT #include "p4_pdpi/ir.pb.h" namespace p4rt_app { diff --git a/pins_infra_deps.bzl b/pins_infra_deps.bzl index d46623e08..4a82a950e 100644 --- a/pins_infra_deps.bzl +++ b/pins_infra_deps.bzl @@ -81,6 +81,21 @@ def pins_infra_deps(): strip_prefix = "googleapis-f405c718d60484124808adb7fb5963974d654bb4", sha256 = "406b64643eede84ce3e0821a1d01f66eaf6254e79cb9c4f53be9054551935e79", ) + if not native.existing_rule("com_github_google_glog"): + http_archive( + name = "com_github_google_glog", + url = "https://github.com/google/glog/archive/v0.6.0.tar.gz", + strip_prefix = "glog-0.6.0", + sha256 = "8a83bf982f37bb70825df71a9709fa90ea9f4447fb3c099e1d720a439d88bad6", + ) + if not native.existing_rule("com_google_gutil"): + http_archive( + name = "com_google_gutil", + # Newest commit on main as of 2025-02-21. + url = "https://github.com/google/gutil/archive/9c1f8fdf5b626014c41aad98a3289ef67cf47ab9.zip", + strip_prefix = "gutil-9c1f8fdf5b626014c41aad98a3289ef67cf47ab9", + sha256 = "e804da2534d5de5d68497222027cdbf39d4cb6880dbe67aa8d20f69b8bc7d4f1", + ) if not native.existing_rule("com_github_otg_models"): http_archive( name = "com_github_otg_models", diff --git a/sai_p4/BUILD.bazel b/sai_p4/BUILD.bazel index 5be625c54..34e479ba1 100644 --- a/sai_p4/BUILD.bazel +++ b/sai_p4/BUILD.bazel @@ -21,7 +21,7 @@ cc_library( hdrs = ["capabilities.h"], deps = [ ":capabilities_cc_proto", - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_protobuf//:protobuf", @@ -34,8 +34,8 @@ cc_test( deps = [ ":capabilities", ":capabilities_cc_proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_googletest//:gtest_main", ], ) diff --git a/sai_p4/capabilities_test.cc b/sai_p4/capabilities_test.cc index dfd5db9df..1b995c8b3 100644 --- a/sai_p4/capabilities_test.cc +++ b/sai_p4/capabilities_test.cc @@ -2,8 +2,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "sai_p4/capabilities.pb.h" namespace sai { diff --git a/sai_p4/instantiations/google/BUILD.bazel b/sai_p4/instantiations/google/BUILD.bazel index 586dfc6e9..e4c5df838 100644 --- a/sai_p4/instantiations/google/BUILD.bazel +++ b/sai_p4/instantiations/google/BUILD.bazel @@ -15,7 +15,7 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@com_github_p4lang_p4c//:bazel/p4_library.bzl", "p4_library") load("@com_google_googleapis_imports//:imports.bzl", "cc_proto_library") -load("//gutil/gutil/embed_data:build_defs.bzl", "cc_embed_data") +load("@com_google_gutil//gutil/embed_data:build_defs.bzl", "cc_embed_data") load("//p4_pdpi:pdgen.bzl", "p4_pd_proto") load("//p4_pdpi/testing:diff_test.bzl", "cmd_diff_test", "diff_test") @@ -146,7 +146,7 @@ cc_test( deps = [ ":sai_pd_cc_proto", ":sai_pd_util", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:testing", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_googlesource_code_re2//:re2", @@ -213,9 +213,9 @@ cc_test( deps = [ ":instantiations", ":sai_p4info_cc", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:version", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:version", "@com_github_p4lang_p4_constraints//p4_constraints/backend:constraint_info", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/strings", @@ -252,8 +252,8 @@ cc_test( ":clos_stage", ":instantiations", ":sai_p4info_fetcher_cc", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/status", @@ -382,8 +382,8 @@ cc_test( deps = [ ":clos_stage", ":instantiations", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_google_googletest//:gtest_main", ], ) @@ -429,7 +429,7 @@ cc_test( deps = [ ":instantiations", ":sai_nonstandard_platforms_cc", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -442,7 +442,7 @@ cc_binary( deps = [ ":instantiations", ":sai_nonstandard_platforms_cc", - "//gutil/gutil:proto", + "@com_google_gutil//gutil:proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/flags:parse", diff --git a/sai_p4/instantiations/google/clos_stage_test.cc b/sai_p4/instantiations/google/clos_stage_test.cc index 39d374347..33c23950e 100644 --- a/sai_p4/instantiations/google/clos_stage_test.cc +++ b/sai_p4/instantiations/google/clos_stage_test.cc @@ -4,8 +4,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "sai_p4/instantiations/google/instantiations.h" namespace sai { diff --git a/sai_p4/instantiations/google/sai_nonstandard_platforms_config_generator.cc b/sai_p4/instantiations/google/sai_nonstandard_platforms_config_generator.cc index da4a32d55..3da865a86 100644 --- a/sai_p4/instantiations/google/sai_nonstandard_platforms_config_generator.cc +++ b/sai_p4/instantiations/google/sai_nonstandard_platforms_config_generator.cc @@ -5,7 +5,7 @@ #include "absl/flags/flag.h" #include "absl/flags/parse.h" -#include "gutil/gutil/proto.h" +#include "gutil/proto.h" #include "p4/v1/p4runtime.pb.h" #include "sai_p4/instantiations/google/instantiations.h" #include "sai_p4/instantiations/google/sai_nonstandard_platforms.h" diff --git a/sai_p4/instantiations/google/sai_nonstandard_platforms_test.cc b/sai_p4/instantiations/google/sai_nonstandard_platforms_test.cc index ee2bf3121..2f8d0da3e 100644 --- a/sai_p4/instantiations/google/sai_nonstandard_platforms_test.cc +++ b/sai_p4/instantiations/google/sai_nonstandard_platforms_test.cc @@ -4,7 +4,7 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/sai_p4/instantiations/google/sai_p4info_fetcher_test.cc b/sai_p4/instantiations/google/sai_p4info_fetcher_test.cc index 1d1769bca..ab166d327 100644 --- a/sai_p4/instantiations/google/sai_p4info_fetcher_test.cc +++ b/sai_p4/instantiations/google/sai_p4info_fetcher_test.cc @@ -8,8 +8,8 @@ #include "absl/strings/str_replace.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "sai_p4/instantiations/google/clos_stage.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/sai_p4/instantiations/google/sai_p4info_test.cc b/sai_p4/instantiations/google/sai_p4info_test.cc index 6c526ac46..8b4190b4b 100644 --- a/sai_p4/instantiations/google/sai_p4info_test.cc +++ b/sai_p4/instantiations/google/sai_p4info_test.cc @@ -8,9 +8,9 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/version.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/version.h" #include "p4/config/v1/p4info.pb.h" #include "p4_constraints/backend/constraint_info.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/sai_p4/instantiations/google/sai_pd_util_test.cc b/sai_p4/instantiations/google/sai_pd_util_test.cc index 94b5439db..5c7677c1b 100644 --- a/sai_p4/instantiations/google/sai_pd_util_test.cc +++ b/sai_p4/instantiations/google/sai_pd_util_test.cc @@ -5,7 +5,7 @@ #include "absl/strings/str_replace.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "re2/re2.h" #include "sai_p4/instantiations/google/sai_pd.pb.h" diff --git a/sai_p4/instantiations/google/test_tools/BUILD.bazel b/sai_p4/instantiations/google/test_tools/BUILD.bazel index 7ee055996..58f102725 100644 --- a/sai_p4/instantiations/google/test_tools/BUILD.bazel +++ b/sai_p4/instantiations/google/test_tools/BUILD.bazel @@ -24,10 +24,6 @@ cc_library( srcs = ["test_entries.cc"], hdrs = ["test_entries.h"], deps = [ - "//gutil/gutil:overload", - "//gutil/gutil:proto_ordering", - "//gutil/gutil:testing", - "//gutil/gutil:version", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -51,6 +47,10 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:overload", + "@com_google_gutil//gutil:proto_ordering", + "@com_google_gutil//gutil:testing", + "@com_google_gutil//gutil:version", ], ) @@ -59,9 +59,6 @@ cc_test( srcs = ["test_entries_test.cc"], deps = [ ":test_entries", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", "//p4_pdpi:ternary", @@ -75,6 +72,9 @@ cc_test( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -102,12 +102,12 @@ cc_test( srcs = ["table_entry_generator_helper_test.cc"], deps = [ ":table_entry_generator_helper", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -118,9 +118,6 @@ cc_library( hdrs = ["table_entry_generator.h"], deps = [ ":table_entry_generator_helper", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/container:flat_hash_map", @@ -128,6 +125,9 @@ cc_library( "@com_google_absl//absl/log", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -137,8 +137,6 @@ cc_test( shard_count = 50, deps = [ ":table_entry_generator", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:entity_keys", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -151,5 +149,7 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/sai_p4/instantiations/google/test_tools/table_entry_generator.cc b/sai_p4/instantiations/google/test_tools/table_entry_generator.cc index e8eca8819..859f52e14 100644 --- a/sai_p4/instantiations/google/test_tools/table_entry_generator.cc +++ b/sai_p4/instantiations/google/test_tools/table_entry_generator.cc @@ -27,9 +27,9 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" #include "sai_p4/instantiations/google/test_tools/table_entry_generator_helper.h" diff --git a/sai_p4/instantiations/google/test_tools/table_entry_generator_helper_test.cc b/sai_p4/instantiations/google/test_tools/table_entry_generator_helper_test.cc index 9f72e1303..f9893e670 100644 --- a/sai_p4/instantiations/google/test_tools/table_entry_generator_helper_test.cc +++ b/sai_p4/instantiations/google/test_tools/table_entry_generator_helper_test.cc @@ -20,8 +20,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/sai_p4/instantiations/google/test_tools/table_entry_generator_test.cc b/sai_p4/instantiations/google/test_tools/table_entry_generator_test.cc index fe227879e..675b7fb8a 100644 --- a/sai_p4/instantiations/google/test_tools/table_entry_generator_test.cc +++ b/sai_p4/instantiations/google/test_tools/table_entry_generator_test.cc @@ -24,8 +24,8 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/entity_keys.h" #include "p4_pdpi/ir.h" diff --git a/sai_p4/instantiations/google/test_tools/test_entries.cc b/sai_p4/instantiations/google/test_tools/test_entries.cc index b36b86130..6f95d48e3 100644 --- a/sai_p4/instantiations/google/test_tools/test_entries.cc +++ b/sai_p4/instantiations/google/test_tools/test_entries.cc @@ -32,11 +32,11 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/proto_ordering.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" -#include "gutil/gutil/version.h" +#include "gutil/overload.h" +#include "gutil/proto_ordering.h" +#include "gutil/status.h" +#include "gutil/testing.h" +#include "gutil/version.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/sai_p4/instantiations/google/test_tools/test_entries_test.cc b/sai_p4/instantiations/google/test_tools/test_entries_test.cc index 819962878..83a8c8849 100644 --- a/sai_p4/instantiations/google/test_tools/test_entries_test.cc +++ b/sai_p4/instantiations/google/test_tools/test_entries_test.cc @@ -21,9 +21,9 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/netaddr/ipv4_address.h" diff --git a/sai_p4/instantiations/google/tests/BUILD.bazel b/sai_p4/instantiations/google/tests/BUILD.bazel index e0a717374..20ec041ca 100644 --- a/sai_p4/instantiations/google/tests/BUILD.bazel +++ b/sai_p4/instantiations/google/tests/BUILD.bazel @@ -19,8 +19,6 @@ cc_test( srcs = ["p4_constraints_integration_test.cc"], shard_count = 5, deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:instantiations", @@ -30,6 +28,8 @@ cc_test( "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -38,10 +38,6 @@ cc_test( size = "large", srcs = ["p4_fuzzer_integration_test.cc"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/p4rt:p4rt_port", "//p4_fuzzer:fuzzer_config", "//p4_fuzzer:mutation_and_fuzz_util", @@ -59,6 +55,10 @@ cc_test( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/sai_p4/instantiations/google/tests/p4_constraints_integration_test.cc b/sai_p4/instantiations/google/tests/p4_constraints_integration_test.cc index 84d4361b7..3894b1167 100644 --- a/sai_p4/instantiations/google/tests/p4_constraints_integration_test.cc +++ b/sai_p4/instantiations/google/tests/p4_constraints_integration_test.cc @@ -16,8 +16,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_constraints/backend/constraint_info.h" diff --git a/sai_p4/instantiations/google/tests/p4_fuzzer_integration_test.cc b/sai_p4/instantiations/google/tests/p4_fuzzer_integration_test.cc index 8d4fa9787..f342b3c44 100644 --- a/sai_p4/instantiations/google/tests/p4_fuzzer_integration_test.cc +++ b/sai_p4/instantiations/google/tests/p4_fuzzer_integration_test.cc @@ -22,11 +22,11 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/sai_p4/tools/BUILD.bazel b/sai_p4/tools/BUILD.bazel index bf2e90e9d..c9c64b529 100644 --- a/sai_p4/tools/BUILD.bazel +++ b/sai_p4/tools/BUILD.bazel @@ -34,7 +34,6 @@ cc_library( srcs = ["packetio_tools.cc"], hdrs = ["packetio_tools.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//sai_p4/fixed:p4_ids", @@ -42,6 +41,7 @@ cc_library( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:status", ], ) @@ -50,9 +50,6 @@ cc_library( srcs = ["auxiliary_entries_for_v1model_targets.cc"], hdrs = ["auxiliary_entries_for_v1model_targets.h"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:version", "//lib/gnmi:gnmi_helper", "//p4_pdpi:ir_cc_proto", "//sai_p4/fixed:p4_ids", @@ -64,6 +61,9 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:version", ], ) @@ -72,9 +72,6 @@ cc_test( srcs = ["auxiliary_entries_for_v1model_targets_test.cc"], deps = [ ":auxiliary_entries_for_v1model_targets", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:instantiations", "//sai_p4/instantiations/google:sai_p4info_cc", @@ -82,6 +79,9 @@ cc_test( "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -90,8 +90,8 @@ cc_test( srcs = ["p4info_tools_test.cc"], deps = [ ":p4info_tools", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:testing", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -103,12 +103,12 @@ cc_test( srcs = ["packetio_tools_test.cc"], deps = [ ":packetio_tools", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:sai_p4info_cc", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/sai_p4/tools/auxiliary_entries_for_v1model_targets.cc b/sai_p4/tools/auxiliary_entries_for_v1model_targets.cc index aa2472a09..8b18af90c 100644 --- a/sai_p4/tools/auxiliary_entries_for_v1model_targets.cc +++ b/sai_p4/tools/auxiliary_entries_for_v1model_targets.cc @@ -23,9 +23,9 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/version.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/version.h" #include "lib/gnmi/gnmi_helper.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/sai_p4/tools/auxiliary_entries_for_v1model_targets_test.cc b/sai_p4/tools/auxiliary_entries_for_v1model_targets_test.cc index 5f5727106..252ee3f66 100644 --- a/sai_p4/tools/auxiliary_entries_for_v1model_targets_test.cc +++ b/sai_p4/tools/auxiliary_entries_for_v1model_targets_test.cc @@ -2,9 +2,9 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" diff --git a/sai_p4/tools/p4info_tools_test.cc b/sai_p4/tools/p4info_tools_test.cc index 83083586e..718836e11 100644 --- a/sai_p4/tools/p4info_tools_test.cc +++ b/sai_p4/tools/p4info_tools_test.cc @@ -20,8 +20,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/testing.h" #include "p4/config/v1/p4info.pb.h" namespace sai { diff --git a/sai_p4/tools/packetio_tools.cc b/sai_p4/tools/packetio_tools.cc index 517463569..ebce5834c 100644 --- a/sai_p4/tools/packetio_tools.cc +++ b/sai_p4/tools/packetio_tools.cc @@ -15,7 +15,7 @@ #include "sai_p4/tools/packetio_tools.h" #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/sai_p4/tools/packetio_tools_test.cc b/sai_p4/tools/packetio_tools_test.cc index 20026cc24..0e58d8883 100644 --- a/sai_p4/tools/packetio_tools_test.cc +++ b/sai_p4/tools/packetio_tools_test.cc @@ -3,8 +3,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.pb.h" #include "sai_p4/instantiations/google/sai_p4info.h" diff --git a/tests/BUILD.bazel b/tests/BUILD.bazel index 2290bb066..dc0d21824 100644 --- a/tests/BUILD.bazel +++ b/tests/BUILD.bazel @@ -29,8 +29,6 @@ cc_library( "thinkit_util.h", ], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//p4_pdpi:p4_runtime_session", "//lib/validator:validator_lib", @@ -51,6 +49,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -61,8 +61,6 @@ cc_library( hdrs = ["thinkit_gnmi_interface_util.h"], deps = [ ":thinkit_gnmi_subscribe_tests", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//p4_pdpi:pd", "//sai_p4/instantiations/google:sai_pd_cc_proto", @@ -78,6 +76,8 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_googletest//:gtest", "@com_googlesource_code_re2//:re2", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -93,9 +93,6 @@ cc_library( ], deps = [ ":thinkit_gnmi_interface_util", - "//gutil/gutil:collections", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//p4_pdpi:pd", "//sai_p4/instantiations/google:instantiations", @@ -114,6 +111,9 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -128,7 +128,6 @@ cc_library( "thinkit_util.h", ], deps = [ - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//p4_pdpi:p4_runtime_session", "//thinkit:ssh_client", @@ -143,6 +142,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -152,9 +152,6 @@ cc_test( deps = [ ":thinkit_gnmi_interface_util", ":thinkit_gnmi_tests", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//thinkit:mock_ssh_client", "//thinkit:mock_switch", @@ -169,5 +166,8 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/tests/forwarding/BUILD.bazel b/tests/forwarding/BUILD.bazel index ca3b8a6a1..336dd48aa 100644 --- a/tests/forwarding/BUILD.bazel +++ b/tests/forwarding/BUILD.bazel @@ -9,9 +9,9 @@ cc_library( srcs = ["test_data.cc"], hdrs = ["test_data.h"], deps = [ - "//gutil/gutil:testing", "//sai_p4/instantiations/google:sai_pd_cc_proto", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:testing", ], ) @@ -21,8 +21,6 @@ cc_library( srcs = ["p4info_push_test.cc"], hdrs = ["p4info_push_test.h"], deps = [ - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//p4_pdpi:p4_runtime_session", "//tests:thinkit_sanity_tests", @@ -33,6 +31,8 @@ cc_library( "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/log", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -43,12 +43,12 @@ cc_library( srcs = ["configure_mirror_testbed_test.cc"], hdrs = ["configure_mirror_testbed_test.h"], deps = [ - "//gutil/gutil:status_matchers", "//tests/lib:switch_test_setup_helpers", "//thinkit:mirror_testbed_fixture", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -61,10 +61,6 @@ cc_library( deps = [ ":mirror_blackbox_test_fixture", ":test_data", - "//gutil/gutil:status", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -88,6 +84,11 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -98,9 +99,6 @@ cc_library( srcs = ["arbitration_test.cc"], hdrs = ["arbitration_test.h"], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:p4_runtime_session", "//tests/lib:p4info_helper", @@ -118,6 +116,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -128,13 +129,13 @@ cc_library( srcs = ["util.cc"], hdrs = ["util.h"], deps = [ - "//gutil/gutil:status", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//sai_p4/tools:packetio_tools", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], ) @@ -161,10 +162,6 @@ cc_library( srcs = ["group_programming_util.cc"], hdrs = ["group_programming_util.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:pd", @@ -182,6 +179,10 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -194,10 +195,6 @@ cc_library( ":group_programming_util", ":packet_test_util", ":util", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", - "//gutil/gutil:version", "//lib/p4rt:p4rt_port", "//lib/validator:validator_lib", "//p4_pdpi:ir", @@ -232,6 +229,10 @@ cc_library( "@com_google_absl//absl/time", "@com_google_googletest//:gtest", "@com_googlesource_code_re2//:re2", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", + "@com_google_gutil//gutil:version", ], alwayslink = True, ) @@ -248,8 +249,8 @@ cc_library( deps = [ ":group_programming_util", ":hash_testfixture", - "//gutil/gutil:collections", - "//gutil/gutil:status", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", "@boost//:bimap", "@boost//:graph", "@com_google_absl//absl/container:btree", @@ -267,7 +268,7 @@ cc_test( ":group_programming_util", ":hash_statistics_util", ":hash_testfixture", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_google_absl//absl/log", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", @@ -283,7 +284,6 @@ cc_library( ":group_programming_util", ":hash_statistics_util", ":hash_testfixture", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_port", "//thinkit:switch", @@ -295,6 +295,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -311,8 +312,6 @@ cc_library( "//dvaas:test_vector_cc_proto", "//dvaas:validation_result", "//lib/p4rt:p4rt_port", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//p4_pdpi:p4_runtime_session_extras", @@ -321,6 +320,8 @@ cc_library( "@com_google_absl//absl/log", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -337,9 +338,6 @@ cc_library( "//dvaas:packet_injection", "//dvaas:switch_api", "//dvaas:test_vector_cc_proto", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//p4_fuzzer:annotation_util", @@ -373,6 +371,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -384,11 +385,6 @@ cc_library( hdrs = ["match_action_coverage_test.h"], linkstatic = True, deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:version", "//lib/gnmi:gnmi_helper", "//p4_fuzzer:fuzzer_config", "//p4_fuzzer:mutation_and_fuzz_util", @@ -418,6 +414,11 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:version", ], alwayslink = True, ) @@ -429,8 +430,6 @@ cc_library( hdrs = ["l3_admit_test.h"], deps = [ ":util", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -457,6 +456,8 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -467,10 +468,6 @@ cc_library( srcs = ["fuzzer_tests.cc"], hdrs = ["fuzzer_tests.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:version", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_port", "//p4_fuzzer:annotation_util", @@ -504,6 +501,10 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:version", ], ) @@ -518,10 +519,6 @@ cc_library( ":packet_test_util", ":util", "//dvaas:test_vector_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -559,6 +556,10 @@ cc_library( "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", "@com_googlesource_code_re2//:re2", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -573,10 +574,6 @@ cc_library( ":packet_test_util", ":util", "//dvaas:test_vector_cc_proto", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -608,6 +605,10 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -618,7 +619,6 @@ cc_library( srcs = ["mirror_blackbox_test_fixture.cc"], hdrs = ["mirror_blackbox_test_fixture.h"], deps = [ - "//gutil/gutil:status_matchers", "//p4_pdpi:p4_runtime_session", "//tests/lib:switch_test_setup_helpers", "//thinkit:mirror_testbed", @@ -626,6 +626,7 @@ cc_library( "//sai_p4/instantiations/google:sai_p4info_cc", "//sai_p4/instantiations/google:sai_pd_cc_proto", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -650,8 +651,6 @@ cc_library( "//dvaas:dataplane_validation", "//dvaas:test_vector_cc_proto", "//dvaas:validation_result", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/p4rt:p4rt_port", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", @@ -667,6 +666,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) diff --git a/tests/forwarding/acl_feature_test.cc b/tests/forwarding/acl_feature_test.cc index a0aadf20a..7dd67a27e 100644 --- a/tests/forwarding/acl_feature_test.cc +++ b/tests/forwarding/acl_feature_test.cc @@ -28,11 +28,11 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "net/google::protobuf/contrib/fixtures/proto-fixture-repository.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/forwarding/arbitration_test.cc b/tests/forwarding/arbitration_test.cc index b2fa79d3c..77721a223 100644 --- a/tests/forwarding/arbitration_test.cc +++ b/tests/forwarding/arbitration_test.cc @@ -23,9 +23,9 @@ #include "google/rpc/code.pb.h" #include "grpcpp/grpcpp.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" diff --git a/tests/forwarding/arbitration_test.h b/tests/forwarding/arbitration_test.h index ac615f872..43967d32b 100644 --- a/tests/forwarding/arbitration_test.h +++ b/tests/forwarding/arbitration_test.h @@ -29,8 +29,8 @@ #include "gmock/gmock.h" #include "grpcpp/grpcpp.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/tests/forwarding/arriba_test.cc b/tests/forwarding/arriba_test.cc index 917cbdc9f..9ae61023c 100644 --- a/tests/forwarding/arriba_test.cc +++ b/tests/forwarding/arriba_test.cc @@ -26,8 +26,8 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/tests/forwarding/configure_mirror_testbed_test.cc b/tests/forwarding/configure_mirror_testbed_test.cc index 4587cfd9d..1ad7a8efa 100644 --- a/tests/forwarding/configure_mirror_testbed_test.cc +++ b/tests/forwarding/configure_mirror_testbed_test.cc @@ -17,7 +17,7 @@ #include "absl/log/log.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "tests/lib/switch_test_setup_helpers.h" namespace pins { diff --git a/tests/forwarding/fuzzer_tests.cc b/tests/forwarding/fuzzer_tests.cc index 4e36448d9..31899ca08 100644 --- a/tests/forwarding/fuzzer_tests.cc +++ b/tests/forwarding/fuzzer_tests.cc @@ -36,10 +36,10 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep -#include "gutil/gutil/version.h" +#include "gutil/collections.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/version.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/forwarding/group_programming_util.cc b/tests/forwarding/group_programming_util.cc index 459542416..dcfb760c4 100644 --- a/tests/forwarding/group_programming_util.cc +++ b/tests/forwarding/group_programming_util.cc @@ -20,10 +20,10 @@ #include "absl/strings/str_cat.h" #include "absl/strings/substitute.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/p4_runtime_session.h" #include "p4_pdpi/pd.h" #include "sai_p4/fixed/ids.h" diff --git a/tests/forwarding/hash_statistics_util.cc b/tests/forwarding/hash_statistics_util.cc index cbbba960b..0fc0ef566 100644 --- a/tests/forwarding/hash_statistics_util.cc +++ b/tests/forwarding/hash_statistics_util.cc @@ -26,8 +26,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/substitute.h" #include "boost/math/distributions/chi_squared.hpp" // IWYU pragma: keep -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "tests/forwarding/group_programming_util.h" namespace pins_test { diff --git a/tests/forwarding/hash_statistics_util_test.cc b/tests/forwarding/hash_statistics_util_test.cc index 7100d8c8b..633983c64 100644 --- a/tests/forwarding/hash_statistics_util_test.cc +++ b/tests/forwarding/hash_statistics_util_test.cc @@ -22,7 +22,7 @@ #include "absl/strings/str_join.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "tests/forwarding/group_programming_util.h" namespace pins_test { diff --git a/tests/forwarding/hash_testfixture.cc b/tests/forwarding/hash_testfixture.cc index afd3ff0f7..4056c59e1 100644 --- a/tests/forwarding/hash_testfixture.cc +++ b/tests/forwarding/hash_testfixture.cc @@ -41,10 +41,10 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" -#include "gutil/gutil/version.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" +#include "gutil/version.h" #include "lib/p4rt/p4rt_port.h" #include "lib/validator/validator_lib.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/forwarding/l3_admit_test.cc b/tests/forwarding/l3_admit_test.cc index 6639450a6..f37825ac4 100644 --- a/tests/forwarding/l3_admit_test.cc +++ b/tests/forwarding/l3_admit_test.cc @@ -35,9 +35,9 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/p4rt/p4rt_port.h" diff --git a/tests/forwarding/l3_admit_test.h b/tests/forwarding/l3_admit_test.h index 0a2462e9e..d89a84e2e 100644 --- a/tests/forwarding/l3_admit_test.h +++ b/tests/forwarding/l3_admit_test.h @@ -20,7 +20,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/forwarding/l3_multicast_test.cc b/tests/forwarding/l3_multicast_test.cc index 50f78163c..5dfa9ee71 100644 --- a/tests/forwarding/l3_multicast_test.cc +++ b/tests/forwarding/l3_multicast_test.cc @@ -39,9 +39,9 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "net/google::protobuf/contrib/fixtures/proto-fixture-repository.h" diff --git a/tests/forwarding/l3_multicast_test.h b/tests/forwarding/l3_multicast_test.h index 11031bf32..4196fbc82 100644 --- a/tests/forwarding/l3_multicast_test.h +++ b/tests/forwarding/l3_multicast_test.h @@ -20,7 +20,7 @@ #include "dvaas/dataplane_validation.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "thinkit/mirror_testbed_fixture.h" diff --git a/tests/forwarding/match_action_coverage_test.cc b/tests/forwarding/match_action_coverage_test.cc index 6e5e7b956..b7ca225c7 100644 --- a/tests/forwarding/match_action_coverage_test.cc +++ b/tests/forwarding/match_action_coverage_test.cc @@ -23,11 +23,11 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/version.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/version.h" #include "lib/gnmi/gnmi_helper.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/forwarding/mirror_blackbox_test_fixture.cc b/tests/forwarding/mirror_blackbox_test_fixture.cc index e8fdb4928..837acfecf 100644 --- a/tests/forwarding/mirror_blackbox_test_fixture.cc +++ b/tests/forwarding/mirror_blackbox_test_fixture.cc @@ -1,7 +1,7 @@ #include "tests/forwarding/mirror_blackbox_test_fixture.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "proto/gnmi/gnmi.pb.h" #include "sai_p4/instantiations/google/sai_p4info.h" #include "sai_p4/instantiations/google/sai_pd.pb.h" diff --git a/tests/forwarding/multicast_fallback_group_test.cc b/tests/forwarding/multicast_fallback_group_test.cc index 067aca712..cbca737b5 100644 --- a/tests/forwarding/multicast_fallback_group_test.cc +++ b/tests/forwarding/multicast_fallback_group_test.cc @@ -39,10 +39,10 @@ #include "dvaas/test_vector.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/forwarding/multistage_hash_test.cc b/tests/forwarding/multistage_hash_test.cc index c3a7c5c52..bb4a73d4c 100644 --- a/tests/forwarding/multistage_hash_test.cc +++ b/tests/forwarding/multistage_hash_test.cc @@ -28,8 +28,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/tests/forwarding/ouroboros_test.cc b/tests/forwarding/ouroboros_test.cc index 7dac6af4c..44136ae25 100644 --- a/tests/forwarding/ouroboros_test.cc +++ b/tests/forwarding/ouroboros_test.cc @@ -34,9 +34,9 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/forwarding/p4info_push_test.cc b/tests/forwarding/p4info_push_test.cc index 5a739286d..5764e6d3f 100644 --- a/tests/forwarding/p4info_push_test.cc +++ b/tests/forwarding/p4info_push_test.cc @@ -19,8 +19,8 @@ #include "absl/log/log.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/tests/forwarding/smoke_test.cc b/tests/forwarding/smoke_test.cc index a48d66a92..3017d28d1 100644 --- a/tests/forwarding/smoke_test.cc +++ b/tests/forwarding/smoke_test.cc @@ -30,10 +30,10 @@ #include "google/protobuf/util/message_differencer.h" #include "grpcpp/client_context.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/forwarding/test_data.cc b/tests/forwarding/test_data.cc index 54f54c71c..57bb4ee1b 100644 --- a/tests/forwarding/test_data.cc +++ b/tests/forwarding/test_data.cc @@ -17,7 +17,7 @@ #include #include "absl/strings/str_format.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "sai_p4/instantiations/google/sai_pd.pb.h" namespace sai_pd { diff --git a/tests/forwarding/tor_protocol_test.cc b/tests/forwarding/tor_protocol_test.cc index 8f0c47443..9d95c3d28 100644 --- a/tests/forwarding/tor_protocol_test.cc +++ b/tests/forwarding/tor_protocol_test.cc @@ -12,8 +12,8 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/tests/forwarding/tunnel_decap_test.cc b/tests/forwarding/tunnel_decap_test.cc index 35af31680..01509ce65 100644 --- a/tests/forwarding/tunnel_decap_test.cc +++ b/tests/forwarding/tunnel_decap_test.cc @@ -28,9 +28,9 @@ #include "dvaas/validation_result.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "lib/gnmi/gnmi_helper.h" #include "net/google::protobuf/contrib/fixtures/proto-fixture-repository.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/forwarding/util.cc b/tests/forwarding/util.cc index ef52825f3..6dea477d4 100644 --- a/tests/forwarding/util.cc +++ b/tests/forwarding/util.cc @@ -21,7 +21,7 @@ #include "absl/status/status.h" #include "absl/time/clock.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "sai_p4/tools/packetio_tools.h" diff --git a/tests/forwarding/watch_port_test.cc b/tests/forwarding/watch_port_test.cc index fc20dd526..c3f59b319 100644 --- a/tests/forwarding/watch_port_test.cc +++ b/tests/forwarding/watch_port_test.cc @@ -38,10 +38,12 @@ #include "absl/time/time.h" #include "absl/types/span.h" #include "dvaas/test_vector.pb.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/gnmi/BUILD.bazel b/tests/gnmi/BUILD.bazel index e2d25577d..fdcef6c69 100644 --- a/tests/gnmi/BUILD.bazel +++ b/tests/gnmi/BUILD.bazel @@ -23,7 +23,6 @@ cc_library( srcs = ["util.cc"], hdrs = ["util.h"], deps = [ - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//tests:thinkit_gnmi_subscribe_tests", "//thinkit:control_device", @@ -34,6 +33,7 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], alwayslink = True, ) @@ -45,8 +45,6 @@ cc_library( hdrs = ["link_flap_tests.h"], deps = [ ":util", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//thinkit:control_device", "//thinkit:generic_testbed", @@ -63,6 +61,8 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -74,8 +74,6 @@ cc_library( hdrs = ["link_flap_tests.h"], deps = [ ":util", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//thinkit:control_device", "//thinkit:generic_testbed", @@ -88,6 +86,8 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -98,9 +98,6 @@ cc_library( srcs = ["ethcounter_ixia_test.cc"], hdrs = ["ethcounter_ixia_test.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib/gnmi:gnmi_helper", "//p4_pdpi:ir", @@ -125,6 +122,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -135,10 +135,6 @@ cc_library( srcs = ["counter_timestamp_test.cc"], hdrs = ["ethcounter_ixia_test.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib:ixia_helper_cc_proto", "//p4_pdpi:p4_runtime_session", @@ -159,6 +155,10 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) diff --git a/tests/gnmi/counter_timestamp_test.cc b/tests/gnmi/counter_timestamp_test.cc index 71897740b..1b8c0dd35 100644 --- a/tests/gnmi/counter_timestamp_test.cc +++ b/tests/gnmi/counter_timestamp_test.cc @@ -11,10 +11,10 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/ixia_helper.h" #include "lib/ixia_helper.pb.h" #include "p4_pdpi/netaddr/mac_address.h" diff --git a/tests/gnmi/ethcounter_ixia_test.cc b/tests/gnmi/ethcounter_ixia_test.cc index d3d2e1e1b..cba4df9d4 100644 --- a/tests/gnmi/ethcounter_ixia_test.cc +++ b/tests/gnmi/ethcounter_ixia_test.cc @@ -45,10 +45,10 @@ #include "absl/types/optional.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/ixia_helper.h" diff --git a/tests/gnmi/host_link_flap_tests.cc b/tests/gnmi/host_link_flap_tests.cc index 0904420ba..9bde49f91 100644 --- a/tests/gnmi/host_link_flap_tests.cc +++ b/tests/gnmi/host_link_flap_tests.cc @@ -21,8 +21,8 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "tests/gnmi/link_flap_tests.h" #include "tests/gnmi/util.h" diff --git a/tests/gnmi/link_flap_tests.cc b/tests/gnmi/link_flap_tests.cc index bfc93f0ea..3e33eba88 100644 --- a/tests/gnmi/link_flap_tests.cc +++ b/tests/gnmi/link_flap_tests.cc @@ -30,9 +30,9 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "tests/gnmi/util.h" diff --git a/tests/gnmi/util.cc b/tests/gnmi/util.cc index 2a852fa47..2a0a1c2ba 100644 --- a/tests/gnmi/util.cc +++ b/tests/gnmi/util.cc @@ -23,7 +23,7 @@ #include "absl/strings/string_view.h" #include "absl/time/clock.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "tests/thinkit_util.h" diff --git a/tests/gnoi/BUILD.bazel b/tests/gnoi/BUILD.bazel index ac6ec7ad2..ac2b25471 100644 --- a/tests/gnoi/BUILD.bazel +++ b/tests/gnoi/BUILD.bazel @@ -27,9 +27,6 @@ cc_library( "bert_tests.h", ], deps = [ - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/validator:validator_lib", "//tests:thinkit_gnmi_interface_util", @@ -58,6 +55,9 @@ cc_library( "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -72,7 +72,6 @@ cc_library( "factory_reset_test.h", ], deps = [ - "//gutil/gutil:status_matchers", "//lib/validator:validator_lib", "//thinkit:ssh_client", "//thinkit:switch", @@ -85,6 +84,7 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) diff --git a/tests/gnoi/bert_tests.cc b/tests/gnoi/bert_tests.cc index ba809f95d..547d2389b 100644 --- a/tests/gnoi/bert_tests.cc +++ b/tests/gnoi/bert_tests.cc @@ -44,9 +44,9 @@ #include "google/protobuf/util/message_differencer.h" #include "grpcpp/client_context.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/validator/validator_lib.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/tests/gnoi/bert_tests.h b/tests/gnoi/bert_tests.h index b9d200c70..c10f1d983 100644 --- a/tests/gnoi/bert_tests.h +++ b/tests/gnoi/bert_tests.h @@ -29,8 +29,8 @@ #include "diag/diag.grpc.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "thinkit/control_device.h" diff --git a/tests/gnoi/factory_reset_test.cc b/tests/gnoi/factory_reset_test.cc index de07bfccc..90d5d94ee 100644 --- a/tests/gnoi/factory_reset_test.cc +++ b/tests/gnoi/factory_reset_test.cc @@ -29,8 +29,8 @@ #include "grpcpp/client_context.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "lib/validator/validator_lib.h" #include "thinkit/ssh_client.h" #include "thinkit/switch.h" diff --git a/tests/integration/system/BUILD.bazel b/tests/integration/system/BUILD.bazel index b239f1d70..33d7f4a89 100644 --- a/tests/integration/system/BUILD.bazel +++ b/tests/integration/system/BUILD.bazel @@ -24,8 +24,6 @@ cc_library( hdrs = ["random_blackbox_events_tests.h"], data = ["gnmi_subscription_request.textproto"], deps = [ - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/basic_traffic", "//lib/gnmi:gnmi_helper", "//lib/p4rt:p4rt_port", @@ -62,6 +60,8 @@ cc_library( "@com_google_absl//absl/types:span", "@com_google_googleapis//google/rpc:code_cc_proto", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -72,9 +72,6 @@ cc_library( srcs = ["packet_forwarding_tests.cc"], hdrs = ["packet_forwarding_tests.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/basic_traffic", "//lib/basic_traffic:basic_p4rt_util", "//lib/gnmi:gnmi_helper", @@ -105,6 +102,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -115,11 +115,6 @@ cc_library( srcs = ["linerate_traffic_test.cc"], hdrs = ["linerate_traffic_test.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/utils:generic_testbed_utils", "//lib/utils:json_utils", @@ -159,6 +154,11 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -169,8 +169,6 @@ cc_library( srcs = ["control_device_reboot_test.cc"], hdrs = ["control_device_reboot_test.h"], deps = [ - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//thinkit:control_device", "//thinkit:generic_testbed", "//thinkit:generic_testbed_fixture", @@ -181,6 +179,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -195,10 +195,6 @@ cc_library( "alpm_miss_counter_tests.h", ], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/validator:validator_lib", "//p4_pdpi:p4_runtime_session", @@ -222,6 +218,10 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = 1, ) diff --git a/tests/integration/system/alpm_miss_counter_tests.cc b/tests/integration/system/alpm_miss_counter_tests.cc index d2a595250..2b527b94d 100644 --- a/tests/integration/system/alpm_miss_counter_tests.cc +++ b/tests/integration/system/alpm_miss_counter_tests.cc @@ -36,10 +36,10 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/validator/validator_lib.h" #include "p4_pdpi/netaddr/mac_address.h" diff --git a/tests/integration/system/alpm_miss_counter_tests.h b/tests/integration/system/alpm_miss_counter_tests.h index b6b9fc885..1996b954d 100644 --- a/tests/integration/system/alpm_miss_counter_tests.h +++ b/tests/integration/system/alpm_miss_counter_tests.h @@ -24,8 +24,8 @@ #include "absl/strings/string_view.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/p4_runtime_session.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "thinkit/generic_testbed.h" diff --git a/tests/integration/system/control_device_reboot_test.cc b/tests/integration/system/control_device_reboot_test.cc index 00aa74cee..bbc5ace4a 100644 --- a/tests/integration/system/control_device_reboot_test.cc +++ b/tests/integration/system/control_device_reboot_test.cc @@ -25,8 +25,8 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "thinkit/control_device.h" #include "thinkit/generic_testbed.h" #include "thinkit/proto/generic_testbed.pb.h" diff --git a/tests/integration/system/linerate_traffic_test.cc b/tests/integration/system/linerate_traffic_test.cc index 87f61f6ef..7ad7c2d97 100644 --- a/tests/integration/system/linerate_traffic_test.cc +++ b/tests/integration/system/linerate_traffic_test.cc @@ -46,11 +46,11 @@ #include "gmock/gmock.h" #include "grpcpp/client_context.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/utils/generic_testbed_utils.h" #include "lib/utils/json_utils.h" diff --git a/tests/integration/system/nsf/BUILD.bazel b/tests/integration/system/nsf/BUILD.bazel index cbab16d9a..85df0d21c 100644 --- a/tests/integration/system/nsf/BUILD.bazel +++ b/tests/integration/system/nsf/BUILD.bazel @@ -25,7 +25,7 @@ cc_library( srcs = ["compare_p4flows.cc"], hdrs = ["compare_p4flows.h"], deps = [ - "//gutil/gutil:status", + "@com_google_gutil//gutil:status", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/log", "@com_google_absl//absl/status", @@ -40,8 +40,8 @@ cc_test( srcs = ["compare_p4flows_test.cc"], deps = [ ":compare_p4flows", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", "@com_github_p4lang_p4runtime//:p4runtime_cc_proto", "@com_google_absl//absl/status", "@com_google_googletest//:gtest_main", @@ -54,9 +54,6 @@ cc_library( srcs = ["util.cc"], hdrs = ["util.h"], deps = [ - "//gutil/gutil:overload", - "//gutil/gutil:status", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//lib/utils:generic_testbed_utils", "//lib/validator:validator_lib", @@ -91,6 +88,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:overload", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:testing", ], ) @@ -103,8 +103,6 @@ cc_library( ":compare_p4flows", ":milestone", ":util", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//tests/integration/system/nsf/interfaces:component_validator", "//tests/integration/system/nsf/interfaces:flow_programmer", @@ -130,6 +128,8 @@ cc_library( "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -153,7 +153,6 @@ cc_library( deps = [ ":compare_p4flows", ":util", - "//gutil/gutil:status_matchers", "//sai_p4/instantiations/google:sai_pd_cc_proto", "//tests/integration/system/nsf/interfaces:component_validator", "//tests/integration/system/nsf/interfaces:flow_programmer", @@ -168,6 +167,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) @@ -179,9 +179,6 @@ cc_library( hdrs = ["nsf_link_flap_test.h"], deps = [ ":util", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//tests/gnmi:util", "//tests/integration/system/nsf/interfaces:flow_programmer", "//tests/integration/system/nsf/interfaces:image_config_params", @@ -199,6 +196,9 @@ cc_library( "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -210,8 +210,6 @@ cc_library( hdrs = ["nsf_dynamic_state_update_test.h"], deps = [ ":util", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/gnmi:gnmi_helper", "//tests/gnmi:util", "//tests/integration/system/nsf/interfaces:testbed", @@ -225,6 +223,8 @@ cc_library( "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -237,7 +237,6 @@ cc_library( deps = [ ":compare_p4flows", ":util", - "//gutil/gutil:status_matchers", "//lib/gnmi:gnmi_helper", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:sai_pd_cc_proto", @@ -256,6 +255,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/time", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], alwayslink = True, ) diff --git a/tests/integration/system/nsf/compare_p4flows.cc b/tests/integration/system/nsf/compare_p4flows.cc index d27ef6b0e..2564bfda7 100644 --- a/tests/integration/system/nsf/compare_p4flows.cc +++ b/tests/integration/system/nsf/compare_p4flows.cc @@ -24,7 +24,7 @@ #include "absl/strings/string_view.h" #include "google/protobuf/message_lite.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" namespace pins_test { diff --git a/tests/integration/system/nsf/compare_p4flows_test.cc b/tests/integration/system/nsf/compare_p4flows_test.cc index bfe2f11c0..1f17fe969 100644 --- a/tests/integration/system/nsf/compare_p4flows_test.cc +++ b/tests/integration/system/nsf/compare_p4flows_test.cc @@ -19,8 +19,8 @@ #include "absl/status/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" namespace pins_test { diff --git a/tests/integration/system/nsf/component_validators/BUILD.bazel b/tests/integration/system/nsf/component_validators/BUILD.bazel index 2d0001bf3..99d51ce9a 100644 --- a/tests/integration/system/nsf/component_validators/BUILD.bazel +++ b/tests/integration/system/nsf/component_validators/BUILD.bazel @@ -29,7 +29,6 @@ cc_library( srcs = ["p4rt_validator.cc"], hdrs = ["p4rt_validator.h"], deps = [ - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//tests/integration/system/nsf:util", "//tests/integration/system/nsf/interfaces:component_validator", @@ -41,6 +40,7 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], ) diff --git a/tests/integration/system/nsf/component_validators/p4rt_validator.cc b/tests/integration/system/nsf/component_validators/p4rt_validator.cc index 0505f1ef6..f023ca9a0 100644 --- a/tests/integration/system/nsf/component_validators/p4rt_validator.cc +++ b/tests/integration/system/nsf/component_validators/p4rt_validator.cc @@ -26,7 +26,7 @@ #include "absl/strings/strip.h" #include "absl/strings/substitute.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "tests/integration/system/nsf/interfaces/testbed.h" #include "tests/integration/system/nsf/util.h" #include "thinkit/ssh_client.h" diff --git a/tests/integration/system/nsf/component_validators/platform_validator.cc b/tests/integration/system/nsf/component_validators/platform_validator.cc index 4556ebc68..118f565ff 100644 --- a/tests/integration/system/nsf/component_validators/platform_validator.cc +++ b/tests/integration/system/nsf/component_validators/platform_validator.cc @@ -31,7 +31,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "glog/logging.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "tests/integration/system/nsf/interfaces/testbed.h" diff --git a/tests/integration/system/nsf/component_validators/swss_validator.cc b/tests/integration/system/nsf/component_validators/swss_validator.cc index 0f6a30811..58f2b6d95 100644 --- a/tests/integration/system/nsf/component_validators/swss_validator.cc +++ b/tests/integration/system/nsf/component_validators/swss_validator.cc @@ -26,7 +26,7 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "tests/integration/system/nsf/interfaces/testbed.h" #include "tests/integration/system/nsf/util.h" #include "thinkit/ssh_client.h" diff --git a/tests/integration/system/nsf/component_validators/xcvrd_validator.cc b/tests/integration/system/nsf/component_validators/xcvrd_validator.cc index 6beab7843..a4c37e628 100644 --- a/tests/integration/system/nsf/component_validators/xcvrd_validator.cc +++ b/tests/integration/system/nsf/component_validators/xcvrd_validator.cc @@ -11,7 +11,7 @@ #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "tests/integration/system/nsf/interfaces/testbed.h" #include "tests/integration/system/nsf/util.h" diff --git a/tests/integration/system/nsf/interfaces/BUILD.bazel b/tests/integration/system/nsf/interfaces/BUILD.bazel index e9b07bc74..21a0ccff9 100644 --- a/tests/integration/system/nsf/interfaces/BUILD.bazel +++ b/tests/integration/system/nsf/interfaces/BUILD.bazel @@ -24,13 +24,13 @@ cc_library( testonly = True, hdrs = ["testbed.h"], deps = [ - "//gutil/gutil:overload", "//thinkit:generic_testbed", "//thinkit:generic_testbed_fixture", "//thinkit:mirror_testbed", "//thinkit:mirror_testbed_fixture", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", + "@com_google_gutil//gutil:overload", ], ) diff --git a/tests/integration/system/nsf/interfaces/testbed.h b/tests/integration/system/nsf/interfaces/testbed.h index 8bb7a5393..247c128d1 100644 --- a/tests/integration/system/nsf/interfaces/testbed.h +++ b/tests/integration/system/nsf/interfaces/testbed.h @@ -6,7 +6,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/overload.h" +#include "gutil/overload.h" #include "thinkit/generic_testbed.h" #include "thinkit/generic_testbed_fixture.h" #include "thinkit/mirror_testbed.h" diff --git a/tests/integration/system/nsf/nsf_acl_flow_coverage_test.cc b/tests/integration/system/nsf/nsf_acl_flow_coverage_test.cc index 6a7a05449..73a1a2bba 100644 --- a/tests/integration/system/nsf/nsf_acl_flow_coverage_test.cc +++ b/tests/integration/system/nsf/nsf_acl_flow_coverage_test.cc @@ -20,7 +20,7 @@ #include "absl/strings/str_cat.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "sai_p4/instantiations/google/sai_pd.pb.h" #include "tests/integration/system/nsf/compare_p4flows.h" #include "tests/integration/system/nsf/interfaces/image_config_params.h" diff --git a/tests/integration/system/nsf/nsf_concurrent_config_push_flow_programming_test.cc b/tests/integration/system/nsf/nsf_concurrent_config_push_flow_programming_test.cc index 221c5397d..3cb8f5296 100644 --- a/tests/integration/system/nsf/nsf_concurrent_config_push_flow_programming_test.cc +++ b/tests/integration/system/nsf/nsf_concurrent_config_push_flow_programming_test.cc @@ -29,8 +29,8 @@ #include "google/protobuf/message.h" #include "grpcpp/client_context.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "p4_pdpi/ir.pb.h" #include "sai_p4/instantiations/google/sai_pd.pb.h" diff --git a/tests/integration/system/nsf/nsf_dynamic_state_update_test.cc b/tests/integration/system/nsf/nsf_dynamic_state_update_test.cc index 0a9b22478..6936e0775 100644 --- a/tests/integration/system/nsf/nsf_dynamic_state_update_test.cc +++ b/tests/integration/system/nsf/nsf_dynamic_state_update_test.cc @@ -25,8 +25,8 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "tests/integration/system/nsf/interfaces/testbed.h" #include "tests/integration/system/nsf/util.h" diff --git a/tests/integration/system/nsf/nsf_link_flap_test.cc b/tests/integration/system/nsf/nsf_link_flap_test.cc index 5bef4a2af..6461432cc 100644 --- a/tests/integration/system/nsf/nsf_link_flap_test.cc +++ b/tests/integration/system/nsf/nsf_link_flap_test.cc @@ -28,9 +28,9 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // NOLINT: Need to add status_matchers.h for using `ASSERT_OK` in upstream code. -#include "gutil/gutil/testing.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" // NOLINT: Need to add status_matchers.h for using `ASSERT_OK` in upstream code. +#include "gutil/testing.h" #include "proto/gnmi/gnmi.grpc.pb.h" #include "tests/gnmi/util.h" #include "tests/integration/system/nsf/interfaces/flow_programmer.h" diff --git a/tests/integration/system/nsf/traffic_helpers/BUILD.bazel b/tests/integration/system/nsf/traffic_helpers/BUILD.bazel index 6be1d9e19..d72098e47 100644 --- a/tests/integration/system/nsf/traffic_helpers/BUILD.bazel +++ b/tests/integration/system/nsf/traffic_helpers/BUILD.bazel @@ -25,7 +25,6 @@ cc_library( srcs = ["otg_helper.cc"], hdrs = ["otg_helper.h"], deps = [ - "//gutil/gutil:status", "//lib/utils:generic_testbed_utils", "//lib/validator:validator_lib", "//tests/integration/system/nsf/interfaces:testbed", @@ -39,5 +38,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", + "@com_google_gutil//gutil:status", ], ) diff --git a/tests/integration/system/nsf/traffic_helpers/otg_helper.cc b/tests/integration/system/nsf/traffic_helpers/otg_helper.cc index c9b2eae61..9a2c1c465 100644 --- a/tests/integration/system/nsf/traffic_helpers/otg_helper.cc +++ b/tests/integration/system/nsf/traffic_helpers/otg_helper.cc @@ -31,7 +31,7 @@ #include "artifacts/otg.grpc.pb.h" #include "artifacts/otg.pb.h" #include "grpcpp/client_context.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/utils/generic_testbed_utils.h" #include "lib/validator/validator_lib.h" #include "tests/integration/system/nsf/interfaces/testbed.h" diff --git a/tests/integration/system/nsf/upgrade_test.cc b/tests/integration/system/nsf/upgrade_test.cc index 49a181e96..02355cddc 100644 --- a/tests/integration/system/nsf/upgrade_test.cc +++ b/tests/integration/system/nsf/upgrade_test.cc @@ -33,8 +33,8 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" #include "lib/gnmi/gnmi_helper.h" #include "p4/config/v1/p4info.pb.h" #include "p4/v1/p4runtime.pb.h" diff --git a/tests/integration/system/nsf/util.cc b/tests/integration/system/nsf/util.cc index 78bff9e31..ba8df0aef 100644 --- a/tests/integration/system/nsf/util.cc +++ b/tests/integration/system/nsf/util.cc @@ -38,9 +38,9 @@ #include "absl/types/span.h" #include "google/protobuf/util/message_differencer.h" #include "grpcpp/client_context.h" -#include "gutil/gutil/overload.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/overload.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/utils/generic_testbed_utils.h" #include "lib/validator/validator_lib.h" diff --git a/tests/integration/system/packet_forwarding_tests.cc b/tests/integration/system/packet_forwarding_tests.cc index a7eec39ba..2b0f924d3 100644 --- a/tests/integration/system/packet_forwarding_tests.cc +++ b/tests/integration/system/packet_forwarding_tests.cc @@ -36,9 +36,9 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/basic_traffic/basic_p4rt_util.h" #include "lib/basic_traffic/basic_traffic.h" #include "lib/gnmi/gnmi_helper.h" diff --git a/tests/integration/system/random_blackbox_events_tests.cc b/tests/integration/system/random_blackbox_events_tests.cc index 6ae6121d5..9905793be 100644 --- a/tests/integration/system/random_blackbox_events_tests.cc +++ b/tests/integration/system/random_blackbox_events_tests.cc @@ -35,8 +35,8 @@ #include "grpcpp/impl/call_op_set.h" #include "grpcpp/support/sync_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/basic_traffic/basic_traffic.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" diff --git a/tests/lib/BUILD.bazel b/tests/lib/BUILD.bazel index b0dc0080e..df1a07344 100644 --- a/tests/lib/BUILD.bazel +++ b/tests/lib/BUILD.bazel @@ -25,13 +25,13 @@ cc_library( srcs = ["p4info_helper.cc"], hdrs = ["p4info_helper.h"], deps = [ - "//gutil/gutil:collections", "//p4_pdpi:ir_cc_proto", "//p4_pdpi:p4_runtime_session", "//thinkit:switch", "@com_github_p4lang_p4runtime//:p4info_cc_proto", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", + "@com_google_gutil//gutil:collections", ], ) @@ -41,8 +41,6 @@ cc_library( srcs = ["p4rt_fixed_table_programming_helper.cc"], hdrs = ["p4rt_fixed_table_programming_helper.h"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google/test_tools:test_entries", @@ -52,6 +50,8 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -60,9 +60,6 @@ cc_test( srcs = ["p4rt_fixed_table_programming_helper_test.cc"], deps = [ ":p4rt_fixed_table_programming_helper", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:instantiations", @@ -73,6 +70,9 @@ cc_test( "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -92,12 +92,12 @@ cc_test( srcs = ["common_ir_table_entries_test.cc"], deps = [ ":common_ir_table_entries", - "//gutil/gutil:status_matchers", "//p4_pdpi:ir", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:instantiations", "//sai_p4/instantiations/google:sai_p4info_cc", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:status_matchers", ], ) @@ -107,10 +107,6 @@ cc_library( srcs = ["switch_test_setup_helpers.cc"], hdrs = ["switch_test_setup_helpers.h"], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:test_artifact_writer", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/p4rt:p4rt_port", @@ -136,7 +132,10 @@ cc_library( "@com_google_absl//absl/types:span", "@com_google_absl//absl/flags:parse", "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:test_artifact_writer", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -148,9 +147,6 @@ cc_test( linkstatic = True, deps = [ ":switch_test_setup_helpers", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/p4rt:p4rt_port", "//p4_pdpi:ir_cc_proto", "//sai_p4/instantiations/google:instantiations", @@ -159,6 +155,9 @@ cc_test( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/types:span", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) @@ -191,8 +190,6 @@ cc_library( srcs = ["packet_generator.cc"], hdrs = ["packet_generator.h"], deps = [ - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/netaddr:ipv4_address", "//p4_pdpi/netaddr:ipv6_address", "//p4_pdpi/netaddr:mac_address", @@ -207,6 +204,8 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -216,13 +215,13 @@ cc_test( shard_count = 4, deps = [ ":packet_generator", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status_matchers", "//p4_pdpi/packetlib", "//p4_pdpi/packetlib:packetlib_cc_proto", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status_matchers", ], ) diff --git a/tests/lib/common_ir_table_entries_test.cc b/tests/lib/common_ir_table_entries_test.cc index dac3bb21b..790b36970 100644 --- a/tests/lib/common_ir_table_entries_test.cc +++ b/tests/lib/common_ir_table_entries_test.cc @@ -2,7 +2,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep +#include "gutil/status_matchers.h" // IWYU pragma: keep #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/tests/lib/p4info_helper.cc b/tests/lib/p4info_helper.cc index 7053247da..7012d5e82 100644 --- a/tests/lib/p4info_helper.cc +++ b/tests/lib/p4info_helper.cc @@ -17,8 +17,8 @@ #include #include "absl/status/statusor.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" #include "thinkit/switch.h" diff --git a/tests/lib/p4rt_fixed_table_programming_helper.cc b/tests/lib/p4rt_fixed_table_programming_helper.cc index c138e7c57..ccccb5865 100644 --- a/tests/lib/p4rt_fixed_table_programming_helper.cc +++ b/tests/lib/p4rt_fixed_table_programming_helper.cc @@ -26,8 +26,8 @@ #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" #include "absl/types/span.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/tests/lib/p4rt_fixed_table_programming_helper_test.cc b/tests/lib/p4rt_fixed_table_programming_helper_test.cc index e8d731196..498e8324c 100644 --- a/tests/lib/p4rt_fixed_table_programming_helper_test.cc +++ b/tests/lib/p4rt_fixed_table_programming_helper_test.cc @@ -28,9 +28,9 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4/v1/p4runtime.pb.h" #include "p4_pdpi/ir.h" #include "p4_pdpi/ir.pb.h" diff --git a/tests/lib/packet_generator.cc b/tests/lib/packet_generator.cc index bcafe6704..6cfd36493 100644 --- a/tests/lib/packet_generator.cc +++ b/tests/lib/packet_generator.cc @@ -34,8 +34,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/netaddr/ipv4_address.h" #include "p4_pdpi/netaddr/ipv6_address.h" #include "p4_pdpi/netaddr/mac_address.h" diff --git a/tests/lib/packet_generator.h b/tests/lib/packet_generator.h index d4622259e..eafa408cf 100644 --- a/tests/lib/packet_generator.h +++ b/tests/lib/packet_generator.h @@ -26,8 +26,8 @@ #include "absl/container/btree_set.h" #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep -#include "gutil/gutil/status.h" +#include "gutil/status.h" // IWYU pragma: keep +#include "gutil/status.h" #include "p4_pdpi/packetlib/packetlib.pb.h" // Helper library to hold a collection of functions to define a test diff --git a/tests/lib/packet_generator_test.cc b/tests/lib/packet_generator_test.cc index 674eb01e4..9b47e767f 100644 --- a/tests/lib/packet_generator_test.cc +++ b/tests/lib/packet_generator_test.cc @@ -32,8 +32,8 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/packetlib/packetlib.h" #include "p4_pdpi/packetlib/packetlib.pb.h" diff --git a/tests/lib/packet_injector_test.cc b/tests/lib/packet_injector_test.cc index dd49b1bcb..b06813cb6 100644 --- a/tests/lib/packet_injector_test.cc +++ b/tests/lib/packet_injector_test.cc @@ -22,7 +22,7 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.pb.h" #include "p4_pdpi/p4_runtime_session.h" diff --git a/tests/lib/switch_test_setup_helpers.cc b/tests/lib/switch_test_setup_helpers.cc index 04c76bbe1..4389c7adf 100644 --- a/tests/lib/switch_test_setup_helpers.cc +++ b/tests/lib/switch_test_setup_helpers.cc @@ -39,11 +39,11 @@ #include "absl/types/span.h" #include "google/protobuf/repeated_ptr_field.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" #include "google/protobuf/repeated_ptr_field.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/test_artifact_writer.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/p4rt/p4rt_port.h" diff --git a/tests/lib/switch_test_setup_helpers_golden_test_runner.cc b/tests/lib/switch_test_setup_helpers_golden_test_runner.cc index 5681d4823..fdfffaae0 100644 --- a/tests/lib/switch_test_setup_helpers_golden_test_runner.cc +++ b/tests/lib/switch_test_setup_helpers_golden_test_runner.cc @@ -22,9 +22,9 @@ #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "google/protobuf/util/message_differencer.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/p4rt/p4rt_port.h" #include "p4_pdpi/ir.pb.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/tests/lib/switch_test_setup_helpers_test.cc b/tests/lib/switch_test_setup_helpers_test.cc index 0313eee15..53792c350 100644 --- a/tests/lib/switch_test_setup_helpers_test.cc +++ b/tests/lib/switch_test_setup_helpers_test.cc @@ -27,9 +27,9 @@ #include "gmock/gmock.h" #include "grpcpp/test/mock_stream.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/testing.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/p4rt/p4rt_port.h" diff --git a/tests/mtu_tests/BUILD.bazel b/tests/mtu_tests/BUILD.bazel index 3186dd573..24ba10f24 100644 --- a/tests/mtu_tests/BUILD.bazel +++ b/tests/mtu_tests/BUILD.bazel @@ -29,10 +29,6 @@ cc_library( "mtu_tests.h", ], deps = [ - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib/basic_traffic", "//lib/basic_traffic:basic_p4rt_util", "//lib/gnmi:gnmi_helper", @@ -64,6 +60,10 @@ cc_library( "@com_google_absl//absl/synchronization", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) diff --git a/tests/mtu_tests/mtu_tests.cc b/tests/mtu_tests/mtu_tests.cc index ba1ff378b..289ff161f 100644 --- a/tests/mtu_tests/mtu_tests.cc +++ b/tests/mtu_tests/mtu_tests.cc @@ -18,11 +18,11 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/basic_traffic/basic_p4rt_util.h" #include "lib/basic_traffic/basic_traffic.h" #include "lib/gnmi/gnmi_helper.h" diff --git a/tests/packet_capture/packet_capture_test.cc b/tests/packet_capture/packet_capture_test.cc index c06c8685d..fd39bd1b3 100644 --- a/tests/packet_capture/packet_capture_test.cc +++ b/tests/packet_capture/packet_capture_test.cc @@ -39,8 +39,8 @@ #include "gmock/gmock.h" #include "google/protobuf/descriptor.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "net/google::protobuf/contrib/fixtures/proto-fixture-repository.h" diff --git a/tests/packet_capture/packet_capture_test.h b/tests/packet_capture/packet_capture_test.h index ff80b54f1..690fb5e0a 100644 --- a/tests/packet_capture/packet_capture_test.h +++ b/tests/packet_capture/packet_capture_test.h @@ -22,7 +22,7 @@ #include "dvaas/dataplane_validation.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "sai_p4/instantiations/google/instantiations.h" #include "thinkit/mirror_testbed.h" diff --git a/tests/packet_capture/packet_capture_test_util.cc b/tests/packet_capture/packet_capture_test_util.cc index 6e6f562f8..c5e4e67de 100644 --- a/tests/packet_capture/packet_capture_test_util.cc +++ b/tests/packet_capture/packet_capture_test_util.cc @@ -13,7 +13,8 @@ #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "gutil/gutil/status.h" +#include "glog/logging.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "platforms/networking/gpins/testing/lib/test_util.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/tests/qos/BUILD.bazel b/tests/qos/BUILD.bazel index bc169e5f0..5945fa7fe 100644 --- a/tests/qos/BUILD.bazel +++ b/tests/qos/BUILD.bazel @@ -33,13 +33,6 @@ cc_library( ":gnmi_parsers", ":packet_in_receiver", ":qos_test_util", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:proto_matchers", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", - "//gutil/gutil:version", "//lib:ixia_helper", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", @@ -89,6 +82,13 @@ cc_library( "@com_google_absl//absl/types:variant", "@com_google_googletest//:gtest", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:proto_matchers", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", + "@com_google_gutil//gutil:version", ], alwayslink = True, ) @@ -105,10 +105,6 @@ cc_library( deps = [ ":packet_in_receiver", ":qos_test_util", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", @@ -148,6 +144,10 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:optional", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -159,10 +159,6 @@ cc_library( hdrs = ["pfc_test.h"], deps = [ ":qos_test_util", - "//gutil/gutil:collections", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib/gnmi:gnmi_helper", "//p4_pdpi:p4_runtime_session", @@ -187,6 +183,10 @@ cc_library( "@com_google_absl//absl/strings:string_view", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -199,11 +199,6 @@ cc_library( deps = [ ":packet_in_receiver", ":qos_test_util", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib:ixia_helper_cc_proto", "//lib/gnmi:gnmi_helper", @@ -247,6 +242,11 @@ cc_library( "@com_google_absl//absl/types:optional", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -256,7 +256,6 @@ cc_library( srcs = ["gnmi_parsers.cc"], hdrs = ["gnmi_parsers.h"], deps = [ - "//gutil/gutil:proto", "//lib/gnmi:openconfig_cc_proto", "//p4_pdpi/netaddr:ipv4_address", "//p4_pdpi/netaddr:ipv6_address", @@ -264,6 +263,7 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", + "@com_google_gutil//gutil:proto", ], ) @@ -274,13 +274,13 @@ cc_test( linkstatic = True, deps = [ ":gnmi_parsers", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//p4_pdpi/internal:ordered_map", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) @@ -297,9 +297,6 @@ cc_library( hdrs = ["qos_test_util.h"], deps = [ ":gnmi_parsers", - "//gutil/gutil:collections", - "//gutil/gutil:proto", - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//lib/gnmi:openconfig_cc_proto", "//lib/utils:json_utils", @@ -318,6 +315,9 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_protobuf//:protobuf", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:proto", + "@com_google_gutil//gutil:status", ], ) diff --git a/tests/qos/cpu_qos_test.cc b/tests/qos/cpu_qos_test.cc index 86f1f6933..771adbd2b 100644 --- a/tests/qos/cpu_qos_test.cc +++ b/tests/qos/cpu_qos_test.cc @@ -50,13 +50,13 @@ #include "gmock/gmock.h" #include "google/protobuf/util/json_util.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" -#include "gutil/gutil/version.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" +#include "gutil/version.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/ixia_helper.h" diff --git a/tests/qos/cpu_qos_test.h b/tests/qos/cpu_qos_test.h index fd0d11402..b72a258be 100644 --- a/tests/qos/cpu_qos_test.h +++ b/tests/qos/cpu_qos_test.h @@ -25,8 +25,8 @@ #include "absl/strings/match.h" #include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "p4_pdpi/netaddr/mac_address.h" #include "p4_pdpi/packetlib/packetlib.pb.h" #include "sai_p4/instantiations/google/instantiations.h" diff --git a/tests/qos/frontpanel_qos_test.cc b/tests/qos/frontpanel_qos_test.cc index fea3410f2..9a8724386 100644 --- a/tests/qos/frontpanel_qos_test.cc +++ b/tests/qos/frontpanel_qos_test.cc @@ -46,11 +46,11 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/ixia_helper.h" #include "lib/ixia_helper.pb.h" diff --git a/tests/qos/gnmi_parsers.cc b/tests/qos/gnmi_parsers.cc index bea2a5f41..ec8d8cc18 100644 --- a/tests/qos/gnmi_parsers.cc +++ b/tests/qos/gnmi_parsers.cc @@ -8,8 +8,8 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "lib/gnmi/openconfig.pb.h" #include "p4_pdpi/netaddr/ipv4_address.h" #include "p4_pdpi/netaddr/ipv6_address.h" diff --git a/tests/qos/gnmi_parsers_test_runner.cc b/tests/qos/gnmi_parsers_test_runner.cc index d3321c266..62b40c222 100644 --- a/tests/qos/gnmi_parsers_test_runner.cc +++ b/tests/qos/gnmi_parsers_test_runner.cc @@ -10,8 +10,8 @@ #include "absl/strings/str_join.h" #include "absl/strings/string_view.h" #include "google/protobuf/message.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "p4_pdpi/internal/ordered_map.h" #include "tests/qos/gnmi_parsers.h" diff --git a/tests/qos/pfc_test.cc b/tests/qos/pfc_test.cc index 23daaee6c..f2f78c31d 100644 --- a/tests/qos/pfc_test.cc +++ b/tests/qos/pfc_test.cc @@ -34,11 +34,11 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" // IWYU pragma: keep to avoid ClangTidy complaining about this. -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" // IWYU pragma: keep to avoid ClangTidy complaining about this. -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" // IWYU pragma: keep to avoid ClangTidy complaining about this. +#include "gutil/status.h" +#include "gutil/status_matchers.h" // IWYU pragma: keep to avoid ClangTidy complaining about this. +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/ixia_helper.h" #include "p4_pdpi/netaddr/ipv4_address.h" diff --git a/tests/qos/punt_qos_test.cc b/tests/qos/punt_qos_test.cc index b27207638..e1518f4aa 100644 --- a/tests/qos/punt_qos_test.cc +++ b/tests/qos/punt_qos_test.cc @@ -37,10 +37,10 @@ #include "absl/types/optional.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" #include "lib/ixia_helper.h" diff --git a/tests/qos/qos_test_util.cc b/tests/qos/qos_test_util.cc index a79f3032a..cc7592836 100644 --- a/tests/qos/qos_test_util.cc +++ b/tests/qos/qos_test_util.cc @@ -30,9 +30,9 @@ #include "absl/time/clock.h" #include "absl/time/time.h" #include "google/protobuf/util/json_util.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/proto.h" -#include "gutil/gutil/status.h" +#include "gutil/collections.h" +#include "gutil/proto.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/gnmi/openconfig.pb.h" diff --git a/tests/sflow/BUILD.bazel b/tests/sflow/BUILD.bazel index 1354f1559..278b88211 100644 --- a/tests/sflow/BUILD.bazel +++ b/tests/sflow/BUILD.bazel @@ -25,9 +25,6 @@ cc_library( deps = [ ":sflow_breakout_test", ":sflow_util", - "//gutil/gutil:collections", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", "//lib:ixia_helper", "//lib/gnmi:gnmi_helper", "//lib/utils:json_utils", @@ -76,6 +73,9 @@ cc_library( "@com_google_absl//absl/time", "@com_google_absl//absl/types:span", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:collections", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], alwayslink = True, ) @@ -115,7 +115,6 @@ cc_library( hdrs = ["sflow_breakout_test.h"], deps = [ ":sflow_util", - "//gutil/gutil:status", "//lib/gnmi:gnmi_helper", "//lib/validator:validator_lib", "//tests:thinkit_gnmi_interface_util", @@ -134,5 +133,7 @@ cc_library( "@com_google_absl//absl/strings:str_format", "@com_google_absl//absl/time", "@com_google_googletest//:gtest", + "@com_google_gutil//gutil:status", ], ) + diff --git a/tests/sflow/sflow_breakout_test.cc b/tests/sflow/sflow_breakout_test.cc index 0fbe76a12..8c2fab0e9 100644 --- a/tests/sflow/sflow_breakout_test.cc +++ b/tests/sflow/sflow_breakout_test.cc @@ -15,7 +15,7 @@ #include "absl/time/time.h" #include "grpcpp/client_context.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/validator/validator_lib.h" #include "p4/config/v1/p4info.pb.h" diff --git a/tests/sflow/sflow_test.cc b/tests/sflow/sflow_test.cc index 3f30ec566..e0849261d 100644 --- a/tests/sflow/sflow_test.cc +++ b/tests/sflow/sflow_test.cc @@ -46,10 +46,10 @@ #include "absl/types/span.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "lib/gnmi/gnmi_helper.h" #include "lib/ixia_helper.h" #include "lib/utils/json_utils.h" diff --git a/tests/sflow/sflow_util.cc b/tests/sflow/sflow_util.cc index 6a10a888d..8e1e747f3 100644 --- a/tests/sflow/sflow_util.cc +++ b/tests/sflow/sflow_util.cc @@ -35,7 +35,7 @@ #include "absl/strings/substitute.h" #include "absl/time/time.h" #include "absl/types/span.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/utils/json_utils.h" diff --git a/tests/sflow/sflow_util_test.cc b/tests/sflow/sflow_util_test.cc index f8040cd6a..48796066b 100644 --- a/tests/sflow/sflow_util_test.cc +++ b/tests/sflow/sflow_util_test.cc @@ -25,8 +25,8 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "net/google::protobuf/contrib/fixtures/proto-fixture-repository.h" #include "proto/gnmi/gnmi_mock.grpc.pb.h" #include "thinkit/mock_ssh_client.h" diff --git a/tests/thinkit_gnmi_interface_tests.cc b/tests/thinkit_gnmi_interface_tests.cc index 4ea95cbaf..2e78f7c7e 100644 --- a/tests/thinkit_gnmi_interface_tests.cc +++ b/tests/thinkit_gnmi_interface_tests.cc @@ -35,10 +35,10 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/collections.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/collections.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "p4_pdpi/pd.h" diff --git a/tests/thinkit_gnmi_interface_util.cc b/tests/thinkit_gnmi_interface_util.cc index 874e9a274..d926b2a1a 100644 --- a/tests/thinkit_gnmi_interface_util.cc +++ b/tests/thinkit_gnmi_interface_util.cc @@ -40,7 +40,7 @@ #include "absl/strings/substitute.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" +#include "gutil/status.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/tests/thinkit_gnmi_interface_util.h b/tests/thinkit_gnmi_interface_util.h index ee51d13d1..059e2d56a 100644 --- a/tests/thinkit_gnmi_interface_util.h +++ b/tests/thinkit_gnmi_interface_util.h @@ -24,7 +24,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "gutil/gutil/testing.h" +#include "gutil/testing.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "p4_pdpi/pd.h" diff --git a/tests/thinkit_gnmi_interface_util_tests.cc b/tests/thinkit_gnmi_interface_util_tests.cc index a0809a727..b6467564b 100644 --- a/tests/thinkit_gnmi_interface_util_tests.cc +++ b/tests/thinkit_gnmi_interface_util_tests.cc @@ -26,9 +26,9 @@ #include "gmock/gmock.h" #include "google/protobuf/text_format.h" #include "gtest/gtest.h" -#include "gutil/gutil/proto_matchers.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/proto_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "proto/gnmi/gnmi.grpc.pb.h" diff --git a/tests/thinkit_gnmi_subscribe_tests.cc b/tests/thinkit_gnmi_subscribe_tests.cc index 7fc205ea7..3703d2d23 100644 --- a/tests/thinkit_gnmi_subscribe_tests.cc +++ b/tests/thinkit_gnmi_subscribe_tests.cc @@ -24,7 +24,7 @@ #include "absl/time/time.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "p4/v1/p4runtime.grpc.pb.h" diff --git a/tests/thinkit_sanity_tests.cc b/tests/thinkit_sanity_tests.cc index 4827f0d90..f85efa06c 100644 --- a/tests/thinkit_sanity_tests.cc +++ b/tests/thinkit_sanity_tests.cc @@ -36,8 +36,8 @@ #include "grpcpp/impl/codegen/client_context.h" #include "grpcpp/support/status.h" #include "gtest/gtest.h" -#include "gutil/gutil/status.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status.h" +#include "gutil/status_matchers.h" #include "include/nlohmann/json.hpp" #include "lib/gnmi/gnmi_helper.h" #include "lib/validator/validator_lib.h" diff --git a/thinkit/BUILD.bazel b/thinkit/BUILD.bazel index f929f6823..3ccbb27af 100644 --- a/thinkit/BUILD.bazel +++ b/thinkit/BUILD.bazel @@ -64,7 +64,7 @@ cc_test( srcs = ["switch_test.cc"], deps = [ ":switch", - "//gutil/gutil:status_matchers", + "@com_google_gutil//gutil:status_matchers", "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto", "@com_github_gnoi//cert:cert_cc_grpc_proto", "@com_github_gnoi//diag:diag_cc_grpc_proto", @@ -188,7 +188,7 @@ cc_library( hdrs = ["bazel_test_environment.h"], deps = [ ":test_environment", - "//gutil/gutil:test_artifact_writer", + "@com_google_gutil//gutil:test_artifact_writer", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/status", @@ -210,8 +210,8 @@ cc_test( # This dependency is not technically needed inside Google3, # but is a hack to keep the Copybara rules simple. "@com_google_benchmark//:benchmark", - "//gutil/gutil:status_matchers", - "//gutil/gutil:testing", + "@com_google_gutil//gutil:status_matchers", + "@com_google_gutil//gutil:testing", ], ) diff --git a/thinkit/bazel_test_environment.cc b/thinkit/bazel_test_environment.cc index e17d6b8ca..ba7d74022 100644 --- a/thinkit/bazel_test_environment.cc +++ b/thinkit/bazel_test_environment.cc @@ -19,7 +19,7 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/test_artifact_writer.h" namespace thinkit { diff --git a/thinkit/bazel_test_environment.h b/thinkit/bazel_test_environment.h index 1ebfdbfda..8b5662459 100644 --- a/thinkit/bazel_test_environment.h +++ b/thinkit/bazel_test_environment.h @@ -27,7 +27,7 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" -#include "gutil/gutil/test_artifact_writer.h" +#include "gutil/test_artifact_writer.h" #include "thinkit/test_environment.h" namespace thinkit { diff --git a/thinkit/bazel_test_environment_test.cc b/thinkit/bazel_test_environment_test.cc index a2f42a109..e45ed8565 100644 --- a/thinkit/bazel_test_environment_test.cc +++ b/thinkit/bazel_test_environment_test.cc @@ -26,8 +26,8 @@ #include "gmock/gmock.h" #include "google/protobuf/wrappers.pb.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" -#include "gutil/gutil/testing.h" +#include "gutil/status_matchers.h" +#include "gutil/testing.h" #include "thinkit/test_environment.h" namespace thinkit { diff --git a/thinkit/switch_test.cc b/thinkit/switch_test.cc index aaf0d4d4c..744969ec4 100644 --- a/thinkit/switch_test.cc +++ b/thinkit/switch_test.cc @@ -23,7 +23,7 @@ #include "factory_reset/factory_reset.grpc.pb.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "gutil/gutil/status_matchers.h" +#include "gutil/status_matchers.h" #include "os/os.grpc.pb.h" #include "p4/v1/p4runtime.grpc.pb.h" #include "proto/gnmi/gnmi.grpc.pb.h"