blob: ee07a9be52afc4bdc12aeae7acb7d1e731b5badf [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
Edward Lemuraf8659a2017-09-27 14:46:24 +020011#ifndef TEST_TESTSUPPORT_TEST_ARTIFACTS_H_
12#define TEST_TESTSUPPORT_TEST_ARTIFACTS_H_
zijiehe2769ec62016-12-14 15:03:03 -080013
14#include <stdlib.h>
15
16#include <string>
17
18namespace webrtc {
19namespace test {
20
Edward Lemuraf8659a2017-09-27 14:46:24 +020021// If the test_artifacts_dir flag is set, returns true and copies the location
22// of the dir to |out_dir|. Otherwise, return false.
23bool GetTestArtifactsDir(std::string* out_dir);
ilnike264a9e2017-07-25 07:31:18 -070024
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.
Edward Lemuraf8659a2017-09-27 14:46:24 +020030bool WriteToTestArtifactsDir(const char* filename,
31 const uint8_t* buffer,
32 size_t length);
zijiehe2769ec62016-12-14 15:03:03 -080033
Edward Lemuraf8659a2017-09-27 14:46:24 +020034bool WriteToTestArtifactsDir(const char* filename, const std::string& content);
zijiehe2769ec62016-12-14 15:03:03 -080035
36} // namespace test
37} // namespace webrtc
38
Edward Lemuraf8659a2017-09-27 14:46:24 +020039#endif // TEST_TESTSUPPORT_TEST_ARTIFACTS_H_