xref: /aosp_15_r20/external/icing/icing/testing/test-data.h (revision 8b6cd535a057e39b3b86660c4aa06c99747c2136)
1 // Copyright (C) 2019 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef ICING_TESTING_TEST_DATA_H_
16 #define ICING_TESTING_TEST_DATA_H_
17 
18 #include <string>
19 
20 #include "icing/text_classifier/lib3/utils/base/status.h"
21 
22 // This file provides functions for getting / setting up absolute test file
23 // paths. They are specific to Blaze and Google3 and should be changed when used
24 // in AOSP / Gerrit.
25 namespace icing {
26 namespace lib {
27 
28 // The input path should be a relative path under google3. The function returns
29 // an absolute path to the file during unit testing. Before calling this
30 // function, please make sure the test file is added in "data" attribute in
31 // portable_cc_test or any other test build rules.
32 std::string GetTestFilePath(const std::string& google3_relative_file_path);
33 
34 }  // namespace lib
35 }  // namespace icing
36 
37 #endif  // ICING_TESTING_TEST_DATA_H_
38