blob: c8c40cdfa429919ea402110594701362897f1ed6 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
tfarina880914c2014-06-09 12:05:34 -07007
reed@android.comed673312009-02-27 16:24:51 +00008#include "Test.h"
9
commit-bot@chromium.org0dc5bd12014-02-26 16:31:22 +000010#include "SkCommandLineFlags.h"
tfarina@chromium.org8f6884a2014-01-24 20:56:26 +000011#include "SkError.h"
commit-bot@chromium.org197845a2013-04-19 13:24:28 +000012#include "SkString.h"
commit-bot@chromium.org0506b9d2013-04-22 16:43:07 +000013#include "SkTime.h"
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000014
halcanary87f3ba42015-01-20 09:30:20 -080015DEFINE_string2(tmpDir, t, NULL, "Temp directory to use.");
bsalomon@google.coma8e686e2011-08-16 15:45:58 +000016
halcanary87f3ba42015-01-20 09:30:20 -080017void skiatest::Reporter::bumpTestCount() {}
commit-bot@chromium.org0dc5bd12014-02-26 16:31:22 +000018
halcanary87f3ba42015-01-20 09:30:20 -080019bool skiatest::Reporter::allowExtendedTest() const { return false; }
reed@android.comed673312009-02-27 16:24:51 +000020
halcanary87f3ba42015-01-20 09:30:20 -080021bool skiatest::Reporter::verbose() const { return false; }
reed@android.comed673312009-02-27 16:24:51 +000022
halcanary87f3ba42015-01-20 09:30:20 -080023SkString skiatest::Failure::toString() const {
24 SkString result = SkStringPrintf("%s:%d\t", this->fileName, this->lineNo);
25 if (!this->message.isEmpty()) {
26 result.append(this->message);
27 if (strlen(this->condition) > 0) {
28 result.append(": ");
29 }
reed@android.comed673312009-02-27 16:24:51 +000030 }
halcanary87f3ba42015-01-20 09:30:20 -080031 result.append(this->condition);
32 return result;
reed@android.comed673312009-02-27 16:24:51 +000033}
34
halcanary87f3ba42015-01-20 09:30:20 -080035SkString skiatest::GetTmpDir() {
commit-bot@chromium.org0dc5bd12014-02-26 16:31:22 +000036 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0];
37 return SkString(tmpDir);
djsollen@google.com0945bde2012-11-29 15:28:45 +000038}