Remove them from the calling scripts where appropriate. Notably the 'get count
then run tests and pass in count' are now using the framework where that is
completely redundant.
Change-Id: I00d561a85047742a849df48818398b10c62d3b74
* `get_instance_func` needed to have __stdcall (VKAPI_ATTR) added
* Several .def files were incorrect
* vk_layer.h forward declares vkNegotiateLoaderLayerInterfaceVersion. This is
problomatic because it doesn't have __declspec(dllexport), a token added by
FRAMEWORK_EXPORT on windows. We have to special case the export macro here to
prevent that mismatched definition.
Functions needed in the various layer interface versions are now
exported as well as guarded behind macros configurable from CMake.
The export_definitions folder was populated as well.
Change-Id: Iebfdd8ae02062eb81b8aa9f705885c9384c95be9
This replaces instances of `#ifdef MACRO_NAME` with `#if MACRO_NAME` as now
MACRO_NAME will have a value of 0 or 1, instead of it being defined or not
defined.
Change-Id: I27a4330511a0f0d779f41851fe816fc79e868de2
Make sure the work space is clean before starting a test, this is mainly for developer builds, as CI
runs will generally wipe the entire build tree instead.
Main issue was getting function redireciton to work, dyld-interposer accomplishes that.
It required making the shim-library a dylib, but otherwise only required minor changes.
Change-Id: I7b7e2c86cc0c0b082f58241a7e146b74af72e792
Since the loader only uses environment variables if the process is
not running with elevated priviledges, the test harness needs to be
able to control that aspect to ensure consistency as CI systems may
run the tests in an 'elevated' context.
Change-Id: I8b15a1ecd4ab4960049ba198af8199943e872bba
Move windows specific error reporting to test_util.h
This allows for its use anywhere its required.
Change-Id: I14a0da85dc0d3f4e651b99aa005469b47d98d940
_stdcall in Windows x86 builds would mangle names even with `export "C"`
By adding .def files, the correct name is used in the .dll and the loader will
correctly load it.
Additionally, ShimEnumAdapters2 needs _stdcall for 32 bit mode
Change-Id: Ia60a5e2a9e4378dc3e09864648e04852b10fe524
These files are the current 4 source code files used to create the
regression test suite
loader_regression_tests.cpp and loader_version_tests.cpp contain a
majority of the tests.
loader_wsi_test.cpp is all the tests pertaining to the WSI functions
in the loader.
loader_testing_main.cpp contains the `main()` which has windows CRT
specific calls to disable popups and debug aserts.
There are two executables created, test_regression and test_wsi.
test_regression is both regression_tests and version_tests. test_wsi
is the WSI tests. These tests are separate as they rely on linking
with platform specific windowing libraries which may not be present
on a CI system.
Change-Id: I1c02b0f82826d337599f4a9a7c02dde40ea5afa3
The test environment is the code which glues the platform shim,
TestICD, and TestLayers together so that test code can be easily
written. The main components tests use are the SingleICDShim and
MultipleICDShim classes. Both take care of copying the ICD binaries,
setting up the manifests, and redirecting the platform specific
systems to point at those manifests.
Change-Id: I7cbb76c9555fe13b323173c3838cbb3616b77a18
At the present moment, this change is to define simple layer
utilities that tests in the future may use.
Change-Id: I9ab5e1950da64061997891a0527d0f70a49e41e7
The loader queries various platform systems for info such as the
location of ICDs and layers. To isolate the loader during testing
from the system it is running on, the platform shim intercepts the
necessary functions so that the contents of the systems queried by
the loader can be configured by tests.
On windows this involves 2 aspects:
Detouring Win32 API functions and redirecting the registry.
The `Detours` library is used to easily capture Win32 API calls.
And the registry uses `RegOverridePredefKey` to redirect the registry
entries the loader accesses.
On linux this only involves intercepting 3 functions; `opendir`,
`access`, and `fopen`. This allows the framework to tell the loader
what to actuall open/access/fopen. These interceptions call the
underlying function but with altered arguments, specifically to
paths the tests set up.
Change-Id: I3531a1cb190c489ffd9f1f0549d0ebcacb3818c5
The TestICD is a configurable ICD which can recreate much of the
behavior the loader expects of an ICD. Combined with a direct line
of communication between the tests and TestICD, tests can setup
specific conditions that have a known response from the loader,
thus allowing proper regression testing.
Change-Id: I84303f0ddb6011fc1b76dad25fd249abb2da29c9
Create the CMake infrastructure for a testing framework.
`test_util.h/.cpp` contains the core macros, wrappers, and utilities.
framework_config.h.in is the header that other components include
to get the full path to binaries on a system.
Change-Id: I3e24a3ee4ff24da499a3bca63059e3b872d3981c
changes:
* loader/loader.c: cast dxgi_factory to void** type
* tests/loader_validation_tests.cpp: check if __STDC_FORMAT_MACROS is already defined
* tests/test_common.h: check if NOMINMAX is already defined
* tests/test_commogn.h: check _MSC_VER instead of WIN32 before pragma warning directive
Change-Id: I2fd78b760a90c2ac0e6463a60f5593a24ca904b8
Building the tests outside of msvc wouldn't work due to improper setup.
This commit fixes the typos and missing debug/release switches for
google-test.
Change-Id: Ifdc2cdab8236c35ba9e14663fffaa412f40aaa6a
This option should not have been used, as an application that statically
links to the loader is likely to break as a result of driver updates.
Change-Id: I6bc05ac6fac601f439274fd8efeb0cd76564ccd1
This CL adds the enable_testing() cmake call and registers
vk_loader_validation_tests as a test in cmake.
This allows the test to be run when `ctest` is executed.
Change-Id: I57fd579c7625fbf7bbd468a5716e3a68b601c1fd
The `VkDebugUtilsObjectNameInfoEXT` member of the
`VkDebugUtilsMessengerCallbackDataEXT` struct was turned const in Vulkan
header 1.1.95 and modifications were required for compilation
Change-Id: I0e52d821239a2b74c8880864a9522359f2285d72
Note that references in scripts/common_codegen.py and
scripts/loader_extension_generator.py will need to be
removed later
Change-Id: I7b17c80f7a06a339d7df0c199ff556212a7c6534