Namespace Log.h/cpp in dawn::

The LogMessage::LogMessage constructor was redefining a symbol that
exists in re2 inside of Chromium. So we namespace Log inside dawn:: to
avoid the conflict.

BUG=dawn:302

Change-Id: Ida349208e2c6fe9ac032e1bd8cd442dff0b3f6bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14320
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Corentin Wallez
2019-12-06 18:21:39 +00:00
committed by Commit Bot service account
parent dd4584340d
commit dc3317da6c
12 changed files with 170 additions and 158 deletions

View File

@@ -159,16 +159,17 @@ DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) {
}
if (strcmp("-h", argv[i]) == 0 || strcmp("--help", argv[i]) == 0) {
InfoLog() << "\n\nUsage: " << argv[0]
<< " [GTEST_FLAGS...] [-w] [-d] [-c] [--adapter-vendor-id=x]\n"
" -w, --use-wire: Run the tests through the wire (defaults to no wire)\n"
" -d, --enable-backend-validation: Enable backend validation (defaults"
" to disabled)\n"
" -c, --begin-capture-on-startup: Begin debug capture on startup "
"(defaults to no capture)\n"
" --skip-validation: Skip Dawn validation\n"
" --adapter-vendor-id: Select adapter by vendor id to run end2end tests"
"on multi-GPU systems \n";
dawn::InfoLog()
<< "\n\nUsage: " << argv[0]
<< " [GTEST_FLAGS...] [-w] [-d] [-c] [--adapter-vendor-id=x]\n"
" -w, --use-wire: Run the tests through the wire (defaults to no wire)\n"
" -d, --enable-backend-validation: Enable backend validation (defaults"
" to disabled)\n"
" -c, --begin-capture-on-startup: Begin debug capture on startup "
"(defaults to no capture)\n"
" --skip-validation: Skip Dawn validation\n"
" --adapter-vendor-id: Select adapter by vendor id to run end2end tests"
"on multi-GPU systems \n";
continue;
}
}
@@ -187,25 +188,25 @@ void DawnTestEnvironment::SetUp() {
mInstance.get()->DiscoverDefaultAdapters();
DiscoverOpenGLAdapter();
InfoLog() << "Testing configuration\n"
"---------------------\n"
"UseWire: "
<< (mUseWire ? "true" : "false")
<< "\n"
"EnableBackendValidation: "
<< (mEnableBackendValidation ? "true" : "false")
<< "\n"
"SkipDawnValidation: "
<< (mSkipDawnValidation ? "true" : "false")
<< "\n"
"UseSpvc: "
<< (mUseSpvc ? "true" : "false")
<< "\n"
"BeginCaptureOnStartup: "
<< (mBeginCaptureOnStartup ? "true" : "false")
<< "\n"
"\n"
<< "System adapters: \n";
dawn::InfoLog() << "Testing configuration\n"
"---------------------\n"
"UseWire: "
<< (mUseWire ? "true" : "false")
<< "\n"
"EnableBackendValidation: "
<< (mEnableBackendValidation ? "true" : "false")
<< "\n"
"SkipDawnValidation: "
<< (mSkipDawnValidation ? "true" : "false")
<< "\n"
"UseSpvc: "
<< (mUseSpvc ? "true" : "false")
<< "\n"
"BeginCaptureOnStartup: "
<< (mBeginCaptureOnStartup ? "true" : "false")
<< "\n"
"\n"
<< "System adapters: \n";
for (const dawn_native::Adapter& adapter : mInstance->GetAdapters()) {
const dawn_native::PCIInfo& pci = adapter.GetPCIInfo();
@@ -217,14 +218,15 @@ void DawnTestEnvironment::SetUp() {
<< pci.deviceId;
// Preparing for outputting hex numbers
InfoLog() << std::showbase << std::hex << std::setfill('0') << std::setw(4)
dawn::InfoLog() << std::showbase << std::hex << std::setfill('0') << std::setw(4)
<< " - \"" << pci.name << "\"\n"
<< " type: " << DeviceTypeName(adapter.GetDeviceType())
<< ", backend: " << ParamName(adapter.GetBackendType()) << "\n"
<< " vendorId: 0x" << vendorId.str() << ", deviceId: 0x" << deviceId.str()
<< (mHasVendorIdFilter && mVendorIdFilter == pci.vendorId ? " [Selected]" : "")
<< "\n";
<< " - \"" << pci.name << "\"\n"
<< " type: " << DeviceTypeName(adapter.GetDeviceType())
<< ", backend: " << ParamName(adapter.GetBackendType()) << "\n"
<< " vendorId: 0x" << vendorId.str() << ", deviceId: 0x" << deviceId.str()
<< (mHasVendorIdFilter && mVendorIdFilter == pci.vendorId ? " [Selected]"
: "")
<< "\n";
}
}

View File

@@ -295,11 +295,11 @@ class DawnTestBase {
};
// Skip a test when the given condition is satisfied.
#define DAWN_SKIP_TEST_IF(condition) \
if (condition) { \
InfoLog() << "Test skipped: " #condition "."; \
GTEST_SKIP(); \
return; \
#define DAWN_SKIP_TEST_IF(condition) \
if (condition) { \
dawn::InfoLog() << "Test skipped: " #condition "."; \
GTEST_SKIP(); \
return; \
}
template <typename Params = DawnTestParam>

View File

@@ -113,7 +113,7 @@ DawnPerfTestEnvironment::DawnPerfTestEnvironment(int argc, char** argv)
}
if (strcmp("-h", argv[i]) == 0 || strcmp("--help", argv[i]) == 0) {
InfoLog()
dawn::InfoLog()
<< "Additional flags:"
<< " [--calibration] [--override-steps=x] [--enable-tracing] [--trace-file=file]\n"
<< " --calibration: Only run calibration. Calibration allows the perf test"