Skip to content

Commit 7028f0f

Browse files
committed
EnvironmentContentTests.CheckConcurrentGC updated
1 parent 8ae9e9f commit 7028f0f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,12 @@ public void CheckMonoDebugIsAddedToEnvironment ([Values ("", "Normal", "Offline"
128128
}
129129

130130
[Test]
131-
public void CheckConcurrentGC ([Values] AndroidRuntime runtime)
131+
public void CheckConcurrentGC ()
132132
{
133-
const bool isRelease = true;
134-
if (IgnoreUnsupportedConfiguration (runtime, release: isRelease)) {
135-
return;
136-
}
137133
var proj = new XamarinAndroidApplicationProject () {
138-
IsRelease = isRelease,
134+
IsRelease = true,
139135
};
140-
proj.SetRuntime (runtime);
136+
141137
var gcVarName = "MONO_GC_PARAMS";
142138
var expectedDefaultValue = "major=marksweep";
143139
var expectedUpdatedValue = "major=marksweep-conc";
@@ -151,14 +147,14 @@ public void CheckConcurrentGC ([Values] AndroidRuntime runtime)
151147
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
152148
var intermediateOutputDir = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath);
153149
// AndroidEnableSGenConcurrent=False by default
154-
List<EnvironmentHelper.EnvironmentFile> envFiles = EnvironmentHelper.GatherEnvironmentFiles (intermediateOutputDir, supportedAbis, true, runtime);
150+
List<EnvironmentHelper.EnvironmentFile> envFiles = EnvironmentHelper.GatherEnvironmentFiles (intermediateOutputDir, supportedAbis, true, AndroidRuntime.MonoVM);
155151
Dictionary<string, string> envvars = EnvironmentHelper.ReadEnvironmentVariables (envFiles, AndroidRuntime.MonoVM);
156152
Assert.IsTrue (envvars.ContainsKey (gcVarName), $"Environment should contain '{gcVarName}'.");
157153
Assert.AreEqual (expectedDefaultValue, envvars[gcVarName], $"'{gcVarName}' should have been '{expectedDefaultValue}' when concurrent GC is disabled.");
158154

159155
proj.SetProperty ("AndroidEnableSGenConcurrent", "True");
160156
Assert.IsTrue (b.Build (proj), "Second build should have succeeded.");
161-
envFiles = EnvironmentHelper.GatherEnvironmentFiles (intermediateOutputDir, supportedAbis, true, runtime);
157+
envFiles = EnvironmentHelper.GatherEnvironmentFiles (intermediateOutputDir, supportedAbis, true, AndroidRuntime.MonoVM);
162158
envvars = EnvironmentHelper.ReadEnvironmentVariables (envFiles, AndroidRuntime.MonoVM);
163159
Assert.IsTrue (envvars.ContainsKey (gcVarName), $"Environment should contain '{gcVarName}'.");
164160
Assert.AreEqual (expectedUpdatedValue, envvars[gcVarName], $"'{gcVarName}' should have been '{expectedUpdatedValue}' when concurrent GC is enabled.");

0 commit comments

Comments
 (0)