Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions Xamarin.Android-Tests.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGen-MkBundle", "CodeGen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.MakeBundle-Tests", "tests\CodeGen-MkBundle\Xamarin.Android.MakeBundle-Tests\Xamarin.Android.MakeBundle-Tests.csproj", "{A0B2692E-9FBE-4157-9526-7145F07F2C5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.MakeBundle-UnitTests", "tests\CodeGen-MkBundle\Xamarin.Android.MakeBundle-UnitTests\Xamarin.Android.MakeBundle-UnitTests.csproj", "{FA8EEC88-CA3C-4D69-B206-54B392570DC6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ResolveImports", "ResolveImports", "{E49089E4-4CE0-475E-BE9C-0AB4E4D56EE9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.BindingResolveImportLib1", "tests\ResolveImports\Xamarin.Android.BindingResolveImportLib1\Xamarin.Android.BindingResolveImportLib1.csproj", "{2A0519DF-0DDA-45F7-AC3C-E2992748D364}"
Expand Down Expand Up @@ -72,8 +70,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommonSampleLibrary", "test
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeBehind", "CodeBehind", "{9B63992C-2201-4BB0-BD00-D637B481A995}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeBehindUnitTests", "tests\CodeBehind\UnitTests\CodeBehindUnitTests.csproj", "{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.ProjectTools", "src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Xamarin.ProjectTools.csproj", "{2DD1EE75-6D8D-4653-A800-0A24367F7F38}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Performance-Tests", "Performance-Tests", "{68B8E272-5B12-47AA-8923-550B9CE535C7}"
Expand All @@ -82,8 +78,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "timing", "build-tools\timin
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmbeddedDSO", "tests\EmbeddedDSOs\EmbeddedDSO\EmbeddedDSO.csproj", "{056ED976-618F-4A3E-910E-AA25230C2296}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmbeddedDSO-UnitTests", "tests\EmbeddedDSOs\EmbeddedDSO-UnitTests\EmbeddedDSO-UnitTests.csproj", "{8B5E63B7-8C18-4BA7-BAAB-A1955B257F5E}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Mono.Android-Test.Shared", "src\Mono.Android\Test\Mono.Android-Test.Shared.shproj", "{0AB4956E-6FB9-4DA0-9D49-AB65A3FF403A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Android-Test.Library", "src\Mono.Android\Test\Mono.Android-Test.Library\Mono.Android-Test.Library.csproj", "{8CB5FF58-FF95-43B9-9064-9ACE9525866F}"
Expand Down Expand Up @@ -157,10 +151,6 @@ Global
{A0B2692E-9FBE-4157-9526-7145F07F2C5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0B2692E-9FBE-4157-9526-7145F07F2C5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0B2692E-9FBE-4157-9526-7145F07F2C5A}.Release|Any CPU.Build.0 = Release|Any CPU
{FA8EEC88-CA3C-4D69-B206-54B392570DC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA8EEC88-CA3C-4D69-B206-54B392570DC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA8EEC88-CA3C-4D69-B206-54B392570DC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA8EEC88-CA3C-4D69-B206-54B392570DC6}.Release|Any CPU.Build.0 = Release|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A0519DF-0DDA-45F7-AC3C-E2992748D364}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -217,10 +207,6 @@ Global
{7A5FB23C-6B26-461A-8BBD-02392DCE3C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A5FB23C-6B26-461A-8BBD-02392DCE3C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A5FB23C-6B26-461A-8BBD-02392DCE3C11}.Release|Any CPU.Build.0 = Release|Any CPU
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B}.Release|Any CPU.Build.0 = Release|Any CPU
{2DD1EE75-6D8D-4653-A800-0A24367F7F38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DD1EE75-6D8D-4653-A800-0A24367F7F38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DD1EE75-6D8D-4653-A800-0A24367F7F38}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -233,10 +219,6 @@ Global
{056ED976-618F-4A3E-910E-AA25230C2296}.Debug|Any CPU.Build.0 = Debug|Any CPU
{056ED976-618F-4A3E-910E-AA25230C2296}.Release|Any CPU.ActiveCfg = Release|Any CPU
{056ED976-618F-4A3E-910E-AA25230C2296}.Release|Any CPU.Build.0 = Release|Any CPU
{8B5E63B7-8C18-4BA7-BAAB-A1955B257F5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B5E63B7-8C18-4BA7-BAAB-A1955B257F5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B5E63B7-8C18-4BA7-BAAB-A1955B257F5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B5E63B7-8C18-4BA7-BAAB-A1955B257F5E}.Release|Any CPU.Build.0 = Release|Any CPU
{8CB5FF58-FF95-43B9-9064-9ACE9525866F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CB5FF58-FF95-43B9-9064-9ACE9525866F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CB5FF58-FF95-43B9-9064-9ACE9525866F}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -288,7 +270,6 @@ Global
{910DCD88-D50A-4AAD-BA7A-CD51AB8532BF} = {6C86878D-9EBF-45B3-9368-C0EA4026F706}
{95012FA9-ED51-4004-8F36-91DB361C892B} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{7A5FB23C-6B26-461A-8BBD-02392DCE3C11} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{F4DAFD78-BE76-46C9-A1AD-85D8C91CD77B} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{2DD1EE75-6D8D-4653-A800-0A24367F7F38} = {9B63992C-2201-4BB0-BD00-D637B481A995}
{37CAA28C-40BE-4253-BA68-CC5D7316A617} = {68B8E272-5B12-47AA-8923-550B9CE535C7}
{0AB4956E-6FB9-4DA0-9D49-AB65A3FF403A} = {EFBC4DC0-DBFF-4DAA-B0B8-6D0CB02A25F5}
Expand Down
18 changes: 0 additions & 18 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,24 +359,6 @@ stages:
testResultsFiles: TestResult-*.xml
testRunTitle: Java Interop Tests - Windows Build Tree

- template: yaml-templates\run-nunit-tests.yaml
parameters:
testRunTitle: CodeBehindUnitTests - Windows Build Tree
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\CodeBehind\CodeBehindUnitTests.dll
testResultsFile: TestResult-CodeBehindUnitTests-WinBuildTree-$(XA.Build.Configuration).xml

- template: yaml-templates\run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.MakeBundle-UnitTests - Windows Build Tree
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\Xamarin.Android.MakeBundle-UnitTests.dll
testResultsFile: TestResult-MakeBundleUnitTests-WinBuildTree-$(XA.Build.Configuration).xml

- template: yaml-templates\run-nunit-tests.yaml
parameters:
testRunTitle: EmbeddedDSOUnitTests - Windows Build Tree
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\EmbeddedDSOUnitTests.dll
testResultsFile: TestResult-EmbeddedDSOUnitTests-WinBuildTree-$(XA.Build.Configuration).xml

# Limit the amount of worker threads used to run these tests in parallel to half of what is currently available (8) on the Windows pool.
# Using all available cores seems to occasionally bog down our machines and cause parallel test execution to slow down dramatically.
# Only run a subset of the Xamarin.Android.Build.Tests against the local Windows build tree.
Expand Down
18 changes: 0 additions & 18 deletions build-tools/automation/yaml-templates/run-msbuild-mac-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,6 @@ jobs:

# Only run these tests on node 2
- ${{ if eq(parameters.node_id, 2) }}:
- template: run-nunit-tests.yaml
parameters:
testRunTitle: CodeBehindUnitTests - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/CodeBehind/CodeBehindUnitTests.dll
testResultsFile: TestResult-CodeBehindUnitTests-macOS-$(XA.Build.Configuration).xml

- template: run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.MakeBundle-UnitTests - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/Xamarin.Android.MakeBundle-UnitTests.dll
testResultsFile: TestResult-MakeBundleUnitTests-macOS-$(XA.Build.Configuration).xml

- template: run-nunit-tests.yaml
parameters:
testRunTitle: EmbeddedDSOUnitTests - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/EmbeddedDSOUnitTests.dll
testResultsFile: TestResult-EmbeddedDSOUnitTests-macOS-$(XA.Build.Configuration).xml

- template: run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Build.Tests.Commercial - macOS
Expand Down
3 changes: 0 additions & 3 deletions build-tools/scripts/RunTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
</PropertyGroup>
<ItemGroup>
<_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\Xamarin.Android.Build.Tests.dll" />
<_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\CodeBehind\CodeBehindUnitTests.dll" />
<_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\EmbeddedDSOUnitTests.dll" />
<_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\Xamarin.Android.MakeBundle-UnitTests.dll" />
<_ApkTestProject Include="$(_TopDir)\src\Mono.Android\Test\Mono.Android-Tests.csproj" />
<_ApkTestProject Include="$(_TopDir)\tests\CodeGen-Binding\Xamarin.Android.JcwGen-Tests\Xamarin.Android.JcwGen-Tests.csproj" />
<_ApkTestProject Include="$(_TopDir)\tests\CodeGen-MkBundle\Xamarin.Android.MakeBundle-Tests\Xamarin.Android.MakeBundle-Tests.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,128 +10,129 @@

using Xamarin.ProjectTools;

namespace CodeBehindUnitTests
namespace Xamarin.Android.Build.Tests
{
sealed class LocalBuilder : Builder
[Category ("Node-2")]
[Parallelizable (ParallelScope.Children)]
public class CodeBehindTests
{
public LocalBuilder ()
{
BuildingInsideVisualStudio = false;
}

public bool Build (string projectOrSolution, string target, string[] parameters = null, Dictionary<string, string> environmentVariables = null)
sealed class LocalBuilder : Builder
{
return BuildInternal (projectOrSolution, target, parameters, environmentVariables);
}
}
public LocalBuilder ()
{
BuildingInsideVisualStudio = false;
}

sealed class SourceFileMember
{
public string Visibility { get; }
public string Type { get; }
public string Name { get; }
public string Arguments { get; }
public bool IsExpressionBody { get; }
public bool IsMethod { get; }

public SourceFileMember (string visibility, string type, string name, bool isExpressionBody)
{
if (String.IsNullOrEmpty (visibility))
throw new ArgumentException (nameof (visibility));
if (String.IsNullOrEmpty (type))
throw new ArgumentException (nameof (type));
if (String.IsNullOrEmpty (name))
throw new ArgumentException (nameof (name));
Visibility = visibility;
Type = type;
Name = name;
IsExpressionBody = isExpressionBody;
IsMethod = false;
}

public SourceFileMember (string visibility, string type, string name, string arguments)
{
if (String.IsNullOrEmpty (visibility))
throw new ArgumentException (nameof (visibility));
if (String.IsNullOrEmpty (type))
throw new ArgumentException (nameof (type));
if (String.IsNullOrEmpty (name))
throw new ArgumentException (nameof (name));
Visibility = visibility;
Type = type;
Name = name;
Arguments = arguments ?? String.Empty;
IsExpressionBody = false;
IsMethod = true;
public bool Build (string projectOrSolution, string target, string [] parameters = null, Dictionary<string, string> environmentVariables = null)
{
return BuildInternal (projectOrSolution, target, parameters, environmentVariables);
}
}
}

sealed class SourceFile : IEnumerable<SourceFileMember>
{
readonly List<SourceFileMember> properties;

public string Path { get; }
public bool ForMany { get; }
sealed class SourceFileMember
{
public string Visibility { get; }
public string Type { get; }
public string Name { get; }
public string Arguments { get; }
public bool IsExpressionBody { get; }
public bool IsMethod { get; }

public SourceFileMember (string visibility, string type, string name, bool isExpressionBody)
{
if (String.IsNullOrEmpty (visibility))
throw new ArgumentException (nameof (visibility));
if (String.IsNullOrEmpty (type))
throw new ArgumentException (nameof (type));
if (String.IsNullOrEmpty (name))
throw new ArgumentException (nameof (name));
Visibility = visibility;
Type = type;
Name = name;
IsExpressionBody = isExpressionBody;
IsMethod = false;
}

public SourceFile (string path, bool forMany = false)
{
if (String.IsNullOrEmpty (path))
throw new ArgumentException (nameof (path));
Path = path;
ForMany = forMany;
properties = new List <SourceFileMember> ();
public SourceFileMember (string visibility, string type, string name, string arguments)
{
if (String.IsNullOrEmpty (visibility))
throw new ArgumentException (nameof (visibility));
if (String.IsNullOrEmpty (type))
throw new ArgumentException (nameof (type));
if (String.IsNullOrEmpty (name))
throw new ArgumentException (nameof (name));
Visibility = visibility;
Type = type;
Name = name;
Arguments = arguments ?? String.Empty;
IsExpressionBody = false;
IsMethod = true;
}
}

public void Add (string visibility, string type, string name, bool isExpressionBody = true)
sealed class SourceFile : IEnumerable<SourceFileMember>
{
properties.Add (new SourceFileMember (visibility, type, name, isExpressionBody));
}
readonly List<SourceFileMember> properties;

public void Add (string visibility, string type, string name, string arguments)
{
properties.Add (new SourceFileMember (visibility, type, name, arguments));
}
public string Path { get; }
public bool ForMany { get; }

public IEnumerator<SourceFileMember> GetEnumerator()
{
return ((IEnumerable<SourceFileMember>)properties).GetEnumerator ();
}
public SourceFile (string path, bool forMany = false)
{
if (String.IsNullOrEmpty (path))
throw new ArgumentException (nameof (path));
Path = path;
ForMany = forMany;
properties = new List<SourceFileMember> ();
}

IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<SourceFileMember>)properties).GetEnumerator ();
}
}
public void Add (string visibility, string type, string name, bool isExpressionBody = true)
{
properties.Add (new SourceFileMember (visibility, type, name, isExpressionBody));
}

sealed class TestProjectInfo
{
public string RootDirectory { get; }
public string OutputDirectory { get; }
public string ObjPath { get; }
public string BinPath { get; }
public string GeneratedPath { get; }
public string SlnPath { get; }
public string ProjectName { get; }
public string TestName { get; }
public void Add (string visibility, string type, string name, string arguments)
{
properties.Add (new SourceFileMember (visibility, type, name, arguments));
}

public IEnumerator<SourceFileMember> GetEnumerator ()
{
return ((IEnumerable<SourceFileMember>) properties).GetEnumerator ();
}

public TestProjectInfo (string projectName, string testName, string rootDirectory, string outputRootDir)
IEnumerator IEnumerable.GetEnumerator ()
{
return ((IEnumerable<SourceFileMember>) properties).GetEnumerator ();
}
}

sealed class TestProjectInfo
{
TestName = testName;
RootDirectory = rootDirectory;
ProjectName = projectName;
public string RootDirectory { get; }
public string OutputDirectory { get; }
public string ObjPath { get; }
public string BinPath { get; }
public string GeneratedPath { get; }
public string SlnPath { get; }
public string ProjectName { get; }
public string TestName { get; }

public TestProjectInfo (string projectName, string testName, string rootDirectory, string outputRootDir)
{
TestName = testName;
RootDirectory = rootDirectory;
ProjectName = projectName;

ObjPath = Path.Combine (rootDirectory, "obj");
GeneratedPath = Path.Combine (ObjPath, XABuildPaths.Configuration, "generated");
BinPath = Path.Combine (rootDirectory, "bin", XABuildPaths.Configuration);
SlnPath = Path.Combine (rootDirectory, $"{projectName}.sln");
ObjPath = Path.Combine (rootDirectory, "obj");
GeneratedPath = Path.Combine (ObjPath, XABuildPaths.Configuration, "generated");
BinPath = Path.Combine (rootDirectory, "bin", XABuildPaths.Configuration);
SlnPath = Path.Combine (rootDirectory, $"{projectName}.sln");

OutputDirectory = Path.Combine (outputRootDir, testName, XABuildPaths.Configuration);
OutputDirectory = Path.Combine (outputRootDir, testName, XABuildPaths.Configuration);
}
}
}

[Parallelizable (ParallelScope.Children)]
public class BuildTests_CodeBehindBuildTests
{
const string ProjectName = "CodeBehindBuildTests";
const string CommonSampleLibraryName = "CommonSampleLibrary";

Expand All @@ -147,7 +148,7 @@ public class BuildTests_CodeBehindBuildTests
"msbuild.binlog",
};

static BuildTests_CodeBehindBuildTests ()
static CodeBehindTests ()
{
TestProjectRootDirectory = Path.GetFullPath (Path.Combine (XABuildPaths.TopDirectory, "tests", "CodeBehind", "BuildTests"));
CommonSampleLibraryRootDirectory = Path.GetFullPath (Path.Combine (XABuildPaths.TopDirectory, "tests", "CodeBehind", CommonSampleLibraryName));
Expand Down
Loading