Home | History | Annotate | Download | only in tests
      1 /*
      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  */
      7 
      8 #include "Test.h"
      9 
     10 #include "SkCommandLineFlags.h"
     11 #include "SkError.h"
     12 #include "SkString.h"
     13 #include "SkTime.h"
     14 
     15 DEFINE_string2(tmpDir, t, nullptr, "Temp directory to use.");
     16 
     17 void skiatest::Reporter::bumpTestCount() {}
     18 
     19 bool skiatest::Reporter::allowExtendedTest() const { return false; }
     20 
     21 bool skiatest::Reporter::verbose() const { return false; }
     22 
     23 SkString 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         }
     30     }
     31     result.append(this->condition);
     32     return result;
     33 }
     34 
     35 SkString skiatest::GetTmpDir() {
     36     const char* tmpDir = FLAGS_tmpDir.isEmpty() ? nullptr : FLAGS_tmpDir[0];
     37     return SkString(tmpDir);
     38 }
     39