Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cb82e36 authored by Jihoon Kang's avatar Jihoon Kang
Browse files

Add java/fuzz_test.go to test sources

Context
- fuzz_test.go is not listed in the soong/java test sources and is not
  running on CI.

Implementation
- Fix fuzz_test.go and add to test sources

Test: m
Change-Id: If2685c646dec4885fc42d7760992309bfa9da382
parent 775f2cb3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ bootstrap_go_package {
        "dexpreopt_config_test.go",
        "droiddoc_test.go",
        "droidstubs_test.go",
        "fuzz_test.go",
        "genrule_test.go",
        "hiddenapi_singleton_test.go",
        "jacoco_test.go",
+4 −5
Original line number Diff line number Diff line
@@ -65,9 +65,8 @@ func TestJavaFuzz(t *testing.T) {

	osCommonTarget := result.Config.BuildOSCommonTarget.String()

	osCommonTargetWithSan := osCommonTarget + "_asan" + "_fuzzer"
	javac := result.ModuleForTests("foo", osCommonTargetWithSan).Rule("javac")
	combineJar := result.ModuleForTests("foo", osCommonTargetWithSan).Description("for javac")
	javac := result.ModuleForTests("foo", osCommonTarget).Rule("javac")
	combineJar := result.ModuleForTests("foo", osCommonTarget).Description("for javac")

	if len(javac.Inputs) != 1 || javac.Inputs[0].String() != "a.java" {
		t.Errorf(`foo inputs %v != ["a.java"]`, javac.Inputs)
@@ -85,9 +84,9 @@ func TestJavaFuzz(t *testing.T) {
	}

	ctx := result.TestContext
	foo := ctx.ModuleForTests("foo", osCommonTargetWithSan).Module().(*JavaFuzzLibrary)
	foo := ctx.ModuleForTests("foo", osCommonTarget).Module().(*JavaFuzzLibrary)

	expected := "libjni.so"
	expected := "lib64/libjni.so"
	if runtime.GOOS == "darwin" {
		expected = "libjni.dylib"
	}