Make aconfig flags generate a library instead of a srcjar.
Also add unit tests for the rest of device_config
Bug: 283475679
Test: m nothing (soong unit tests)
Change-Id: Iee18a1f2f2cbb23e8c8d84c54e903b32be29a693
diff --git a/android/test_asserts.go b/android/test_asserts.go
index 5cc7e4a..3a2cb1a 100644
--- a/android/test_asserts.go
+++ b/android/test_asserts.go
@@ -200,6 +200,22 @@
}
}
+// Asserts that each of the Paths in actual end with the corresponding string
+// from expected. Useful to test that output paths contain expected items without
+// hard-coding where intermediate files might be located.
+func AssertPathsEndWith(t *testing.T, message string, expected []string, actual []Path) {
+ t.Helper()
+ if len(expected) != len(actual) {
+ t.Errorf("%s (length): expected %d, actual %d", message, len(expected), len(actual))
+ return
+ }
+ for i := range expected {
+ if !strings.HasSuffix(actual[i].String(), expected[i]) {
+ t.Errorf("%s (item %d): expected '%s', actual '%s'", message, i, expected[i], actual[i].String())
+ }
+ }
+}
+
// AssertDeepEquals checks if the expected and actual values are equal using reflect.DeepEqual and
// if they are not then it reports an error prefixed with the supplied message and including a
// reason for why it failed.