blob: a68c60d853624c02827d0c546690fddb85a22359 [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "tests/Test.h"
kkinnunen179a8f52015-11-20 13:32:24 -08009
Robert Phillips0c5bb2f2020-07-17 15:40:13 -040010#include "include/gpu/GrDirectContext.h"
Robert Phillips08ba0852019-05-22 20:23:43 +000011#include "tools/gpu/gl/GLTestContext.h"
kkinnunen179a8f52015-11-20 13:32:24 -080012
13// This is an example of a normal test.
14DEF_TEST(TestNormal, reporter) {
15 REPORTER_ASSERT(reporter, reporter);
16}
17
Brian Salomondcfca432017-11-15 15:48:03 -050018// This is an example of a GPU test that uses GrContextOptions to do the test.
kkinnunen179a8f52015-11-20 13:32:24 -080019DEF_GPUTEST(TestGpuFactory, reporter, factory) {
20 REPORTER_ASSERT(reporter, reporter);
kkinnunen179a8f52015-11-20 13:32:24 -080021}
kkinnunen179a8f52015-11-20 13:32:24 -080022
23// This is an example of a GPU test that tests a property that should work for all GPU contexts.
24// Note: Some of the contexts might not produce a rendering output.
egdanielab527a52016-06-28 08:07:26 -070025DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080026 REPORTER_ASSERT(reporter, reporter);
Robert Phillips6d344c32020-07-06 10:56:46 -040027 REPORTER_ASSERT(reporter, ctxInfo.directContext());
kkinnunen179a8f52015-11-20 13:32:24 -080028}
kkinnunen179a8f52015-11-20 13:32:24 -080029
30// This is an example of a GPU test that tests a property that should work for all GPU contexts that
31// produce a rendering output.
bsalomon68d91342016-04-12 09:59:58 -070032DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080033 REPORTER_ASSERT(reporter, reporter);
Robert Phillips6d344c32020-07-06 10:56:46 -040034 REPORTER_ASSERT(reporter, ctxInfo.directContext());
kkinnunen179a8f52015-11-20 13:32:24 -080035}
kkinnunen179a8f52015-11-20 13:32:24 -080036
Brian Osmanfbe24062019-04-03 16:04:45 +000037// This is an example of a GPU test that tests a property that uses the mock context. It should
38// be used if the test tests some behavior that is mocked with the mock context.
39DEF_GPUTEST_FOR_MOCK_CONTEXT(TestMockContext, reporter, ctxInfo) {
kkinnunen179a8f52015-11-20 13:32:24 -080040 REPORTER_ASSERT(reporter, reporter);
Robert Phillips6d344c32020-07-06 10:56:46 -040041 REPORTER_ASSERT(reporter, ctxInfo.directContext());
kkinnunen179a8f52015-11-20 13:32:24 -080042}