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

Commit 3d0f191c authored by Ivan Lozano's avatar Ivan Lozano Committed by Gerrit Code Review
Browse files

Merge "rust: Fix incorrect expected gcno file for dylibs"

parents 969ca670 d7ddf051
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -200,7 +200,9 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
		profileEmitArg := strings.TrimPrefix(cc.PwdPrefix(), "PWD=") + "/"

		if outputFile.Ext() != "" {
			gcnoFile = android.PathForModuleOut(ctx, pathtools.ReplaceExtension(outputFile.Base(), "gcno"))
			// rustc seems to split the output filename at the first '.' when determining the gcno filename
			// so we need to do the same here.
			gcnoFile = android.PathForModuleOut(ctx, strings.Split(outputFile.Base(), ".")[0]+".gcno")
			rustcFlags = append(rustcFlags, "-Z profile-emit="+profileEmitArg+android.PathForModuleOut(
				ctx, pathtools.ReplaceExtension(outputFile.Base(), "gcda")).String())
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ func TestCoverageZip(t *testing.T) {
		t.Fatalf("missing expected coverage files for rust 'fizz' binary: %#v", fizzZipInputs)
	}
	if !android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_rlib_dylib-std_cov/librlib.gcno") ||
		!android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_dylib_cov/libfoo.dylib.gcno") {
		!android.SuffixInList(libfooZipInputs, "android_arm64_armv8-a_dylib_cov/libfoo.gcno") {
		t.Fatalf("missing expected coverage files for rust 'fizz' binary: %#v", libfooZipInputs)
	}
	if !android.SuffixInList(buzzZipInputs, "android_arm64_armv8-a_cov/obj/foo.gcno") ||