Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/tests/D3D12Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,19 @@ namespace gpgmm::d3d12 {

desc.MinLogLevel = GetMessageSeverity(GetLogLevel());

if (IsDumpAllEventsEnabled()) {
if (IsDumpEventsEnabled()) {
desc.RecordOptions.Flags |= EVENT_RECORD_FLAG_ALL_EVENTS;
desc.RecordOptions.MinMessageLevel = desc.MinLogLevel;
desc.RecordOptions.UseDetailedTimingEvents = true;

// Format the output trace file as <test suite>.<test>.
const testing::TestInfo* const testInfoPtr =
::testing::UnitTest::GetInstance()->current_test_info();
ASSERT(testInfoPtr != nullptr);
desc.RecordOptions.TraceFile =
std::string(std::string(testInfoPtr->test_suite_name()) + "_" +
std::string(testInfoPtr->name()) + ".json")
.c_str();
}

return desc;
Expand Down
10 changes: 5 additions & 5 deletions src/tests/GPGMMTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ gpgmm::DebugPlatform* GPGMMTestBase::GetDebugPlatform() {
return mDebugPlatform.get();
}

bool GPGMMTestBase::IsDumpAllEventsEnabled() const {
return gTestEnv->IsDumpAllEventsEnabled();
bool GPGMMTestBase::IsDumpEventsEnabled() const {
return gTestEnv->IsDumpEventsEnabled();
}

gpgmm::LogSeverity GPGMMTestBase::GetLogLevel() const {
Expand Down Expand Up @@ -103,7 +103,7 @@ void InitGPGMMEnd2EndTestEnvironment(int argc, char** argv) {
GPGMMTestEnvironment::GPGMMTestEnvironment(int argc, char** argv) {
for (int i = 1; i < argc; ++i) {
if (strcmp("--dump", argv[i]) == 0) {
mIsDumpAllEventsEnabled = true;
mIsDumpEventsEnabled = true;
continue;
}

Expand Down Expand Up @@ -156,8 +156,8 @@ void GPGMMTestEnvironment::SetEnvironment(GPGMMTestEnvironment* env) {
void GPGMMTestEnvironment::SetUp() {
}

bool GPGMMTestEnvironment::IsDumpAllEventsEnabled() const {
return mIsDumpAllEventsEnabled;
bool GPGMMTestEnvironment::IsDumpEventsEnabled() const {
return mIsDumpEventsEnabled;
}

gpgmm::LogSeverity GPGMMTestEnvironment::GetLogLevel() const {
Expand Down
6 changes: 3 additions & 3 deletions src/tests/GPGMMTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GPGMMTestBase {

gpgmm::DebugPlatform* GetDebugPlatform();

bool IsDumpAllEventsEnabled() const;
bool IsDumpEventsEnabled() const;
gpgmm::LogSeverity GetLogLevel() const;

static std::vector<MEMORY_ALLOCATION_EXPECT> GenerateTestAllocations(uint64_t alignment);
Expand All @@ -77,11 +77,11 @@ class GPGMMTestEnvironment : public testing::Environment {

void SetUp() override;

bool IsDumpAllEventsEnabled() const;
bool IsDumpEventsEnabled() const;
gpgmm::LogSeverity GetLogLevel() const;

private:
bool mIsDumpAllEventsEnabled = false;
bool mIsDumpEventsEnabled = false;

#if defined(NDEBUG)
gpgmm::LogSeverity mLogLevel = gpgmm::LogSeverity::Warning;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/end2end/D3D12ResidencyManagerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class D3D12ResidencyManagerTests : public D3D12TestBase, public ::testing::Test

residencyDesc.MinLogLevel = GetMessageSeverity(GetLogLevel());

if (IsDumpAllEventsEnabled()) {
if (IsDumpEventsEnabled()) {
residencyDesc.RecordOptions.Flags |= EVENT_RECORD_FLAG_ALL_EVENTS;
residencyDesc.RecordOptions.MinMessageLevel = residencyDesc.MinLogLevel;
residencyDesc.RecordOptions.UseDetailedTimingEvents = true;
Expand Down