mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Simplify calls to ast::Node::[to_]str()
Add helpers on Program and ProgramBuilder that significantly simplify usage. Also demangle - this also reduces a bunch of copy-pasta code. Change-Id: I6215c346e7f6e49c20aced058a6150603253ed93 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/39342 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
dd1b6fca9f
commit
708dc2d040
@@ -20,7 +20,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/demangler.h"
|
||||
#include "src/program_builder.h"
|
||||
|
||||
namespace tint {
|
||||
@@ -28,18 +27,7 @@ namespace type {
|
||||
|
||||
/// Helper class for testing
|
||||
template <typename BASE>
|
||||
class TestHelperBase : public BASE, public ProgramBuilder {
|
||||
public:
|
||||
/// Demangles the given string
|
||||
/// @param s the string to demangle
|
||||
/// @returns the demangled string
|
||||
std::string demangle(const std::string& s) {
|
||||
return demanger.Demangle(this, s);
|
||||
}
|
||||
|
||||
/// A demangler
|
||||
Demangler demanger;
|
||||
};
|
||||
class TestHelperBase : public BASE, public ProgramBuilder {};
|
||||
using TestHelper = TestHelperBase<testing::Test>;
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user