blob: a72cd805cf9bd6059cde348a7ecd311e90f5c817 [file] [log] [blame]
Artem Titov8f726be2018-10-23 15:50:10 +02001/*
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 Titov8f726be2018-10-23 15:50:10 +020011#include <string>
12
Steve Anton10542f22019-01-11 09:11:00 -080013#ifndef TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_
14#define TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_
Artem Titov8f726be2018-10-23 15:50:10 +020015
16namespace webrtc {
17namespace test {
18namespace 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.
34std::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.
39std::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".
50std::string ResourcePath(const std::string& name, const std::string& extension);
51
52} // namespace internal
53} // namespace test
54} // namespace webrtc
55
Steve Anton10542f22019-01-11 09:11:00 -080056#endif // TEST_TESTSUPPORT_FILE_UTILS_OVERRIDE_H_