Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1111)

Unified Diff: tests/TestTest.cpp

Issue 1446453003: Generate list of GPU contexts outside SurfaceTest tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: msvc fixes Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/Test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TestTest.cpp
diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2c303a74cecc1c517b163eb478b09976faabbd04
--- /dev/null
+++ b/tests/TestTest.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "Test.h"
+
+#if SK_SUPPORT_GPU
+#include "GrContext.h"
+#include "gl/SkGLContext.h"
+#endif
+
+
+// This is an example of a normal test.
+DEF_TEST(TestNormal, reporter) {
+ REPORTER_ASSERT(reporter, reporter);
+}
+
+// This is an example of a GPU test that uses common GrContextFactory factory to do the test.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST(TestGpuFactory, reporter, factory) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, factory);
+}
+#endif
+
+// This is an example of a GPU test that tests a property that should work for all GPU contexts.
+// Note: Some of the contexts might not produce a rendering output.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, context) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, context);
+}
+#endif
+
+// This is an example of a GPU test that tests a property that should work for all GPU contexts that
+// produce a rendering output.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, context) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, context);
+}
+#endif
+
+// This is an example of a GPU test that tests a property that should work at least for the native
+// GPU context. If the test takes a long time to run, it may be appropriate to test only the native
+// context.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestGpuNativeContext, reporter, context) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, context);
+}
+#endif
+
+// This is an example of a GPU test that tests a property that uses the null GPU context. It should
+// be used if the test tests some behavior that is mocked with the null context.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_NULL_CONTEXT(TestGpuNullContext, reporter, context) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, context);
+}
+#endif
+
+// This is an example of a GPU test that tests a property that should work for all GPU contexts.
+// It uses the additional SkGLContext* glContext to implement the test.
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuGrContextAndGLContext, reporter, context, glContext) {
+ REPORTER_ASSERT(reporter, reporter);
+ REPORTER_ASSERT(reporter, context);
+ REPORTER_ASSERT(reporter, glContext);
+}
+#endif
+
« no previous file with comments | « tests/Test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698