blob: c502ea38d97765b64a2ea3d86d23d164c5465c08 [file] [log] [blame]
zijiehe2769ec62016-12-14 15:03:03 -08001/*
2 * Copyright (c) 2016 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
ilnike264a9e2017-07-25 07:31:18 -070011#ifndef WEBRTC_TEST_TESTSUPPORT_TEST_OUTPUT_H_
12#define WEBRTC_TEST_TESTSUPPORT_TEST_OUTPUT_H_
zijiehe2769ec62016-12-14 15:03:03 -080013
14#include <stdlib.h>
15
16#include <string>
17
18namespace webrtc {
19namespace test {
20
ilnike264a9e2017-07-25 07:31:18 -070021// If the test_output_dir flag is set, returns true and copies the location of
22// the dir to |out_dir|. Otherwise, return false.
23bool GetTestOutputDir(std::string* out_dir);
24
zijiehe2769ec62016-12-14 15:03:03 -080025// Writes a |length| bytes array |buffer| to |filename| in isolated output
26// directory defined by swarming. If the file is existing, content will be
27// appended. Otherwise a new file will be created. This function returns false
28// if isolated output directory has not been defined, or |filename| indicates an
29// invalid or non-writable file, or underlying file system errors.
ilnike264a9e2017-07-25 07:31:18 -070030bool WriteToTestOutput(const char* filename,
31 const uint8_t* buffer,
32 size_t length);
zijiehe2769ec62016-12-14 15:03:03 -080033
ilnike264a9e2017-07-25 07:31:18 -070034bool WriteToTestOutput(const char* filename, const std::string& content);
zijiehe2769ec62016-12-14 15:03:03 -080035
36} // namespace test
37} // namespace webrtc
38
ilnike264a9e2017-07-25 07:31:18 -070039#endif // WEBRTC_TEST_TESTSUPPORT_TEST_OUTPUT_H_