Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | pushd $(dirname "$0") > /dev/null |
| 4 | |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 5 | # Check for insertion of wrap-objects layer. |
| 6 | output=$(VK_LAYER_PATH=$VK_LAYER_PATH:`pwd`/layers \ |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 7 | LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/layers \ |
| 8 | VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_wrap_objects \ |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 9 | VK_LOADER_DEBUG=all \ |
| 10 | GTEST_FILTER=WrapObjects.Insert \ |
| 11 | ./vk_loader_validation_tests 2>&1) |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 12 | |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 13 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 14 | ec=$? |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 15 | |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 16 | if [ $ec -eq 1 ] |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 17 | then |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 18 | echo "Insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 19 | exit 1 |
| 20 | fi |
| 21 | |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 22 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 23 | ec=$? |
| 24 | |
| 25 | if [ $ec -eq 1 ] |
| 26 | then |
| 27 | echo "Insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 28 | exit 1 |
| 29 | fi |
| 30 | echo "Insertion test PASSED" |
| 31 | |
| 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 \ |
| 36 | VK_LOADER_DEBUG=all \ |
| 37 | GTEST_FILTER=WrapObjects.Insert \ |
| 38 | ./vk_loader_validation_tests 2>&1) |
| 39 | |
| 40 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 41 | ec=$? |
| 42 | |
| 43 | if [ $ec -eq 1 ] |
| 44 | then |
| 45 | echo "Front insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 46 | exit 1 |
| 47 | fi |
| 48 | |
| 49 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 50 | ec=$? |
| 51 | |
| 52 | if [ $ec -eq 1 ] |
| 53 | then |
| 54 | echo "Front insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 55 | exit 1 |
| 56 | fi |
| 57 | echo "Front insertion test PASSED" |
| 58 | |
| 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 \ |
| 63 | VK_LOADER_DEBUG=all \ |
| 64 | GTEST_FILTER=WrapObjects.Insert \ |
| 65 | ./vk_loader_validation_tests 2>&1) |
| 66 | |
| 67 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 68 | ec=$? |
| 69 | |
| 70 | if [ $ec -eq 1 ] |
| 71 | then |
| 72 | echo "Back insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 73 | exit 1 |
| 74 | fi |
| 75 | |
| 76 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 77 | ec=$? |
| 78 | |
| 79 | if [ $ec -eq 1 ] |
| 80 | then |
| 81 | echo "Back insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 82 | exit 1 |
| 83 | fi |
| 84 | echo "Back insertion test PASSED" |
| 85 | |
| 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 \ |
Mark Lobodzinski | e735387 | 2016-06-29 14:21:38 -0600 | [diff] [blame] | 89 | VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_image:VK_LAYER_LUNARG_wrap_objects:VK_LAYER_LUNARG_parameter_validation \ |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 90 | VK_LOADER_DEBUG=all \ |
| 91 | GTEST_FILTER=WrapObjects.Insert \ |
| 92 | ./vk_loader_validation_tests 2>&1) |
| 93 | |
| 94 | echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_wrap_objects" |
| 95 | ec=$? |
| 96 | |
| 97 | if [ $ec -eq 1 ] |
| 98 | then |
| 99 | echo "Middle insertion test FAILED - wrap-objects not detected in instance layers" >&2 |
| 100 | exit 1 |
| 101 | fi |
| 102 | |
| 103 | echo "$output" | grep -q "Insert device layer VK_LAYER_LUNARG_wrap_objects" |
| 104 | ec=$? |
| 105 | |
| 106 | if [ $ec -eq 1 ] |
| 107 | then |
| 108 | echo "Middle insertion test FAILED - wrap-objects not detected in device layers" >&2 |
| 109 | exit 1 |
| 110 | fi |
| 111 | echo "Middle insertion test PASSED" |
| 112 | |
| 113 | # Run the layer validation tests with and without the wrap-objects layer. Diff the results. |
Mike Stroyan | e8d4754 | 2016-09-27 14:13:14 -0600 | [diff] [blame] | 114 | # Filter out the "Unexpected:" lines because they contain varying object handles. |
| 115 | GTEST_PRINT_TIME=0 \ |
| 116 | ./vk_layer_validation_tests | grep -v "^Unexpected: " > unwrapped.out |
| 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 | grep -v "^Unexpected: " > wrapped.out |
| 122 | diff unwrapped.out wrapped.out |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 123 | ec=$? |
| 124 | |
| 125 | if [ $ec -eq 1 ] |
| 126 | then |
Jeremy Hayes | de2b723 | 2016-06-30 10:13:35 -0600 | [diff] [blame] | 127 | echo "Wrap-objects layer validation tests FAILED - wrap-objects altered the results of the layer validation tests" >&2 |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 128 | exit 1 |
| 129 | fi |
Jeremy Hayes | de2b723 | 2016-06-30 10:13:35 -0600 | [diff] [blame] | 130 | echo "Wrap-objects layer validation tests PASSED" |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 131 | |
Jeremy Hayes | fb5c9d8 | 2016-06-28 11:29:05 -0600 | [diff] [blame] | 132 | popd > /dev/null |
| 133 | |
Jon Ashburn | d45cf27 | 2016-05-11 16:57:26 -0600 | [diff] [blame] | 134 | exit 0 |