1 /* 2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include <string> 12 13 #ifndef TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ 14 #define TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ 15 16 namespace webrtc { 17 namespace test { 18 namespace internal { 19 20 // Returns the absolute path to the output directory where log files and other 21 // test artifacts should be put. The output directory is generally a directory 22 // named "out" at the project root. This root is assumed to be two levels above 23 // where the test binary is located; this is because tests execute in a dir 24 // out/Whatever relative to the project root. This convention is also followed 25 // in Chromium. 26 // 27 // The exception is Android where we use /sdcard/ instead. 28 // 29 // If symbolic links occur in the path they will be resolved and the actual 30 // directory will be returned. 31 // 32 // Returns the path WITH a trailing path delimiter. If the project root is not 33 // found, the current working directory ("./") is returned as a fallback. 34 std::string OutputPath(); 35 36 // Gets the current working directory for the executing program. 37 // Returns "./" if for some reason it is not possible to find the working 38 // directory. 39 std::string WorkingDir(); 40 41 // Returns a full path to a resource file in the resources_dir dir. 42 // 43 // Arguments: 44 // name - Name of the resource file. If a plain filename (no directory path) 45 // is supplied, the file is assumed to be located in resources/ 46 // If a directory path is prepended to the filename, a subdirectory 47 // hierarchy reflecting that path is assumed to be present. 48 // extension - File extension, without the dot, i.e. "bmp" or "yuv". 49 std::string ResourcePath(const std::string& name, const std::string& extension); 50 51 } // namespace internal 52 } // namespace test 53 } // namespace webrtc 54 55 #endif // TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ 56