Don't panic in ModuleForTests and friends

Panicking in ModuleForTests and similar test helper functions was
a mistake.  Go's test runner stops running tests as soon as any
test panics, which means debugging multiple tests panicking requires
rerunning all the tests after fixing each panic to find the next
one.  Pass the *testing.T into ModuleForTests and friends so that
it can call t.Fatalf instead.

Test: all soong tests pass
Change-Id: I5d0f2424eaf04fb795079e6d1e4b9469d8c7033c
diff --git a/java/app_set_test.go b/java/app_set_test.go
index cc7af04..9b4c44b 100644
--- a/java/app_set_test.go
+++ b/java/app_set_test.go
@@ -31,7 +31,7 @@
 			set: "prebuilts/apks/app.apks",
 			prerelease: true,
 		}`)
-	module := result.ModuleForTests("foo", "android_common")
+	module := result.ModuleForTests(t, "foo", "android_common")
 	const packedSplitApks = "foo.zip"
 	params := module.Output(packedSplitApks)
 	if params.Rule == nil {
@@ -127,7 +127,7 @@
 				}),
 			).RunTestWithBp(t, bp)
 
-			module := ctx.ModuleForTests("foo", "android_common")
+			module := ctx.ModuleForTests(t, "foo", "android_common")
 			const packedSplitApks = "foo.zip"
 			params := module.Output(packedSplitApks)
 			for k, v := range test.expected {