blob: 2f19f3b7dac960243df019f64803d940e14f4eb1 [file] [log] [blame]
Jon Ashburn55585ed2016-05-11 16:57:26 -06001#!/bin/bash
2
3pushd $(dirname "$0") > /dev/null
4
5echo "Testing wrap-objects layer..."
6
Jeremy Hayesc5587182016-06-28 11:29:05 -06007# Check for insertion of wrap-objects layer.
8output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
Jon Ashburn55585ed2016-05-11 16:57:26 -06009 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
10 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
Jeremy Hayesc5587182016-06-28 11:29:05 -060011 VK_LOADER_DEBUG=all \
12 GTEST_FILTER=WrapObjects.Insert \
13 ./vk_loader_validation_tests 2>&1)
Jon Ashburn55585ed2016-05-11 16:57:26 -060014
Jeremy Hayesc5587182016-06-28 11:29:05 -060015echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
16ec=$?
Jon Ashburn55585ed2016-05-11 16:57:26 -060017
Jeremy Hayesc5587182016-06-28 11:29:05 -060018if [ $ec -eq 1 ]
Jon Ashburn55585ed2016-05-11 16:57:26 -060019then
Jeremy Hayesc5587182016-06-28 11:29:05 -060020 echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2
Jon Ashburn55585ed2016-05-11 16:57:26 -060021 exit 1
22fi
23
Jeremy Hayesc5587182016-06-28 11:29:05 -060024echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
25ec=$?
26
27if [ $ec -eq 1 ]
28then
29 echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2
30 exit 1
31fi
32echo "Insertion test PASSED"
33
34# Check for insertion of wrap-objects layer in front.
35output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
36 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
37 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_parameter_validation:VK_LAYER_LUNARG_wrap_objects \
38 VK_LOADER_DEBUG=all \
39 GTEST_FILTER=WrapObjects.Insert \
40 ./vk_loader_validation_tests 2>&1)
41
42echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
43ec=$?
44
45if [ $ec -eq 1 ]
46then
47 echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2
48 exit 1
49fi
50
51echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
52ec=$?
53
54if [ $ec -eq 1 ]
55then
56 echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2
57 exit 1
58fi
59echo "Front insertion test PASSED"
60
61# Check for insertion of wrap-objects layer in back.
62output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
63 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
64 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
65 VK_LOADER_DEBUG=all \
66 GTEST_FILTER=WrapObjects.Insert \
67 ./vk_loader_validation_tests 2>&1)
68
69echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
70ec=$?
71
72if [ $ec -eq 1 ]
73then
74 echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2
75 exit 1
76fi
77
78echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
79ec=$?
80
81if [ $ec -eq 1 ]
82then
83 echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2
84 exit 1
85fi
86echo "Back insertion test PASSED"
87
88# Check for insertion of wrap-objects layer in middle.
89output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
90 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
91 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_device_limits:VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
92 VK_LOADER_DEBUG=all \
93 GTEST_FILTER=WrapObjects.Insert \
94 ./vk_loader_validation_tests 2>&1)
95
96echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
97ec=$?
98
99if [ $ec -eq 1 ]
100then
101 echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2
102 exit 1
103fi
104
105echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
106ec=$?
107
108if [ $ec -eq 1 ]
109then
110 echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2
111 exit 1
112fi
113echo "Middle insertion test PASSED"
114
115# Run the layer validation tests with and without the wrap-objects layer. Diff the results.
116diff \
117 <(GTEST_PRINT_TIME=0 \
118 ./vk_layer_validation_tests) \
119 <(GTEST_PRINT_TIME=0 \
120 VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
121 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
122 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
123 ./vk_layer_validation_tests)
124ec=$?
125
126if [ $ec -eq 1 ]
127then
128 echo "TEST FAILED - wrap-objects altered the results of the layer validation tests" >&2
129 exit 1
130fi
131echo "wrap-objects completed layer validation tests"
132
Jon Ashburn55585ed2016-05-11 16:57:26 -0600133echo "TEST PASSED"
134
Jeremy Hayesc5587182016-06-28 11:29:05 -0600135popd > /dev/null
136
Jon Ashburn55585ed2016-05-11 16:57:26 -0600137exit 0