test_matchers_test.cc
imports xla/tsl/platform/statusor.hC declares a character or byte buffer
SHA-2565320981028f65e761a5d57709e95ce69aaa22e48ec756dd040e6e8cc6587ef5e
MaleculeH(Db)Md(In)
Evidence
1/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is …
11:42… IND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16#include "tensorflow/compiler/mlir/tf2xla/internal/test_matchers.h"
17
18#include <cstdint>
19#include <memory>
20
21#include <gmock/gmock.h>
22#include <gtest/gtest.h>
23#include "absl/status/status.h"
24#include "absl/status/statusor.h"
25#include "tensorflow/compiler/mlir/tf2xla/api/v1/compile_mlir_util.h"
26#include "tensorflow/compiler/tf2xla/xla_helpers.h"
27#include "xla/hlo/builder/xla_computation.h"
28#include "xla/service/hlo.pb.h"
29#include "xla/tsl/platform/statusor.h"
30#include "tensorflow/core/lib/monitoring/cell_reader.h"
31#include "tensorflow/core/lib/monitoring/counter.h"
32
33namespace {
34using ::tensorflow::monitoring::testing::CellReader;
35using ::testing::Not;
36
37constexpr char kMetric[] = "/tensorflow/metric";
38auto* counter =
39 tensorflow::monitoring::Counter<1>::New(kMetric, "description", "status");
40constexpr char kOkStatus[] = "ok";
41const int kArbitraryIntResult = 37;
42
⋯5 lines
90:9… result;
91}
92
93TEST(TestUtil, ComputationContainsOk) {
94 constexpr char arbitrary_hlo[] = "arbitrary_hlo";
95 auto result = CreateXlaComputationResult(arbitrary_hlo);
96
97 ASSERT_THAT(success(result), ComputationProto …