Set strict_mode to true
The default strict_mode is now set to true. We are encourage teams to write tests in strict_mode to make tests Bivalent (able to run on device and devicelessly) When opting out from strict_mode, "robolectric_strict_mode_res" should be included in lib for whitelisting purpose. Test: atest MyRoboTests Bug: 334089788 Change-Id: I3098e2c1ef1b5fd2ee1a98950db5e4f2e8d87d1e
This commit is contained in:
@@ -116,7 +116,7 @@ func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
|
||||
if v := String(r.robolectricProperties.Robolectric_prebuilt_version); v != "" {
|
||||
ctx.AddVariationDependencies(nil, libTag, fmt.Sprintf(robolectricPrebuiltLibPattern, v))
|
||||
} else if !proptools.Bool(r.robolectricProperties.Strict_mode) {
|
||||
} else if !proptools.BoolDefault(r.robolectricProperties.Strict_mode, true) {
|
||||
if proptools.Bool(r.robolectricProperties.Upstream) {
|
||||
ctx.AddVariationDependencies(nil, libTag, robolectricCurrentLib+"_upstream")
|
||||
} else {
|
||||
@@ -124,8 +124,11 @@ func (r *robolectricTest) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
}
|
||||
}
|
||||
|
||||
if proptools.Bool(r.robolectricProperties.Strict_mode) {
|
||||
if proptools.BoolDefault(r.robolectricProperties.Strict_mode, true) {
|
||||
ctx.AddVariationDependencies(nil, roboRuntimeOnlyTag, robolectricCurrentLib+"_upstream")
|
||||
} else {
|
||||
// opting out from strict mode, robolectric_non_strict_mode_permission lib should be added
|
||||
ctx.AddVariationDependencies(nil, libTag, "robolectric_non_strict_mode_permission")
|
||||
}
|
||||
|
||||
ctx.AddVariationDependencies(nil, libTag, robolectricDefaultLibs...)
|
||||
|
Reference in New Issue
Block a user