Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | pushd $(dirname "$0") > /dev/null |
| 4 | |
| 5 | echo "Testing wrap-objects layer..." |
| 6 | |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 7 | # Check for insertion of wrap-objects layer. |
| 8 | output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \ |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 9 | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \ |
| 10 | VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \ |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 11 | VK_LOADER_DEBUG=all \ |
| 12 | GTEST_FILTER=WrapObjects.Insert \ |
| 13 | ./vk_loader_validation_tests 2>&1) |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 14 | |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 15 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 16 | ec=$? |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 17 | |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 18 | if [ $ec -eq 1 ] |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 19 | then |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 20 | echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 21 | exit 1 |
| 22 | fi |
| 23 | |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 24 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 25 | ec=$? |
| 26 | |
| 27 | if [ $ec -eq 1 ] |
| 28 | then |
| 29 | echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | echo "Insertion test PASSED" |
| 33 | |
| 34 | # Check for insertion of wrap-objects layer in front. |
| 35 | output=$(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 | |
| 42 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 43 | ec=$? |
| 44 | |
| 45 | if [ $ec -eq 1 ] |
| 46 | then |
| 47 | echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 48 | exit 1 |
| 49 | fi |
| 50 | |
| 51 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 52 | ec=$? |
| 53 | |
| 54 | if [ $ec -eq 1 ] |
| 55 | then |
| 56 | echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 57 | exit 1 |
| 58 | fi |
| 59 | echo "Front insertion test PASSED" |
| 60 | |
| 61 | # Check for insertion of wrap-objects layer in back. |
| 62 | output=$(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 | |
| 69 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 70 | ec=$? |
| 71 | |
| 72 | if [ $ec -eq 1 ] |
| 73 | then |
| 74 | echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 75 | exit 1 |
| 76 | fi |
| 77 | |
| 78 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 79 | ec=$? |
| 80 | |
| 81 | if [ $ec -eq 1 ] |
| 82 | then |
| 83 | echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 84 | exit 1 |
| 85 | fi |
| 86 | echo "Back insertion test PASSED" |
| 87 | |
| 88 | # Check for insertion of wrap-objects layer in middle. |
| 89 | output=$(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 | |
| 96 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 97 | ec=$? |
| 98 | |
| 99 | if [ $ec -eq 1 ] |
| 100 | then |
| 101 | echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 102 | exit 1 |
| 103 | fi |
| 104 | |
| 105 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 106 | ec=$? |
| 107 | |
| 108 | if [ $ec -eq 1 ] |
| 109 | then |
| 110 | echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 111 | exit 1 |
| 112 | fi |
| 113 | echo "Middle insertion test PASSED" |
| 114 | |
| 115 | # Run the layer validation tests with and without the wrap-objects layer. Diff the results. |
| 116 | diff \ |
| 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) |
| 124 | ec=$? |
| 125 | |
| 126 | if [ $ec -eq 1 ] |
| 127 | then |
| 128 | echo "TEST FAILED - wrap-objects altered the results of the layer validation tests" >&2 |
| 129 | exit 1 |
| 130 | fi |
| 131 | echo "wrap-objects completed layer validation tests" |
| 132 | |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 133 | echo "TEST PASSED" |
| 134 | |
Jeremy Hayes | c558718 | 2016-06-28 11:29:05 -0600 | [diff] [blame^] | 135 | popd > /dev/null |
| 136 | |
Jon Ashburn | 55585ed | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 137 | exit 0 |