• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3pushd $(dirname "$0") > /dev/null
4
5RunCreateInstanceTest()
6{
7    # Check for layer insertion via CreateInstance.
8    output=$(VK_LOADER_DEBUG=all \
9       GTEST_FILTER=CreateInstance.LayerPresent \
10       ./vk_loader_validation_tests 2>&1)
11
12    echo "$output" | grep -q "Insert instance layer VK_LAYER_LUNARG_parameter_validation"
13    ec=$?
14
15    if [ $ec -eq 1 ]
16    then
17       echo "CreateInstance insertion test FAILED - parameter-validation not detected in instance layers" >&2
18       exit 1
19    fi
20    echo "CreateInstance Insertion test PASSED"
21}
22
23RunEnumerateInstanceLayerPropertiesTest()
24{
25    count=$(GTEST_FILTER=EnumerateInstanceLayerProperties.Count \
26        ./vk_loader_validation_tests count 2>&1 |
27        grep -o 'count=[0-9]\+' | sed 's/^.*=//')
28
29    if [ "$count" -gt 1 ]
30    then
31        diff \
32            <(GTEST_PRINT_TIME=0 \
33                GTEST_FILTER=EnumerateInstanceLayerProperties.OnePass \
34                ./vk_loader_validation_tests count "$count" properties 2>&1 |
35                grep 'properties') \
36            <(GTEST_PRINT_TIME=0 \
37                GTEST_FILTER=EnumerateInstanceLayerProperties.TwoPass \
38                ./vk_loader_validation_tests properties 2>&1 |
39                grep 'properties')
40    fi
41    ec=$?
42
43    if [ $ec -eq 1 ]
44    then
45        echo "EnumerateInstanceLayerProperties OnePass vs TwoPass test FAILED - properties do not match" >&2
46        exit 1
47    fi
48    echo "EnumerateInstanceLayerProperties OnePass vs TwoPass test PASSED"
49}
50
51RunEnumerateInstanceExtensionPropertiesTest()
52{
53    count=$(GTEST_FILTER=EnumerateInstanceExtensionProperties.Count \
54        ./vk_loader_validation_tests count 2>&1 |
55        grep -o 'count=[0-9]\+' | sed 's/^.*=//')
56
57    if [ "$count" -gt 1 ]
58    then
59        diff \
60            <(GTEST_PRINT_TIME=0 \
61                GTEST_FILTER=EnumerateInstanceExtensionProperties.OnePass \
62                ./vk_loader_validation_tests count "$count" properties 2>&1 |
63                grep 'properties') \
64            <(GTEST_PRINT_TIME=0 \
65                GTEST_FILTER=EnumerateInstanceExtensionProperties.TwoPass \
66                ./vk_loader_validation_tests properties 2>&1 |
67                grep 'properties')
68    fi
69    ec=$?
70
71    if [ $ec -eq 1 ]
72    then
73        echo "EnumerateInstanceExtensionProperties OnePass vs TwoPass test FAILED - properties do not match" >&2
74        exit 1
75    fi
76    echo "EnumerateInstanceExtensionProperties OnePass vs TwoPass test PASSED"
77}
78
79./vk_loader_validation_tests
80
81RunCreateInstanceTest
82RunEnumerateInstanceLayerPropertiesTest
83RunEnumerateInstanceExtensionPropertiesTest
84
85# Test the wrap objects layer.
86./run_wrap_objects_tests.sh || exit 1
87
88popd > /dev/null
89