blob: d1b43adf2ff627e9bbb9604712b7857368cd318a [file] [log] [blame]
Jon Ashburnd45cf272016-05-11 16:57:26 -06001#!/bin/bash
2
3pushd $(dirname "$0") > /dev/null
4
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -06005# Check for insertion of wrap-objects layer.
6output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
Jon Ashburnd45cf272016-05-11 16:57:26 -06007 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
8 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -06009 VK_LOADER_DEBUG=all \
10 GTEST_FILTER=WrapObjects.Insert \
11 ./vk_loader_validation_tests 2>&1)
Jon Ashburnd45cf272016-05-11 16:57:26 -060012
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -060013echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
14ec=$?
Jon Ashburnd45cf272016-05-11 16:57:26 -060015
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -060016if [ $ec -eq 1 ]
Jon Ashburnd45cf272016-05-11 16:57:26 -060017then
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -060018 echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2
Jon Ashburnd45cf272016-05-11 16:57:26 -060019 exit 1
20fi
21
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -060022echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
23ec=$?
24
25if [ $ec -eq 1 ]
26then
27 echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2
28 exit 1
29fi
30echo "Insertion test PASSED"
31
32# Check for insertion of wrap-objects layer in front.
33output=$(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 \
36 VK_LOADER_DEBUG=all \
37 GTEST_FILTER=WrapObjects.Insert \
38 ./vk_loader_validation_tests 2>&1)
39
40echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
41ec=$?
42
43if [ $ec -eq 1 ]
44then
45 echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2
46 exit 1
47fi
48
49echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
50ec=$?
51
52if [ $ec -eq 1 ]
53then
54 echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2
55 exit 1
56fi
57echo "Front insertion test PASSED"
58
59# Check for insertion of wrap-objects layer in back.
60output=$(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 \
63 VK_LOADER_DEBUG=all \
64 GTEST_FILTER=WrapObjects.Insert \
65 ./vk_loader_validation_tests 2>&1)
66
67echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
68ec=$?
69
70if [ $ec -eq 1 ]
71then
72 echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2
73 exit 1
74fi
75
76echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
77ec=$?
78
79if [ $ec -eq 1 ]
80then
81 echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2
82 exit 1
83fi
84echo "Back insertion test PASSED"
85
86# Check for insertion of wrap-objects layer in middle.
87output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \
88 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \
Mark Lobodzinskie7353872016-06-29 14:21:38 -060089 VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_image:VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -060090 VK_LOADER_DEBUG=all \
91 GTEST_FILTER=WrapObjects.Insert \
92 ./vk_loader_validation_tests 2>&1)
93
94echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
95ec=$?
96
97if [ $ec -eq 1 ]
98then
99 echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2
100 exit 1
101fi
102
103echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects"
104ec=$?
105
106if [ $ec -eq 1 ]
107then
108 echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2
109 exit 1
110fi
111echo "Middle insertion test PASSED"
112
113# Run the layer validation tests with and without the wrap-objects layer. Diff the results.
Mike Stroyane8d47542016-09-27 14:13:14 -0600114# Filter out the "Unexpected:" lines because they contain varying object handles.
115GTEST_PRINT_TIME=0 \
116 ./vk_layer_validation_tests | grep -v "^Unexpected: " > unwrapped.out
117GTEST_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 | grep -v "^Unexpected: " > wrapped.out
122diff unwrapped.out wrapped.out
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -0600123ec=$?
124
125if [ $ec -eq 1 ]
126then
Jeremy Hayesde2b7232016-06-30 10:13:35 -0600127 echo "Wrap-objects layer validation tests FAILED - wrap-objects altered the results of the layer validation tests" >&2
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -0600128 exit 1
129fi
Jeremy Hayesde2b7232016-06-30 10:13:35 -0600130echo "Wrap-objects layer validation tests PASSED"
Jon Ashburnd45cf272016-05-11 16:57:26 -0600131
Jeremy Hayesfb5c9d82016-06-28 11:29:05 -0600132popd > /dev/null
133
Jon Ashburnd45cf272016-05-11 16:57:26 -0600134exit 0