3 pushd $(dirname "$0") > /dev/null
5 # Check for insertion of wrap-objects layer.
6 output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
7 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
8 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
10 GTEST_FILTER=WrapObjects.Insert \
11 ./vk_loader_validation_tests 2>&1)
13 echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
18 echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2
22 echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
27 echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2
30 echo "Insertion test PASSED"
32 # Check for insertion of wrap-objects layer in front.
33 output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
34 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
35 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_parameter_validation:VK_LAYER_LUNARG_wrap_objects \
37 GTEST_FILTER=WrapObjects.Insert \
38 ./vk_loader_validation_tests 2>&1)
40 echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
45 echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2
49 echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
54 echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2
57 echo "Front insertion test PASSED"
59 # Check for insertion of wrap-objects layer in back.
60 output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
61 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
62 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
64 GTEST_FILTER=WrapObjects.Insert \
65 ./vk_loader_validation_tests 2>&1)
67 echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
72 echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2
76 echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
81 echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2
84 echo "Back insertion test PASSED"
86 # Check for insertion of wrap-objects layer in middle.
87 output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
88 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
89 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_image:VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
91 GTEST_FILTER=WrapObjects.Insert \
92 ./vk_loader_validation_tests 2>&1)
94 echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
99 echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2
103 echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
108 echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2
111 echo "Middle insertion test PASSED"
113 # Run the layer validation tests with and without the wrap-objects layer. Diff the results.
115 <(GTEST_PRINT_TIME=0 \
116 ./vk_layer_validation_tests) \
117 <(GTEST_PRINT_TIME=0 \
118 VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
119 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
120 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
121 ./vk_layer_validation_tests)
126 echo "Wrap-objects layer validation tests FAILED - wrap-objects altered the results of the layer validation tests" >&2
129 echo "Wrap-objects layer validation tests PASSED"