aboutsummaryrefslogtreecommitdiffstats
path: root/androidmk
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-03-22 12:43:16 -0700
committerColin Cross <ccross@android.com>2018-04-16 17:32:16 +0000
commit9c55d237f6b72896209344aee18a1702c2f9ac3e (patch)
tree9cc07e0ff8e5305611ad267d56bee111834ab1cf /androidmk
parentadee968a4bace28bd26253bc436043eb513f6117 (diff)
downloadbuild_soong-9c55d237f6b72896209344aee18a1702c2f9ac3e.tar.gz
build_soong-9c55d237f6b72896209344aee18a1702c2f9ac3e.tar.bz2
build_soong-9c55d237f6b72896209344aee18a1702c2f9ac3e.zip
Merge matching properties in bpfix
androidmk will start to generate multiple static_libs: properties in a single module, add a pass in bpfix to fix them up into a single property. Test: bpfix_test.go Change-Id: I30955b6efbb767c02ba77f2f18d44951ef094bad
Diffstat (limited to 'androidmk')
-rw-r--r--androidmk/cmd/androidmk/androidmk_test.go26
1 files changed, 5 insertions, 21 deletions
diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go
index 45df1a57..dd646efe 100644
--- a/androidmk/cmd/androidmk/androidmk_test.go
+++ b/androidmk/cmd/androidmk/androidmk_test.go
@@ -15,13 +15,11 @@
package main
import (
+ "android/soong/bpfix/bpfix"
"bytes"
"fmt"
- "os"
"strings"
"testing"
-
- bpparser "github.com/google/blueprint/parser"
)
var testCases = []struct {
@@ -524,26 +522,12 @@ include $(call all-makefiles-under,$(LOCAL_PATH))
},
}
-func reformatBlueprint(input string) string {
- file, errs := bpparser.Parse("<testcase>", bytes.NewBufferString(input), bpparser.NewScope(nil))
- if len(errs) > 0 {
- for _, err := range errs {
- fmt.Fprintln(os.Stderr, err)
- }
- panic(fmt.Sprintf("%d parsing errors in testcase:\n%s", len(errs), input))
- }
-
- res, err := bpparser.Print(file)
- if err != nil {
- panic(fmt.Sprintf("Error printing testcase: %q", err))
- }
-
- return string(res)
-}
-
func TestEndToEnd(t *testing.T) {
for i, test := range testCases {
- expected := reformatBlueprint(test.expected)
+ expected, err := bpfix.Reformat(test.expected)
+ if err != nil {
+ t.Error(err)
+ }
got, errs := convertFile(fmt.Sprintf("<testcase %d>", i), bytes.NewBufferString(test.in))
if len(errs) > 0 {