• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 Google LLC.
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 "include/sksl/DSL.h"
9 
10 #include "tests/Test.h"
11 
12 // This file verifies that DSL code compiles with only a DSL.h import. We don't bother with any
13 // 'real' tests here, as those are all in SkSLDSLTest.cpp.
14 
15 using namespace SkSL::dsl;
16 
17 // Defined in SkSLDSLTest.cpp (so that we don't have to put the required extra includes here)
18 void StartDSL(const sk_gpu_test::ContextInfo ctxInfo);
19 
DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLImportOnly,r,ctxInfo)20 DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLImportOnly, r, ctxInfo) {
21     StartDSL(ctxInfo);
22     Var x(kInt_Type);
23     Function(kInt_Type, "test", x).define(
24         If(x >= 0,
25             Block(Return(x)),
26             Block(Return(-x)))
27     );
28     End();
29 }
30