blob: fbec68340af635abcaf0a85ae9d5470a3c3c4fa1 [file] [log] [blame]
kkinnunen179a8f52015-11-20 13:32:24 -08001/*
2 * Copyright 2015 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#if SK_SUPPORT_GPU
11#include "GrContext.h"
bsalomon273c0f52016-03-31 10:59:06 -070012#include "gl/GLTestContext.h"
kkinnunen179a8f52015-11-20 13:32:24 -080013#endif
14
15
16// This is an example of a normal test.
17DEF_TEST(TestNormal, reporter) {
18 REPORTER_ASSERT(reporter, reporter);
19}
20
Brian Salomondcfca432017-11-15 15:48:03 -050021// This is an example of a GPU test that uses GrContextOptions to do the test.
kkinnunen179a8f52015-11-20 13:32:24 -080022#if SK_SUPPORT_GPU
23DEF_GPUTEST(TestGpuFactory, reporter, factory) {
24 REPORTER_ASSERT(reporter, reporter);
kkinnunen179a8f52015-11-20 13:32:24 -080025}
26#endif
27
28// This is an example of a GPU test that tests a property that should work for all GPU contexts.
29// Note: Some of the contexts might not produce a rendering output.
30#if SK_SUPPORT_GPU
egdanielab527a52016-06-28 08:07:26 -070031DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080032 REPORTER_ASSERT(reporter, reporter);
bsalomon8b7451a2016-05-11 06:33:06 -070033 REPORTER_ASSERT(reporter, ctxInfo.grContext());
kkinnunen179a8f52015-11-20 13:32:24 -080034}
35#endif
36
37// This is an example of a GPU test that tests a property that should work for all GPU contexts that
38// produce a rendering output.
39#if SK_SUPPORT_GPU
bsalomon68d91342016-04-12 09:59:58 -070040DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080041 REPORTER_ASSERT(reporter, reporter);
bsalomon8b7451a2016-05-11 06:33:06 -070042 REPORTER_ASSERT(reporter, ctxInfo.grContext());
kkinnunen179a8f52015-11-20 13:32:24 -080043}
44#endif
45
kkinnunen179a8f52015-11-20 13:32:24 -080046// This is an example of a GPU test that tests a property that uses the null GPU context. It should
47// be used if the test tests some behavior that is mocked with the null context.
48#if SK_SUPPORT_GPU
bsalomon758586c2016-04-06 14:02:39 -070049DEF_GPUTEST_FOR_NULLGL_CONTEXT(TestGpuNullContext, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080050 REPORTER_ASSERT(reporter, reporter);
bsalomon8b7451a2016-05-11 06:33:06 -070051 REPORTER_ASSERT(reporter, ctxInfo.grContext());
kkinnunen179a8f52015-11-20 13:32:24 -080052}
53#endif