skia2/tools/list_gpu_unit_tests.cpp
John Stiles c5ca065411 Add CurrestTestHarness helper method.
This lets us differentiate SkQP from other testing harnesses (like DM or
Viewer) at runtime.

This allows us to change strictness or deactivate tests when SkQP is
running. Previously we had a macro SK_BUILD_FOR_SKQP for this, but this
did not work on a local skqp binary; it only activated when compiling
for Android.

Change-Id: I7334e04ea1eddda783a5d2f26699edd20828f81a
Bug: skia:13037
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518939
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-10 18:05:28 +00:00

32 lines
712 B
C++

/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include "tests/Test.h"
#include "tests/TestHarness.h"
TestHarness CurrentTestHarness() {
return TestHarness::kListGpuUnitTests;
}
int main() {
std::vector<std::string> tests;
for (const skiatest::Test& test : skiatest::TestRegistry::Range()) {
if (test.fNeedsGpu) {
tests.push_back(std::string(test.fName));
}
}
std::sort(tests.begin(), tests.end());
for (const std::string& test : tests) {
std::cout << test << '\n';
}
}