TestTest.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  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. #include "tests/Test.h"
  8. #include "include/gpu/GrContext.h"
  9. #include "tools/gpu/gl/GLTestContext.h"
  10. // This is an example of a normal test.
  11. DEF_TEST(TestNormal, reporter) {
  12. REPORTER_ASSERT(reporter, reporter);
  13. }
  14. // This is an example of a GPU test that uses GrContextOptions to do the test.
  15. DEF_GPUTEST(TestGpuFactory, reporter, factory) {
  16. REPORTER_ASSERT(reporter, reporter);
  17. }
  18. // This is an example of a GPU test that tests a property that should work for all GPU contexts.
  19. // Note: Some of the contexts might not produce a rendering output.
  20. DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) {
  21. REPORTER_ASSERT(reporter, reporter);
  22. REPORTER_ASSERT(reporter, ctxInfo.grContext());
  23. }
  24. // This is an example of a GPU test that tests a property that should work for all GPU contexts that
  25. // produce a rendering output.
  26. DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) {
  27. REPORTER_ASSERT(reporter, reporter);
  28. REPORTER_ASSERT(reporter, ctxInfo.grContext());
  29. }
  30. // This is an example of a GPU test that tests a property that uses the mock context. It should
  31. // be used if the test tests some behavior that is mocked with the mock context.
  32. DEF_GPUTEST_FOR_MOCK_CONTEXT(TestMockContext, reporter, ctxInfo) {
  33. REPORTER_ASSERT(reporter, reporter);
  34. REPORTER_ASSERT(reporter, ctxInfo.grContext());
  35. }