blob: d5fcf7d9b74b5bc95022d7967333a758e7c3fce3 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package codegen
const testBaseTemplate = `
{{- define "TestBase" -}}
{{- UseNatural -}}
// WARNING: This file is machine generated by fidlgen.
#pragma once
{{ $root := . -}}
{{ range .Headers -}}
#include <{{ . }}/{{ $root.IncludeStem }}.h>
{{ end -}}
#include <{{ .PrimaryHeader }}>
{{- range .Decls }}
{{- if Eq .Kind Kinds.Protocol }}
{{ EnsureNamespace .TestBase }}
class {{ .TestBase.Name }} : public {{ . }} {
public:
virtual ~{{ .TestBase.Name }}() { }
virtual void NotImplemented_(const std::string& name) = 0;
{{- range .Methods }}
{{- if .HasRequest }}
void {{ template "RequestMethodSignature" . }} override {
NotImplemented_("{{ .Name }}");
}
{{- end }}
{{- end }}
};
{{- end }}
{{- end -}}
{{ EndOfFile }}
{{ end }}
`