xref: /aosp_15_r20/external/gmmlib/Source/GmmLib/ULT/ReadMe.txt (revision 35ffd701415c9e32e53136d61a677a8d0a8fc4a5)
1*35ffd701SAndroid Build Coastguard Worker========================================================================
2*35ffd701SAndroid Build Coastguard Worker    CONSOLE APPLICATION : GmmLibULT Project Overview
3*35ffd701SAndroid Build Coastguard Worker========================================================================
4*35ffd701SAndroid Build Coastguard WorkerGMM ULT for the GMM Cache Policy.
5*35ffd701SAndroid Build Coastguard Worker
6*35ffd701SAndroid Build Coastguard Worker
7*35ffd701SAndroid Build Coastguard WorkerGmmLibULT.vcxproj
8*35ffd701SAndroid Build Coastguard Worker    This is the main project file.
9*35ffd701SAndroid Build Coastguard Worker
10*35ffd701SAndroid Build Coastguard WorkerGmmLibULT.vcxproj.filters
11*35ffd701SAndroid Build Coastguard Worker    This is the filters file for VC++ project.
12*35ffd701SAndroid Build Coastguard Worker    It contains information about the association between the files in your project
13*35ffd701SAndroid Build Coastguard Worker    and the filters. This association is used in the IDE to show grouping of files with
14*35ffd701SAndroid Build Coastguard Worker    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
15*35ffd701SAndroid Build Coastguard Worker    "Source Files" filter).
16*35ffd701SAndroid Build Coastguard Worker
17*35ffd701SAndroid Build Coastguard WorkerGmmLibULT.cpp
18*35ffd701SAndroid Build Coastguard Worker    This is the main application source file.
19*35ffd701SAndroid Build Coastguard Worker
20*35ffd701SAndroid Build Coastguard Worker/////////////////////////////////////////////////////////////////////////////
21*35ffd701SAndroid Build Coastguard WorkerOther standard files:
22*35ffd701SAndroid Build Coastguard Worker
23*35ffd701SAndroid Build Coastguard WorkerStdAfx.h, StdAfx.cpp
24*35ffd701SAndroid Build Coastguard Worker    These files are used to build a precompiled header (PCH) file
25*35ffd701SAndroid Build Coastguard Worker    named GmmLibULT.pch and a precompiled types file named StdAfx.obj.
26*35ffd701SAndroid Build Coastguard Worker
27*35ffd701SAndroid Build Coastguard Worker/////////////////////////////////////////////////////////////////////////////
28*35ffd701SAndroid Build Coastguard WorkerOther notes:
29*35ffd701SAndroid Build Coastguard Worker    This ULT is divided into 2 parts.
30*35ffd701SAndroid Build Coastguard Worker	1. CompileTime ULT - Runs with every Gmmlib build and KMD build
31*35ffd701SAndroid Build Coastguard Worker		How to trigger Test cases through commandline:
32*35ffd701SAndroid Build Coastguard Worker			i. Run all Compile Time TestCases	--> GmmULT.exe	CTest*.*
33*35ffd701SAndroid Build Coastguard Worker			ii.Run Specific TestCase			--> GmmULT.exe	CTestGen9CachePolicy.*
34*35ffd701SAndroid Build Coastguard Worker
35*35ffd701SAndroid Build Coastguard Worker	2. RunTime ULT - Runnable on Target system. Have to run it manually - not qualified to run on Host/Dev systems
36*35ffd701SAndroid Build Coastguard Worker		How to trigger Test cases through commandline:
37*35ffd701SAndroid Build Coastguard Worker			i. CachePolicy ULT					--> GmmULT.exe	RTestGen9CachePolicy.*
38*35ffd701SAndroid Build Coastguard Worker			ii. Vulkan Generic Resource			--> GmmULT.exe	RTestVulkanResource.*Generic*
39*35ffd701SAndroid Build Coastguard Worker			ii. Vulkan Sparse Resource			--> GmmULT.exe	RTestVulkanResource.*Sparse*
40*35ffd701SAndroid Build Coastguard Worker		To Run the Test on target
41*35ffd701SAndroid Build Coastguard Worker			i.  Download Driver along with Test Tools, which has ExCITE DLL or build ExCITE DLL on your dev system with the installed driver source
42*35ffd701SAndroid Build Coastguard Worker			ii. Install driver and copy DLL in either C:\Windows\System32 (for 64-bit app/DLL) or C:\Windows\SysWoW64 or place it in ULT executable Directory
43*35ffd701SAndroid Build Coastguard Worker			iii. Specify commandline and run GMMULT.exe
44*35ffd701SAndroid Build Coastguard Worker
45*35ffd701SAndroid Build Coastguard Worker
46*35ffd701SAndroid Build Coastguard WorkerTest Case:
47*35ffd701SAndroid Build Coastguard Worker	> Test Case is defined by FIXTURE class -> Test Case = FIXTURE Class
48*35ffd701SAndroid Build Coastguard Worker	> Ex. class CTestResource :  public testing::Test	--> CTestResource is FIXTURE class
49*35ffd701SAndroid Build Coastguard Worker
50*35ffd701SAndroid Build Coastguard WorkerTest:
51*35ffd701SAndroid Build Coastguard Worker	> Test resides in FIXTURE. FIXTURE class has multiple tests
52*35ffd701SAndroid Build Coastguard Worker	> Ex. TEST_F(CTestResource, test2DResource) --> test2DResource is a test of test case - CTestResource
53*35ffd701SAndroid Build Coastguard Worker
54*35ffd701SAndroid Build Coastguard WorkerSetUp() vs SetUpTestCase()
55*35ffd701SAndroid Build Coastguard Worker	> SetUp() -> gets called for all the tests in a test case. This is per-test setup/tear down
56*35ffd701SAndroid Build Coastguard Worker	> SetUpTestCase() -> When multiple tests in a test case share resource or needs same set up, then instead of repeating set up
57*35ffd701SAndroid Build Coastguard Worker						 per test, SetUpTestCase gets called once per test case and all the tests inside a test case, use same set up.
58*35ffd701SAndroid Build Coastguard Worker
59*35ffd701SAndroid Build Coastguard Worker
60*35ffd701SAndroid Build Coastguard WorkerTo exclude tests from execution
61*35ffd701SAndroid Build Coastguard Worker	> --gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS]
62*35ffd701SAndroid Build Coastguard Worker	> Ex. --gtest_filter=-ABC.*:BCD.*
63*35ffd701SAndroid Build Coastguard Worker
64*35ffd701SAndroid Build Coastguard Worker
65*35ffd701SAndroid Build Coastguard WorkerWhat happens when test/test case is triggered
66*35ffd701SAndroid Build Coastguard Worker	TEST_F(CTestGen9Resource, Test2DTileYResource) --> first instance of test in CTestGen9Resource FIXTURE test case
67*35ffd701SAndroid Build Coastguard Worker		1. CTestGen9Resource::SetUpTestCase() --> this sets up platform --> This step is skipped if this is subsequence test instances in test case.
68*35ffd701SAndroid Build Coastguard Worker			i. Calls CommonULT::SetUpTestCase() --> GmmInitGlobalContext() and other initialization
69*35ffd701SAndroid Build Coastguard Worker		2. CTestResource::CTestResource()
70*35ffd701SAndroid Build Coastguard Worker		3. CTestGen9Resource::CTestGen9Resource()
71*35ffd701SAndroid Build Coastguard Worker		4. Test_F body --> test execution
72*35ffd701SAndroid Build Coastguard Worker		5. CTestGen9Resource::~CTestGen9Resource()
73*35ffd701SAndroid Build Coastguard Worker		6. CTestResource::~CTestResource( )
74*35ffd701SAndroid Build Coastguard Worker		7. CommonULT::~CommonULT() -->  Destroys Global Context
75*35ffd701SAndroid Build Coastguard Worker		8. void CTestGen9Resource::TearDownTestCase()  --> only if this is last instance of test in test case
76*35ffd701SAndroid Build Coastguard Worker
77*35ffd701SAndroid Build Coastguard Worker
78*35ffd701SAndroid Build Coastguard WorkerCompileTime cmdline: $(TargetDir)$(TargetFileName) --gtest_filter=CTestResource.Test2DTileYsResource
79*35ffd701SAndroid Build Coastguard Worker
80*35ffd701SAndroid Build Coastguard WorkerTo debug failures, add the following in the command line argument: --gtest_break_on_failure
81*35ffd701SAndroid Build Coastguard WorkerThis will cause an assert to be hit whenever a test fails. You can use the call stack to go back to the failing test and debug.
82*35ffd701SAndroid Build Coastguard Worker/////////////////////////////////////////////////////////////////////////////
83