Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2016 Google, Inc. |
| 3 | // |
| 4 | // All rights reserved. |
| 5 | // |
| 6 | // Redistribution and use in source and binary forms, with or without |
| 7 | // modification, are permitted provided that the following conditions |
| 8 | // are met: |
| 9 | // |
| 10 | // Redistributions of source code must retain the above copyright |
| 11 | // notice, this list of conditions and the following disclaimer. |
| 12 | // |
| 13 | // Redistributions in binary form must reproduce the above |
| 14 | // copyright notice, this list of conditions and the following |
| 15 | // disclaimer in the documentation and/or other materials provided |
| 16 | // with the distribution. |
| 17 | // |
| 18 | // Neither the name of Google Inc. nor the names of its |
| 19 | // contributors may be used to endorse or promote products derived |
| 20 | // from this software without specific prior written permission. |
| 21 | // |
| 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 33 | // POSSIBILITY OF SUCH DAMAGE. |
| 34 | |
| 35 | #include <gtest/gtest.h> |
| 36 | |
| 37 | #include "TestFixture.h" |
| 38 | |
| 39 | namespace glslangtest { |
| 40 | namespace { |
| 41 | |
| 42 | using CompileToAstTest = GlslangTest<::testing::TestWithParam<std::string>>; |
| 43 | |
| 44 | TEST_P(CompileToAstTest, FromFile) |
| 45 | { |
| 46 | loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(), |
Lei Zhang | d6f0ed2 | 2016-05-16 12:50:30 -0400 | [diff] [blame] | 47 | Source::GLSL, Semantics::OpenGL, |
| 48 | Target::AST); |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | // clang-format off |
| 52 | INSTANTIATE_TEST_CASE_P( |
| 53 | Glsl, CompileToAstTest, |
| 54 | ::testing::ValuesIn(std::vector<std::string>({ |
| 55 | "sample.frag", |
| 56 | "sample.vert", |
| 57 | "decls.frag", |
| 58 | "specExamples.frag", |
| 59 | "specExamples.vert", |
| 60 | "versionsClean.frag", |
| 61 | "versionsClean.vert", |
| 62 | "versionsErrors.frag", |
| 63 | "versionsErrors.vert", |
| 64 | "100.frag", |
| 65 | "120.vert", |
| 66 | "120.frag", |
| 67 | "130.vert", |
| 68 | "130.frag", |
| 69 | "140.vert", |
| 70 | "140.frag", |
| 71 | "150.vert", |
| 72 | "150.geom", |
| 73 | "150.frag", |
| 74 | "precision.frag", |
| 75 | "precision.vert", |
| 76 | "nonSquare.vert", |
| 77 | "matrixError.vert", |
| 78 | "cppSimple.vert", |
| 79 | "cppIndent.vert", |
| 80 | "cppNest.vert", |
| 81 | "cppComplexExpr.vert", |
| 82 | "badChars.frag", |
| 83 | "pointCoord.frag", |
| 84 | "array.frag", |
| 85 | "array100.frag", |
| 86 | "comment.frag", |
| 87 | "300.vert", |
| 88 | "300.frag", |
| 89 | "300BuiltIns.frag", |
| 90 | "300layout.vert", |
| 91 | "300layout.frag", |
| 92 | "300operations.frag", |
| 93 | "300block.frag", |
| 94 | "310.comp", |
| 95 | "310.vert", |
| 96 | "310.geom", |
| 97 | "310.frag", |
| 98 | "310.tesc", |
| 99 | "310.tese", |
| 100 | "310implicitSizeArrayError.vert", |
| 101 | "310AofA.vert", |
| 102 | "330.frag", |
| 103 | "330comp.frag", |
| 104 | "constErrors.frag", |
| 105 | "constFold.frag", |
| 106 | "errors.frag", |
| 107 | "forwardRef.frag", |
| 108 | "uint.frag", |
| 109 | "switch.frag", |
| 110 | "tokenLength.vert", |
| 111 | "100Limits.vert", |
| 112 | "100scope.vert", |
| 113 | "110scope.vert", |
| 114 | "300scope.vert", |
| 115 | "400.frag", |
| 116 | "420.frag", |
| 117 | "420.vert", |
| 118 | "420.geom", |
| 119 | "420_size_gl_in.geom", |
| 120 | "430scope.vert", |
| 121 | "lineContinuation100.vert", |
| 122 | "lineContinuation.vert", |
| 123 | "numeral.frag", |
| 124 | "400.geom", |
| 125 | "400.tesc", |
| 126 | "400.tese", |
| 127 | "410.tesc", |
| 128 | "420.tesc", |
| 129 | "420.tese", |
| 130 | "410.geom", |
| 131 | "430.vert", |
| 132 | "430.comp", |
| 133 | "430AofA.frag", |
| 134 | "440.vert", |
| 135 | "440.frag", |
| 136 | "450.vert", |
| 137 | "450.geom", |
| 138 | "450.tesc", |
| 139 | "450.tese", |
| 140 | "450.frag", |
| 141 | "450.comp", |
| 142 | "dce.frag", |
| 143 | "atomic_uint.frag", |
| 144 | "aggOps.frag", |
| 145 | "always-discard.frag", |
| 146 | "always-discard2.frag", |
| 147 | "conditionalDiscard.frag", |
| 148 | "conversion.frag", |
| 149 | "dataOut.frag", |
| 150 | "dataOutIndirect.frag", |
| 151 | "deepRvalue.frag", |
| 152 | "depthOut.frag", |
| 153 | "discard-dce.frag", |
| 154 | "doWhileLoop.frag", |
| 155 | "earlyReturnDiscard.frag", |
| 156 | "flowControl.frag", |
| 157 | "forLoop.frag", |
| 158 | "functionCall.frag", |
| 159 | "functionSemantics.frag", |
| 160 | "length.frag", |
| 161 | "localAggregates.frag", |
| 162 | "loops.frag", |
| 163 | "loopsArtificial.frag", |
| 164 | "matrix.frag", |
| 165 | "matrix2.frag", |
| 166 | "newTexture.frag", |
| 167 | "Operations.frag", |
| 168 | "prepost.frag", |
| 169 | "simpleFunctionCall.frag", |
| 170 | "structAssignment.frag", |
| 171 | "structDeref.frag", |
| 172 | "structure.frag", |
| 173 | "swizzle.frag", |
| 174 | "syntaxError.frag", |
| 175 | "test.frag", |
| 176 | "texture.frag", |
| 177 | "types.frag", |
| 178 | "uniformArray.frag", |
| 179 | "variableArrayIndex.frag", |
| 180 | "varyingArray.frag", |
| 181 | "varyingArrayIndirect.frag", |
| 182 | "voidFunction.frag", |
| 183 | "whileLoop.frag", |
| 184 | "nonVulkan.frag", |
| 185 | "spv.atomic.comp", |
| 186 | })), |
Lei Zhang | d6f0ed2 | 2016-05-16 12:50:30 -0400 | [diff] [blame] | 187 | FileNameAsCustomTestSuffix |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 188 | ); |
| 189 | // clang-format on |
| 190 | |
| 191 | } // anonymous namespace |
| 192 | } // namespace glslangtest |