d7b3845f3d
Add a real implementation for gm_knowledge.h This depends on the presence of files in the form $GMK_DIR/foo/{max,min}.png The implementation also writes out failures in a report directory. Add a utility: experimental/make_gmkb which is a stand-alone go executable that generates the foo/{max,min}.png data. tools/skqp/README.md has instructions on running SkQP. Also: add SkFontMgrPriv.h Change-Id: Ibe1e9a7e7de143d14eee3877f5f2d2d8713f7f49 Reviewed-on: https://skia-review.googlesource.com/65380 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
99 lines
1.9 KiB
C++
99 lines
1.9 KiB
C++
/*
|
|
* Copyright 2017 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
#ifndef gm_runner_DEFINED
|
|
#define gm_runner_DEFINED
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <tuple>
|
|
#include <vector>
|
|
|
|
#include "skqp_asset_manager.h"
|
|
|
|
/**
|
|
A Skia GM is a single rendering test that can be executed on any Skia backend Canvas.
|
|
*/
|
|
namespace skiagm {
|
|
class GM;
|
|
}
|
|
|
|
namespace skiatest {
|
|
struct Test;
|
|
}
|
|
|
|
namespace gm_runner {
|
|
|
|
using GMFactory = skiagm::GM* (*)(void*);
|
|
|
|
using UnitTest = const skiatest::Test*;
|
|
|
|
enum class SkiaBackend {
|
|
kGL,
|
|
kGLES,
|
|
kVulkan,
|
|
};
|
|
|
|
/**
|
|
Initialize Skia
|
|
*/
|
|
void InitSkia();
|
|
|
|
std::vector<SkiaBackend> GetSupportedBackends();
|
|
|
|
/**
|
|
@return a list of all Skia GMs in lexicographic order.
|
|
*/
|
|
std::vector<GMFactory> GetGMFactories(skqp::AssetManager*);
|
|
|
|
/**
|
|
@return a list of all Skia GPU unit tests in lexicographic order.
|
|
*/
|
|
std::vector<UnitTest> GetUnitTests();
|
|
|
|
/**
|
|
@return a descriptive name for the GM.
|
|
*/
|
|
std::string GetGMName(GMFactory);
|
|
|
|
/**
|
|
@return a descriptive name for the unit test.
|
|
*/
|
|
const char* GetUnitTestName(UnitTest);
|
|
|
|
/**
|
|
@return a descriptive name for the backend.
|
|
*/
|
|
const char* GetBackendName(SkiaBackend);
|
|
|
|
enum class Error {
|
|
None = 0,
|
|
BadSkiaOutput = 1,
|
|
BadGMKBData = 2,
|
|
SkiaFailure = 3,
|
|
};
|
|
|
|
const char* GetErrorString(Error);
|
|
|
|
/**
|
|
@return A non-negative float representing how badly the GM failed (or zero for
|
|
success). Any error running or evaluating the GM will result in a non-zero
|
|
error code.
|
|
*/
|
|
std::tuple<float, Error> EvaluateGM(SkiaBackend backend,
|
|
GMFactory gmFact,
|
|
skqp::AssetManager* assetManager,
|
|
const char* reportDirectoryPath);
|
|
|
|
/**
|
|
@return a (hopefully empty) list of errors produced by this unit test.
|
|
*/
|
|
std::vector<std::string> ExecuteTest(UnitTest);
|
|
|
|
} // namespace gm_runner
|
|
|
|
#endif // gm_runner_DEFINED
|