Debug flag to force early exit

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-04-24 20:45:11 +00:00
committed by Compute-Runtime-Automation
parent 16db7cc890
commit 6e9257c623
11 changed files with 122 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ struct MockDrmCsr : public DrmCommandStreamReceiver<GfxFamily> {
using DrmCommandStreamReceiver<GfxFamily>::dispatchMode;
using DrmCommandStreamReceiver<GfxFamily>::completionFenceValuePointer;
using DrmCommandStreamReceiver<GfxFamily>::flushInternal;
using DrmCommandStreamReceiver<GfxFamily>::CommandStreamReceiver::taskCount;
};
class DrmCommandStreamTest : public ::testing::Test {

View File

@@ -31,7 +31,9 @@ uint32_t closeFuncCalled = 0u;
int closeFuncArgPassed = 0;
int closeFuncRetVal = 0;
int dlOpenFlags = 0;
bool dlOpenCalled = 0;
int latestExitCode = 0;
bool exitCalled = false;
bool dlOpenCalled = false;
bool getNumThreadsCalled = false;
bool makeFakeDevicePath = false;
bool allowFakeDevicePath = false;
@@ -66,6 +68,11 @@ int (*sysCallsPipe)(int pipeFd[2]) = nullptr;
int (*sysCallsFstat)(int fd, struct stat *buf) = nullptr;
char *(*sysCallsRealpath)(const char *path, char *buf) = nullptr;
void exit(int code) {
exitCalled = true;
latestExitCode = code;
}
int close(int fileDescriptor) {
closeFuncCalled++;
closeFuncArgPassed = fileDescriptor;

View File

@@ -33,6 +33,8 @@ extern int passedFileDescriptorFlagsToSet;
extern int getFileDescriptorFlagsCalled;
extern int setFileDescriptorFlagsCalled;
extern uint32_t closeFuncCalled;
extern bool exitCalled;
extern int latestExitCode;
extern std::vector<void *> mmapVector;
extern std::vector<void *> mmapCapturedExtendedPointers;