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
18 changes: 9 additions & 9 deletions src/tests/D3D12Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ namespace gpgmm::d3d12 {
<< GPGMM_BYTES_TO_GB(mCaps->GetMaxResourceHeapSize()) << " GBs";
DebugLog() << "Creation of non-resident heaps: "
<< ((mCaps->IsCreateHeapNotResidentSupported()) ? "Supported" : "Not supported");

// Format the output trace file as <test suite>.<test>.
const testing::TestInfo* const testInfoPtr =
::testing::UnitTest::GetInstance()->current_test_info();
ASSERT_TRUE(testInfoPtr != nullptr);

mTraceFile = std::string(std::string(testInfoPtr->test_suite_name()) + "_" +
std::string(testInfoPtr->name()) + ".json");
}

void D3D12TestBase::TearDown() {
Expand All @@ -132,15 +140,7 @@ namespace gpgmm::d3d12 {
desc.RecordOptions.Flags |= EventRecordFlags::kAll;
desc.MinRecordLevel = 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();
desc.RecordOptions.TraceFile = mTraceFile.c_str();
}

return desc;
Expand Down
2 changes: 2 additions & 0 deletions src/tests/D3D12Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "tests/GPGMMTest.h"

#include <string>
#include <vector>

#include <gpgmm_d3d12.h>
Expand Down Expand Up @@ -72,6 +73,7 @@ namespace gpgmm::d3d12 {
ComPtr<IDXGIAdapter3> mAdapter;
ComPtr<ID3D12Device> mDevice;
std::unique_ptr<Caps> mCaps;
std::string mTraceFile;
};

} // namespace gpgmm::d3d12
Expand Down