1 // 2 // Copyright (C) 2023 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 #pragma once 17 18 #include <optional> 19 #include <string> 20 21 #include <gtest/gtest.h> 22 23 #include "common/libs/utils/files.h" 24 25 namespace cuttlefish { 26 27 struct InputOutput { 28 std::string path_to_convert_; 29 std::string working_dir_; 30 std::string home_dir_; 31 std::string expected_; 32 }; 33 34 class EmulateAbsolutePathBase : public testing::TestWithParam<InputOutput> { 35 protected: 36 EmulateAbsolutePathBase(); 37 38 std::string input_path_; 39 std::string expected_path_; 40 }; 41 42 class EmulateAbsolutePathWithPwd : public testing::TestWithParam<InputOutput> { 43 protected: 44 EmulateAbsolutePathWithPwd(); 45 46 std::string input_path_; 47 std::string current_dir_; 48 std::string expected_path_; 49 }; 50 51 class EmulateAbsolutePathWithHome : public EmulateAbsolutePathBase { 52 protected: 53 EmulateAbsolutePathWithHome(); 54 55 std::string input_path_; 56 std::string home_dir_; 57 std::string expected_path_; 58 }; 59 60 } // namespace cuttlefish 61