diff options
author | Paul Duffin <paulduffin@google.com> | 2021-03-11 15:11:20 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-11 15:11:20 +0000 |
commit | 6f688d03c890d7a65c3980051c6481d4ad6f8bb7 (patch) | |
tree | f76769a61093cccd0af19a776a854a48e84d5885 /java/system_modules_test.go | |
parent | 8075291a9444ae63e7db4493cfb9746419d6b14b (diff) | |
parent | f23e346f6cff3162b3b9ca8e73ddea8ac2f4ca89 (diff) |
Merge "Convert system modules tests to use fixtures"
Diffstat (limited to 'java/system_modules_test.go')
-rw-r--r-- | java/system_modules_test.go | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/java/system_modules_test.go b/java/system_modules_test.go index 23d6c7bef..d2fa2b152 100644 --- a/java/system_modules_test.go +++ b/java/system_modules_test.go @@ -15,12 +15,11 @@ package java import ( - "strings" "testing" ) func TestJavaSystemModules(t *testing.T) { - ctx, _ := testJava(t, ` + result := javaFixtureFactory.RunTestWithBp(t, ` java_system_modules { name: "system-modules", libs: ["system-module1", "system-module2"], @@ -40,21 +39,18 @@ func TestJavaSystemModules(t *testing.T) { `) // check the existence of the module - systemModules := ctx.ModuleForTests("system-modules", "android_common") + systemModules := result.ModuleForTests("system-modules", "android_common") cmd := systemModules.Rule("jarsTosystemModules") // make sure the command compiles against the supplied modules. for _, module := range []string{"system-module1.jar", "system-module2.jar"} { - if !strings.Contains(cmd.Args["classpath"], module) { - t.Errorf("system modules classpath %v does not contain %q", cmd.Args["classpath"], - module) - } + result.AssertStringDoesContain("system modules classpath", cmd.Args["classpath"], module) } } func TestJavaSystemModulesImport(t *testing.T) { - ctx, _ := testJava(t, ` + result := javaFixtureFactory.RunTestWithBp(t, ` java_system_modules_import { name: "system-modules", libs: ["system-module1", "system-module2"], @@ -70,15 +66,12 @@ func TestJavaSystemModulesImport(t *testing.T) { `) // check the existence of the module - systemModules := ctx.ModuleForTests("system-modules", "android_common") + systemModules := result.ModuleForTests("system-modules", "android_common") cmd := systemModules.Rule("jarsTosystemModules") // make sure the command compiles against the supplied modules. for _, module := range []string{"system-module1.jar", "system-module2.jar"} { - if !strings.Contains(cmd.Args["classpath"], module) { - t.Errorf("system modules classpath %v does not contain %q", cmd.Args["classpath"], - module) - } + result.AssertStringDoesContain("system modules classpath", cmd.Args["classpath"], module) } } |