blob: 4e2e63087c746e83d879ed85c9b3924c67ae6693 [file]
// 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 }}{{ $protocol := .}}
{{- range $transport, $_ := .Transports }}{{- if eq $transport "Channel" }}
{{ EnsureNamespace $protocol.TestBase }}
class {{ $protocol.TestBase.Name }} : public {{ $protocol }} {
public:
virtual ~{{ $protocol.TestBase.Name }}() { }
virtual void NotImplemented_(const std::string& name) = 0;
{{- range $protocol.Methods }}
{{- if .HasRequest }}
void {{ template "RequestMethodSignature" . }} override {
NotImplemented_("{{ .Name }}");
}
{{- end }}
{{- end }}
};
{{- end }}
{{- end }}{{ end }}{{ end -}}
{{ EndOfFile }}
{{ end }}
`