Artem Titov | 8f726be | 2018-10-23 15:50:10 +0200 | [diff] [blame] | 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 | |
Artem Titov | 8f726be | 2018-10-23 15:50:10 +0200 | [diff] [blame] | 11 | #include <string> |
| 12 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 13 | #ifndef TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ |
| 14 | #define TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ |
Artem Titov | 8f726be | 2018-10-23 15:50:10 +0200 | [diff] [blame] | 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 path to a resource file in [project-root]/resources/ dir. |
| 42 | // Returns an absolute path |
| 43 | // |
| 44 | // Arguments: |
| 45 | // name - Name of the resource file. If a plain filename (no directory path) |
| 46 | // is supplied, the file is assumed to be located in resources/ |
| 47 | // If a directory path is prepended to the filename, a subdirectory |
| 48 | // hierarchy reflecting that path is assumed to be present. |
| 49 | // extension - File extension, without the dot, i.e. "bmp" or "yuv". |
| 50 | std::string ResourcePath(const std::string& name, const std::string& extension); |
| 51 | |
| 52 | } // namespace internal |
| 53 | } // namespace test |
| 54 | } // namespace webrtc |
| 55 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 56 | #endif // TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_ |