blob: 6fee92410351c303d1e011a110d853d4a6c8d5e8 [file] [log] [blame]
Colin Cross19878da2019-03-28 14:45:07 -07001// Copyright 2016 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package cc
16
17import (
18 "strings"
19 "testing"
20)
21
22func TestProto(t *testing.T) {
23 t.Run("simple", func(t *testing.T) {
24 ctx := testCc(t, `
25 cc_library_shared {
26 name: "libfoo",
27 srcs: ["a.proto"],
28 }`)
29
30 proto := ctx.ModuleForTests("libfoo", "android_arm_armv7-a-neon_core_shared").Output("proto/a.pb.cc")
31
32 if cmd := proto.RuleParams.Command; !strings.Contains(cmd, "--cpp_out=") {
33 t.Errorf("expected '--cpp_out' in %q", cmd)
34 }
35 })
36}