This repository has been archived by the owner on Jul 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
/
run_wrap_objects_tests.sh
executable file
·158 lines (129 loc) · 5.11 KB
/
run_wrap_objects_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/bash
pushd $(dirname "$0") > /dev/null
vk_layer_path=$VK_LAYER_PATH:`pwd`/layers:../layers
ld_library_path=$LD_LIBRARY_PATH:`pwd`/layers:../layers
# Check for insertion of wrap-objects layer.
output=$(VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
VK_LOADER_DEBUG=all \
GTEST_FILTER=WrapObjects.Insert \
./vk_loader_validation_tests 2>&1)
echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2
exit 1
fi
echo "$output" | grep -q "Inserted device layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2
exit 1
fi
echo "Insertion test PASSED"
# Check for insertion of wrap-objects layer in front.
output=$(VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_parameter_validation:VK_LAYER_LUNARG_wrap_objects \
VK_LOADER_DEBUG=all \
GTEST_FILTER=WrapObjects.Insert \
./vk_loader_validation_tests 2>&1)
echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2
exit 1
fi
echo "$output" | grep -q "Inserted device layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2
exit 1
fi
echo "Front insertion test PASSED"
# Check for insertion of wrap-objects layer in back.
output=$(VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
VK_LOADER_DEBUG=all \
GTEST_FILTER=WrapObjects.Insert \
./vk_loader_validation_tests 2>&1)
echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2
exit 1
fi
echo "$output" | grep -q "Inserted device layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2
exit 1
fi
echo "Back insertion test PASSED"
# Check for insertion of wrap-objects layer in middle.
output=$(VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_core_validation:VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \
VK_LOADER_DEBUG=all \
GTEST_FILTER=WrapObjects.Insert \
./vk_loader_validation_tests 2>&1)
echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2
exit 1
fi
echo "$output" | grep -q "Inserted device layer VK_LAYER_LUNARG_wrap_objects"
ec=$?
if [ $ec -eq 1 ]
then
echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2
exit 1
fi
echo "Middle insertion test PASSED"
# Run a sanity check to make sure the validation tests can be run in the current environment.
GTEST_PRINT_TIME=0 \
VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
GTEST_FILTER=VkLayerTest.ReservedParameter \
./vk_layer_validation_tests > /dev/null
ec=$?
if [ $ec -ne 0 ]
then
echo "Execution test FAILED - there may be a problem executing the layer validation tests" >&2
exit 1
fi
# Pick a random subset of valid LVT tests to wrap -- None of these can use the device profile API extension!
filter=VkLayerTest.ThreadCommandBufferCollision:VkLayerTest.ImageDescriptorLayoutMismatch:VkLayerTest.CreateBufferViewNoMemoryBoundToBuffer:VkLayerTest.CommandBufferResetErrors:VkLayerTest.PSOLineWidthInvalid:VkLayerTest.EndCommandBufferWithinRenderPass:VkLayerTest.DSBufferLimitErrors:VkLayerTest.InvalidImageLayout:VkLayerTest.CreatePipelineVsFsMismatchByLocation:VkLayerTest.ImageBufferCopyTests:VkLayerTest.ClearImageErrors:VkPositiveLayerTest.NonCoherentMemoryMapping:VkPositiveLayerTest.BarrierLayoutToImageUsage:VkPositiveLayerTest.TwoSubmitInfosWithSemaphoreOneQueueSubmitsOneFence
# Run the layer validation tests with and without the wrap-objects layer. Diff the results.
# Filter out the "Unexpected:" lines because they contain varying object handles.
GTEST_PRINT_TIME=0 \
VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
GTEST_FILTER=$filter \
./vk_layer_validation_tests | grep -v "^Unexpected: " > unwrapped.out
GTEST_PRINT_TIME=0 \
VK_LAYER_PATH=$vk_layer_path \
LD_LIBRARY_PATH=$ld_library_path \
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \
GTEST_FILTER=$filter \
./vk_layer_validation_tests | grep -v "^Unexpected: " > wrapped.out
diff unwrapped.out wrapped.out
ec=$?
if [ $ec -eq 1 ]
then
echo "Wrap-objects layer validation tests FAILED - wrap-objects altered the results of the layer validation tests" >&2
exit 1
fi
echo "Wrap-objects layer validation tests PASSED"
popd > /dev/null
exit 0