Debian Codegraph @

Test/runtests

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2
3 # Arguments:
4 # 1- TargetDirectory, where to write test results and intermediary files
5 # 2- Path to glslang
6
7 TARGETDIR=${1:-localResults}
8 BASEDIR=baseResults
9 EXE=${2:-../build/install/bin/glslang}
10 ENABLE_HLSL=${3:-1}
11 HASERROR=0
12 mkdirscip-shell system . . mkdir. -p "$TARGETDIR"
13
14 LIBPATH="$(cd "$(dirnamescip-shell system . . dirname. "$(dirnamescip-shell system . . dirname. "$EXE")")" && pwdscip-shell system . . pwd.)/lib"
15 if [scip-shell system . . `[`. -d "${LIBPATH}" ]; then
16 export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
17 fi
18
19 function runscip-shell shell shell-project 0.0.0 run(). {
20 "$EXE" "$@"
21 result=$?
22 case "$result" in
23 [0-6]) # Valid success and error codes
24 return
25 ;;
26 *)
27 echoscip-shell system . . echo. "$EXE returned $result"
28 HASERROR=1
29 esac
30 }
31
32 if [scip-shell system . . `[`. -a localtestlist ]
33 then
34 while read t; do
35 echoscip-shell system . . echo. Running $t...
36 b=`basenamescip-shell system . . basename. $t`
37 runscip-shell shell shell-project 0.0.0 run(). -i -l $t > "$TARGETDIR/$b.out"
38 diffscip-shell system . . diff. -b $BASEDIR/$b.out "$TARGETDIR/$b.out" || HASERROR=1
39 done < localtestlist
40 fi
41
42 rmscip-shell system . . rm. -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
43
44 #
45 # special tests
46 #
47
48 runscip-shell shell shell-project 0.0.0 run(). badMacroArgs.frag > "$TARGETDIR/badMacroArgs.frag.out"
49 diffscip-shell system . . diff. -b $BASEDIR/badMacroArgs.frag.out "$TARGETDIR/badMacroArgs.frag.out" || HASERROR=1
50
51 runscip-shell shell shell-project 0.0.0 run(). gl_samplemask_array_size.frag gl_MaxSamples_32.conf -i > "$TARGETDIR/gl_samplemask_array_size_32.frag.out"
52 diffscip-shell system . . diff. -b $BASEDIR/gl_samplemask_array_size_32.frag.out "$TARGETDIR/gl_samplemask_array_size_32.frag.out" || HASERROR=1
53 runscip-shell shell shell-project 0.0.0 run(). gl_samplemask_array_size.frag gl_MaxSamples_64.conf -i > "$TARGETDIR/gl_samplemask_array_size_64.frag.out"
54 diffscip-shell system . . diff. -b $BASEDIR/gl_samplemask_array_size_64.frag.out "$TARGETDIR/gl_samplemask_array_size_64.frag.out" || HASERROR=1
55 #
56 # reflection tests
57 #
58 echoscip-shell system . . echo. Running reflection...
59 runscip-shell shell shell-project 0.0.0 run(). -l -q -C reflection.vert > "$TARGETDIR/reflection.vert.out"
60 diffscip-shell system . . diff. -b $BASEDIR/reflection.vert.out "$TARGETDIR/reflection.vert.out" || HASERROR=1
61 runscip-shell shell shell-project 0.0.0 run(). -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.options.vert > "$TARGETDIR/reflection.options.vert.out"
62 diffscip-shell system . . diff. -b $BASEDIR/reflection.options.vert.out "$TARGETDIR/reflection.options.vert.out" || HASERROR=1
63 runscip-shell shell shell-project 0.0.0 run(). -l -q -C reflection.frag > "$TARGETDIR/reflection.frag.out"
64 diffscip-shell system . . diff. -b $BASEDIR/reflection.frag.out "$TARGETDIR/reflection.frag.out" || HASERROR=1
65 runscip-shell shell shell-project 0.0.0 run(). -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.frag > "$TARGETDIR/reflection.options.frag.out"
66 diffscip-shell system . . diff. -b $BASEDIR/reflection.options.frag.out "$TARGETDIR/reflection.options.frag.out" || HASERROR=1
67 runscip-shell shell shell-project 0.0.0 run(). -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.options.geom > "$TARGETDIR/reflection.options.geom.out"
68 diffscip-shell system . . diff. -b $BASEDIR/reflection.options.geom.out "$TARGETDIR/reflection.options.geom.out" || HASERROR=1
69 runscip-shell shell shell-project 0.0.0 run(). -l -q -C reflection.linked.vert reflection.linked.frag > "$TARGETDIR/reflection.linked.out"
70 diffscip-shell system . . diff. -b $BASEDIR/reflection.linked.out "$TARGETDIR/reflection.linked.out" || HASERROR=1
71 runscip-shell shell shell-project 0.0.0 run(). -l -q -C --reflect-strict-array-suffix --reflect-basic-array-suffix --reflect-intermediate-io --reflect-separate-buffers --reflect-all-block-variables --reflect-unwrap-io-blocks --reflect-all-io-variables --reflect-shared-std140-ubo --reflect-shared-std140-ssbo reflection.linked.vert reflection.linked.frag > "$TARGETDIR/reflection.linked.options.out"
72 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
73 diffscip-shell system . . diff. -b $BASEDIR/reflection.linked.options.out "$TARGETDIR/reflection.linked.options.out" || HASERROR=1
74 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > "$TARGETDIR/hlsl.reflection.vert.out"
75 diffscip-shell system . . diff. -b $BASEDIR/hlsl.reflection.vert.out "$TARGETDIR/hlsl.reflection.vert.out" || HASERROR=1
76 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > "$TARGETDIR/hlsl.reflection.binding.frag.out"
77 diffscip-shell system . . diff. -b $BASEDIR/hlsl.reflection.binding.frag.out "$TARGETDIR/hlsl.reflection.binding.frag.out" || HASERROR=1
78 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > "$TARGETDIR/hlsl.automap.frag.out"
79 diffscip-shell system . . diff. -b $BASEDIR/hlsl.automap.frag.out "$TARGETDIR/hlsl.automap.frag.out" || HASERROR=1
80 fi
81
82 #
83 # multi-threaded test
84 #
85 echoscip-shell system . . echo. Comparing single thread to multithread for all tests in current directory...
86 for stage in vert frag geom tesc tese comp; do
87 runscip-shell shell shell-project 0.0.0 run(). -i -C *.$stage > "$TARGETDIR/$stage.singleThread.out"
88 runscip-shell shell shell-project 0.0.0 run(). -i -C *.$stage -t > "$TARGETDIR/$stage.multiThread.out"
89 diffscip-shell system . . diff. "$TARGETDIR/$stage.singleThread.out" "$TARGETDIR/$stage.multiThread.out" || HASERROR=1
90 if [scip-shell system . . `[`. $HASERROR -eq 0 ]
91 then
92 rmscip-shell system . . rm. "$TARGETDIR/$stage.singleThread.out"
93 rmscip-shell system . . rm. "$TARGETDIR/$stage.multiThread.out"
94 fi
95 done
96
97 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
98 #
99 # entry point renaming tests
100 #
101 echoscip-shell system . . echo. Running entry-point renaming tests
102 runscip-shell shell shell-project 0.0.0 run(). -i -H -V -D -Od --entry-point main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > "$TARGETDIR/hlsl.entry.rename.frag.out"
103 diffscip-shell system . . diff. -b $BASEDIR/hlsl.entry.rename.frag.out "$TARGETDIR/hlsl.entry.rename.frag.out" || HASERROR=1
104
105 #
106 # Testing ill-defined uncalled function
107 #
108 echoscip-shell system . . echo. Running ill-defined uncalled function
109 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > "$TARGETDIR/hlsl.deadFunctionMissingBody.vert.out"
110 diffscip-shell system . . diff. -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out "$TARGETDIR/hlsl.deadFunctionMissingBody.vert.out" || HASERROR=1
111 fi
112
113 if [scip-shell system . . `[`. $HASERROR -eq 0 ]
114 then
115 echoscip-shell system . . echo. Tests Succeeded.
116 else
117 echoscip-shell system . . echo. Tests Failed.
118 fi
119
120 #
121 # Testing -S and compound suffixes
122 #
123 echoscip-shell system . . echo. Running explicit stage test and compound suffix tests
124 runscip-shell shell shell-project 0.0.0 run(). -Od -i -S vert nosuffix > "$TARGETDIR/nosuffix.out"
125 diffscip-shell system . . diff. -b $BASEDIR/nosuffix.out "$TARGETDIR/nosuffix.out" || HASERROR=1
126 runscip-shell shell shell-project 0.0.0 run(). -Od -i compoundsuffix.vert.glsl > "$TARGETDIR/compoundsuffix.vert.glsl"
127 diffscip-shell system . . diff. -b $BASEDIR/compoundsuffix.vert.glsl "$TARGETDIR/compoundsuffix.vert.glsl" || HASERROR=1
128 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
129 runscip-shell shell shell-project 0.0.0 run(). -Od -e main -H compoundsuffix.frag.hlsl > "$TARGETDIR/compoundsuffix.frag.hlsl"
130 diffscip-shell system . . diff. -b $BASEDIR/compoundsuffix.frag.hlsl "$TARGETDIR/compoundsuffix.frag.hlsl" || HASERROR=1
131 fi
132
133 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
134 #
135 # Testing --hlsl-offsets
136 #
137 echoscip-shell system . . echo. Running hlsl offsets
138 runscip-shell shell shell-project 0.0.0 run(). -i --hlsl-offsets -H spv.hlslOffsets.vert > "$TARGETDIR/spv.hlslOffsets.vert.out"
139 diffscip-shell system . . diff. -b $BASEDIR/spv.hlslOffsets.vert.out "$TARGETDIR/spv.hlslOffsets.vert.out" || HASERROR=1
140
141 echoscip-shell system . . echo. Running hlsl offsets
142 runscip-shell shell shell-project 0.0.0 run(). -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > "$TARGETDIR/hlsl.hlslOffset.vert.out"
143 diffscip-shell system . . diff. -b $BASEDIR/hlsl.hlslOffset.vert.out "$TARGETDIR/hlsl.hlslOffset.vert.out" || HASERROR=1
144
145 #
146 # Testing --resource-set-binding
147 #
148 echoscip-shell system . . echo. Configuring HLSL descriptor set and binding number manually
149 runscip-shell shell shell-project 0.0.0 run(). -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > "$TARGETDIR/hlsl.multiDescriptorSet.frag.out"
150 diffscip-shell system . . diff. -b $BASEDIR/hlsl.multiDescriptorSet.frag.out "$TARGETDIR/hlsl.multiDescriptorSet.frag.out" || HASERROR=1
151
152 runscip-shell shell shell-project 0.0.0 run(). -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > "$TARGETDIR/hlsl.explicitDescriptorSet.frag.out"
153 diffscip-shell system . . diff. -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out "$TARGETDIR/hlsl.explicitDescriptorSet.frag.out" || HASERROR=1
154
155 runscip-shell shell shell-project 0.0.0 run(). -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > "$TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out"
156 diffscip-shell system . . diff. -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out "$TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out" || HASERROR=1
157
158 #
159 # Testing per-descriptor-set IO map shift
160 #
161 echoscip-shell system . . echo. 'Testing per-descriptor-set IO map shift'
162 runscip-shell shell shell-project 0.0.0 run(). -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --stb 70 6 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > "$TARGETDIR/hlsl.shift.per-set.frag.out" || HASERROR=1
163 diffscip-shell system . . diff. -b $BASEDIR/hlsl.shift.per-set.frag.out "$TARGETDIR/hlsl.shift.per-set.frag.out" || HASERROR=1
164 fi
165
166 #
167 # Testing location error
168 #
169 echoscip-shell system . . echo. Testing SPV no location
170 runscip-shell shell shell-project 0.0.0 run(). -V -C spv.noLocation.vert > "$TARGETDIR/spv.noLocation.vert.out"
171 diffscip-shell system . . diff. -b $BASEDIR/spv.noLocation.vert.out "$TARGETDIR/spv.noLocation.vert.out" || HASERROR=1
172 runscip-shell shell shell-project 0.0.0 run(). -G -H --aml spv.noBuiltInLoc.vert > "$TARGETDIR/spv.noBuiltInLoc.vert.out"
173 diffscip-shell system . . diff. -b $BASEDIR/spv.noBuiltInLoc.vert.out "$TARGETDIR/spv.noBuiltInLoc.vert.out" || HASERROR=1
174 runscip-shell shell shell-project 0.0.0 run(). -G spv.looseUniformNoLoc.vert > "$TARGETDIR/spv.looseUniformNoLoc.vert.out"
175 diffscip-shell system . . diff. -b $BASEDIR/spv.looseUniformNoLoc.vert.out "$TARGETDIR/spv.looseUniformNoLoc.vert.out" || HASERROR=1
176
177 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
178 #
179 # Testing debug information
180 #
181 echoscip-shell system . . echo. Testing SPV Debug Information
182 runscip-shell shell shell-project 0.0.0 run(). -g --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
183 -G -H spv.debugInfo.frag --rsb frag 3 > "$TARGETDIR/spv.debugInfo.frag.out"
184 diffscip-shell system . . diff. -b $BASEDIR/spv.debugInfo.frag.out "$TARGETDIR/spv.debugInfo.frag.out" || HASERROR=1
185 runscip-shell shell shell-project 0.0.0 run(). -g -Od --target-env vulkan1.1 --relaxed-errors --suppress-warnings --aml --amb --hlsl-offsets --nsf --spirv-val \
186 -V -H spv.debugInfo.frag --rsb frag 3 > "$TARGETDIR/spv.debugInfo.1.1.frag.out"
187 diffscip-shell system . . diff. -b $BASEDIR/spv.debugInfo.1.1.frag.out "$TARGETDIR/spv.debugInfo.1.1.frag.out" || HASERROR=1
188 runscip-shell shell shell-project 0.0.0 run(). -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --spirv-val --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \
189 --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > "$TARGETDIR/spv.hlslDebugInfo.frag.out"
190 diffscip-shell system . . diff. -b $BASEDIR/spv.hlslDebugInfo.frag.out "$TARGETDIR/spv.hlslDebugInfo.frag.out" || HASERROR=1
191
192 #
193 # Testing Includer
194 #
195 echoscip-shell system . . echo. Testing Includer
196 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od ../Test/hlsl.include.vert > "$TARGETDIR/hlsl.include.vert.out"
197 diffscip-shell system . . diff. -b $BASEDIR/hlsl.include.vert.out "$TARGETDIR/hlsl.include.vert.out" || HASERROR=1
198 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od hlsl.includeNegative.vert > "$TARGETDIR/hlsl.includeNegative.vert.out"
199 diffscip-shell system . . diff. -b $BASEDIR/hlsl.includeNegative.vert.out "$TARGETDIR/hlsl.includeNegative.vert.out" || HASERROR=1
200 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od hlsl.include.system.vert -Iinc1 -Iinc1/path1 -Iinc1/path2 > "$TARGETDIR/hlsl.include.system.vert.out"
201 diffscip-shell system . . diff. -b $BASEDIR/hlsl.include.system.vert.out "$TARGETDIR/hlsl.include.system.vert.out" || HASERROR=1
202 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od hlsl.include.system.unresolved.vert > "$TARGETDIR/hlsl.include.system.unresolved.vert.out"
203 diffscip-shell system . . diff. -b $BASEDIR/hlsl.include.system.unresolved.vert.out "$TARGETDIR/hlsl.include.system.unresolved.vert.out" || HASERROR=1
204 runscip-shell shell shell-project 0.0.0 run(). -l -i include.system.vert -Iinc2 > "$TARGETDIR/include.system.vert.out"
205 diffscip-shell system . . diff. -b $BASEDIR/include.system.vert.out "$TARGETDIR/include.system.vert.out" || HASERROR=1
206 runscip-shell shell shell-project 0.0.0 run(). -l -i include.vert > "$TARGETDIR/include.vert.out"
207 diffscip-shell system . . diff. -b $BASEDIR/include.vert.out "$TARGETDIR/include.vert.out" || HASERROR=1
208 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > "$TARGETDIR/hlsl.dashI.vert.out"
209 diffscip-shell system . . diff. -b $BASEDIR/hlsl.dashI.vert.out "$TARGETDIR/hlsl.dashI.vert.out" || HASERROR=1
210 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e MainPs -H -Od -g hlsl.pp.line3.frag > "$TARGETDIR/hlsl.pp.line3.frag.out"
211 diffscip-shell system . . diff. -b $BASEDIR/hlsl.pp.line3.frag.out "$TARGETDIR/hlsl.pp.line3.frag.out" || HASERROR=1
212
213 #
214 # Testing --depfile
215 #
216
217 echoscip-shell system . . echo. "Testing --depfile"
218 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H --depfile "$TARGETDIR/hlsl.include.vert.d.out" -Od ../Test/hlsl.include.vert > "$TARGETDIR/hlsl.include.vert.out"
219 diffscip-shell system . . diff. -b $BASEDIR/hlsl.include.vert.d.out "$TARGETDIR/hlsl.include.vert.d.out" || HASERROR=1
220 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -H --depfile "$TARGETDIR/hlsl.dashI.vert.d.out" -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > "$TARGETDIR/hlsl.dashI.vert.out"
221 diffscip-shell system . . diff. -b $BASEDIR/hlsl.dashI.vert.d.out "$TARGETDIR/hlsl.dashI.vert.d.out" || HASERROR=1
222 fi
223
224 #
225 # Testing -D, -U and -P
226 #
227 echoscip-shell system . . echo. "Testing -D, -U and -P"
228 runscip-shell shell shell-project 0.0.0 run(). -DUNDEFED -UIN_SHADER -DFOO=200 -i -l --U UNDEFED --define-macro MUL=FOO*2 glsl.-D-U.frag > "$TARGETDIR/glsl.-D-U.frag.out"
229 diffscip-shell system . . diff. -b $BASEDIR/glsl.-D-U.frag.out "$TARGETDIR/glsl.-D-U.frag.out" || HASERROR=1
230 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
231 runscip-shell shell shell-project 0.0.0 run(). -D -Od -e main -V -i -DUNDEFED -UIN_SHADER --D FOO=200 --undef-macro UNDEFED -Od hlsl.-D-U.frag > "$TARGETDIR/hlsl.-D-U.frag.out"
232 diffscip-shell system . . diff. -b $BASEDIR/hlsl.-D-U.frag.out "$TARGETDIR/hlsl.-D-U.frag.out" || HASERROR=1
233 fi
234 runscip-shell shell shell-project 0.0.0 run(). -P"#define TEST1" -i -l --preamble-text "#define TEST2" --p "#define TEST3" glsl.-P.frag > "$TARGETDIR/glsl.-P.frag.out"
235 diffscip-shell system . . diff. -b $BASEDIR/glsl.-P.frag.out "$TARGETDIR/glsl.-P.frag.out" || HASERROR=1
236 runscip-shell shell shell-project 0.0.0 run(). -i -l --preamble-text "vec4 getColor() { return vec4(1.0); }" glsl.-P.function.frag > "$TARGETDIR/glsl.-P.function.frag.out"
237 diffscip-shell system . . diff. -b $BASEDIR/glsl.-P.function.frag.out "$TARGETDIR/glsl.-P.function.frag.out" || HASERROR=1
238 runscip-shell shell shell-project 0.0.0 run(). -i -l --preamble-text "#extension GL_GOOGLE_include_directive : require" -I. glsl.-P.include.frag > "$TARGETDIR/glsl.-P.include.frag.out"
239 diffscip-shell system . . diff. -b $BASEDIR/glsl.-P.include.frag.out "$TARGETDIR/glsl.-P.include.frag.out" || HASERROR=1
240
241 #
242 # Test --client and --target-env
243 #
244 echoscip-shell system . . echo. "Testing --client and --target-env"
245 runscip-shell shell shell-project 0.0.0 run(). --client vulkan100 spv.targetVulkan.vert || HASERROR=1
246 runscip-shell shell shell-project 0.0.0 run(). --client opengl100 spv.targetOpenGL.vert || HASERROR=1
247 runscip-shell shell shell-project 0.0.0 run(). --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1
248 runscip-shell shell shell-project 0.0.0 run(). --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1
249 runscip-shell shell shell-project 0.0.0 run(). --target-env vulkan1.2 spv.targetVulkan.vert || HASERROR=1
250 runscip-shell shell shell-project 0.0.0 run(). --target-env opengl spv.targetOpenGL.vert || HASERROR=1
251 runscip-shell shell shell-project 0.0.0 run(). -V100 spv.targetVulkan.vert || HASERROR=1
252 runscip-shell shell shell-project 0.0.0 run(). -G100 spv.targetOpenGL.vert || HASERROR=1
253 runscip-shell shell shell-project 0.0.0 run(). --target-env spirv1.2 -V spv.targetVulkan.vert || HASERROR=1
254
255 #
256 # Testing GLSL entry point rename
257 #
258 echoscip-shell system . . echo. "Testing GLSL entry point rename"
259 runscip-shell shell shell-project 0.0.0 run(). -H -e foo --source-entrypoint main glsl.entryPointRename.vert > "$TARGETDIR/glsl.entryPointRename.vert.out"
260 diffscip-shell system . . diff. -b $BASEDIR/glsl.entryPointRename.vert.out "$TARGETDIR/glsl.entryPointRename.vert.out" || HASERROR=1
261 runscip-shell shell shell-project 0.0.0 run(). -H -e foo --source-entrypoint bar glsl.entryPointRename.vert > "$TARGETDIR/glsl.entryPointRename.vert.bad.out"
262 diffscip-shell system . . diff. -b $BASEDIR/glsl.entryPointRename.vert.bad.out "$TARGETDIR/glsl.entryPointRename.vert.bad.out" || HASERROR=1
263 runscip-shell shell shell-project 0.0.0 run(). -H -e foo --source-entrypoint main glsl.entryPointRename2.vert > "$TARGETDIR/glsl.entryPointRename2.vert.out"
264 diffscip-shell system . . diff. -b $BASEDIR/glsl.entryPointRename2.vert.out "$TARGETDIR/glsl.entryPointRename2.vert.out" || HASERROR=1
265
266 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
267 #
268 # Testing position Y inversion
269 #
270 echoscip-shell system . . echo. "Testing position Y inversion"
271 runscip-shell shell shell-project 0.0.0 run(). -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > "$TARGETDIR/hlsl.y-negate-1.vert.out"
272 diffscip-shell system . . diff. -b $BASEDIR/hlsl.y-negate-1.vert.out "$TARGETDIR/hlsl.y-negate-1.vert.out" || HASERROR=1
273 runscip-shell shell shell-project 0.0.0 run(). -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > "$TARGETDIR/hlsl.y-negate-2.vert.out"
274 diffscip-shell system . . diff. -b $BASEDIR/hlsl.y-negate-2.vert.out "$TARGETDIR/hlsl.y-negate-2.vert.out" || HASERROR=1
275 runscip-shell shell shell-project 0.0.0 run(). -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > "$TARGETDIR/hlsl.y-negate-3.vert.out"
276 diffscip-shell system . . diff. -b $BASEDIR/hlsl.y-negate-3.vert.out "$TARGETDIR/hlsl.y-negate-3.vert.out" || HASERROR=1
277
278 #
279 # Testing position W reciprocal
280 #
281 echoscip-shell system . . echo. "Testing position W reciprocal"
282 runscip-shell shell shell-project 0.0.0 run(). -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip.frag > "$TARGETDIR/hlsl.w-recip.frag.out"
283 diffscip-shell system . . diff. -b $BASEDIR/hlsl.w-recip.frag.out "$TARGETDIR/hlsl.w-recip.frag.out" || HASERROR=1
284 runscip-shell shell shell-project 0.0.0 run(). -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip2.frag > "$TARGETDIR/hlsl.w-recip2.frag.out"
285 diffscip-shell system . . diff. -b $BASEDIR/hlsl.w-recip2.frag.out "$TARGETDIR/hlsl.w-recip2.frag.out" || HASERROR=1
286
287 #
288 # Testing hlsl_functionality1
289 #
290 echoscip-shell system . . echo. "Testing hlsl_functionality1"
291 runscip-shell shell shell-project 0.0.0 run(). -H -e main -D -Od -fhlsl_functionality1 hlsl.structbuffer.incdec.frag > \
292 "$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out"
293 diffscip-shell system . . diff. -b $BASEDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out "$TARGETDIR/hlsl.structbuffer.incdec.frag.hlslfun1.out" || HASERROR=1
294 runscip-shell shell shell-project 0.0.0 run(). -H -e main -D -Od -fhlsl_functionality1 hlsl.noSemantic.functionality1.comp > \
295 "$TARGETDIR/hlsl.noSemantic.functionality1.comp.out"
296 diffscip-shell system . . diff. -b $BASEDIR/hlsl.noSemantic.functionality1.comp.out "$TARGETDIR/hlsl.noSemantic.functionality1.comp.out" || HASERROR=1
297
298 #
299 # Testing HLSL-specific PP feature expansion
300 #
301 echoscip-shell system . . echo. "Testing HLSL-specific PP feature expansion"
302 runscip-shell shell shell-project 0.0.0 run(). -D -E hlsl.pp.expand.frag > "$TARGETDIR/hlsl.pp.expand.frag.out" 2> "$TARGETDIR/hlsl.pp.expand.frag.err"
303 diffscip-shell system . . diff. -b $BASEDIR/hlsl.pp.expand.frag.out "$TARGETDIR/hlsl.pp.expand.frag.out" || HASERROR=1
304 diffscip-shell system . . diff. -b $BASEDIR/hlsl.pp.expand.frag.err "$TARGETDIR/hlsl.pp.expand.frag.err" || HASERROR=1
305 fi
306
307 #
308 # Test --nan-clamp
309 #
310 echoscip-shell system . . echo. "Testing nan-clamp"
311 runscip-shell shell shell-project 0.0.0 run(). --nan-clamp -H --aml --amb spv.400.frag > "$TARGETDIR/spv.400.frag.nanclamp.out"
312 diffscip-shell system . . diff. -b $BASEDIR/spv.400.frag.nanclamp.out "$TARGETDIR/spv.400.frag.nanclamp.out" || HASERROR=1
313
314 #
315 # Test --auto-sampled-textures
316 #
317 echoscip-shell system . . echo. "Testing auto-sampled-textures"
318 if [scip-shell system . . `[`. $ENABLE_HLSL -eq 1 ]; then
319 runscip-shell shell shell-project 0.0.0 run(). --auto-sampled-textures -H -Od -e MainPs -D -S frag hlsl.autosampledtextures.frag > "$TARGETDIR/hlsl.autosampledtextures.frag.out"
320 diffscip-shell system . . diff. -b $BASEDIR/hlsl.autosampledtextures.frag.out "$TARGETDIR/hlsl.autosampledtextures.frag.out" || HASERROR=1
321 fi
322 runscip-shell shell shell-project 0.0.0 run(). --auto-sampled-textures -H -Od -S frag glsl.autosampledtextures.frag > "$TARGETDIR/glsl.autosampledtextures.frag.out"
323 diffscip-shell system . . diff. -b $BASEDIR/glsl.autosampledtextures.frag.out "$TARGETDIR/glsl.autosampledtextures.frag.out" || HASERROR=1
324
325 # Test --glsl-version
326 #
327 echoscip-shell system . . echo. "Testing --glsl-version"
328 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 410 -V -S vert glsl.versionOverride.vert > "$TARGETDIR/glsl.versionOverride.vert.out"
329 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.vert.out "$TARGETDIR/glsl.versionOverride.vert.out" || HASERROR=1
330 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 420 -V -S frag glsl.versionOverride.frag > "$TARGETDIR/glsl.versionOverride.frag.out"
331 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.frag.out "$TARGETDIR/glsl.versionOverride.frag.out" || HASERROR=1
332 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 430 -V -S geom glsl.versionOverride.geom > "$TARGETDIR/glsl.versionOverride.geom.out"
333 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.geom.out "$TARGETDIR/glsl.versionOverride.geom.out" || HASERROR=1
334 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 440 -V -S tesc glsl.versionOverride.tesc > "$TARGETDIR/glsl.versionOverride.tesc.out"
335 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.tesc.out "$TARGETDIR/glsl.versionOverride.tesc.out" || HASERROR=1
336 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 450 -V -S tese glsl.versionOverride.tese > "$TARGETDIR/glsl.versionOverride.tese.out"
337 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.tese.out "$TARGETDIR/glsl.versionOverride.tese.out" || HASERROR=1
338 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 460 -V -S comp glsl.versionOverride.comp > "$TARGETDIR/glsl.versionOverride.comp.out"
339 diffscip-shell system . . diff. -b $BASEDIR/glsl.versionOverride.comp.out "$TARGETDIR/glsl.versionOverride.comp.out" || HASERROR=1
340
341 #
342 # Test --enhanced-msgs
343 #
344
345 echoscip-shell system . . echo. "Testing enhanced-msgs"
346 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.0.frag > "$TARGETDIR/enhanced.0.frag.out"
347 diffscip-shell system . . diff. -b $BASEDIR/enhanced.0.frag.out "$TARGETDIR/enhanced.0.frag.out" || HASERROR=1
348 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.1.frag > "$TARGETDIR/enhanced.1.frag.out"
349 diffscip-shell system . . diff. -b $BASEDIR/enhanced.1.frag.out "$TARGETDIR/enhanced.1.frag.out" || HASERROR=1
350 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.2.frag > "$TARGETDIR/enhanced.2.frag.out"
351 diffscip-shell system . . diff. -b $BASEDIR/enhanced.2.frag.out "$TARGETDIR/enhanced.2.frag.out" || HASERROR=1
352 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.3.vert enhanced.3.frag > "$TARGETDIR/enhanced.3.link.out"
353 diffscip-shell system . . diff. -b $BASEDIR/enhanced.3.link.out "$TARGETDIR/enhanced.3.link.out" || HASERROR=1
354 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.4.vert enhanced.4.frag > "$TARGETDIR/enhanced.4.link.out"
355 diffscip-shell system . . diff. -b $BASEDIR/enhanced.4.link.out "$TARGETDIR/enhanced.4.link.out" || HASERROR=1
356 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.5.vert enhanced.5.frag > "$TARGETDIR/enhanced.5.link.out"
357 diffscip-shell system . . diff. -b $BASEDIR/enhanced.5.link.out "$TARGETDIR/enhanced.5.link.out" || HASERROR=1
358 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.6.vert enhanced.6.frag > "$TARGETDIR/enhanced.6.link.out"
359 diffscip-shell system . . diff. -b $BASEDIR/enhanced.6.link.out "$TARGETDIR/enhanced.6.link.out" || HASERROR=1
360 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml enhanced.7.vert enhanced.7.frag > "$TARGETDIR/enhanced.7.link.out"
361 diffscip-shell system . . diff. -b $BASEDIR/enhanced.7.link.out "$TARGETDIR/enhanced.7.link.out" || HASERROR=1
362 runscip-shell shell shell-project 0.0.0 run(). --enhanced-msgs -V --target-env vulkan1.2 --amb --aml spv.textureError.frag > "$TARGETDIR/spv.textureError.frag.out"
363 diffscip-shell system . . diff. -b $BASEDIR/spv.textureError.frag.out "$TARGETDIR/spv.textureError.frag.out" || HASERROR=1
364
365 #
366 # Test error column
367 #
368 echoscip-shell system . . echo. "Testing error-column"
369 runscip-shell shell shell-project 0.0.0 run(). --error-column -C -V error-column.vert > "$TARGETDIR/error-column.vert.out"
370 diffscip-shell system . . diff. -b $BASEDIR/error-column.vert.out $TARGETDIR/error-column.vert.out || HASERROR=1
371
372 #
373 # Test UTF8BOM
374 #
375 echoscip-shell system . . echo. "Testing UTF8BOM"
376 runscip-shell shell shell-project 0.0.0 run(). --glsl-version 410 -V -S vert UTF8BOM.vert > $TARGETDIR/UTF8BOM.vert.out
377 diffscip-shell system . . diff. -b $BASEDIR/UTF8BOM.vert.out $TARGETDIR/UTF8BOM.vert.out || HASERROR=1
378
379 #
380 # Test LTO
381 #
382 echoscip-shell system . . echo. "Testing link-time optimization"
383 runscip-shell shell shell-project 0.0.0 run(). -V -H --amb --aml -l --lto link.crossStageOptimization.vert link.crossStageOptimization.frag > "$TARGETDIR/link.crossStageOptimization.out"
384 diffscip-shell system . . diff. -b $BASEDIR/link.crossStageOptimization.out "$TARGETDIR/link.crossStageOptimization.out" || HASERROR=1
385
386 #
387 # Final checking
388 #
389 if [scip-shell system . . `[`. $HASERROR -eq 0 ]
390 then
391 echoscip-shell system . . echo. Tests Succeeded.
392 else
393 echoscip-shell system . . echo. Tests Failed.
394 fi
395
396 rmscip-shell system . . rm. -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv
397
398 exit $HASERROR