Browse Source

Making build and tests work on Mono

pull/728/head
David Karlaš 10 years ago
parent
commit
d90a556397
  1. 8
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  2. 6
      ICSharpCode.Decompiler/Tests/CustomAttributes/CustomAttributeTests.cs
  3. 4
      ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs

8
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -182,8 +182,12 @@ @@ -182,8 +182,12 @@
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<Target Name="BeforeBuild">
<PropertyGroup>
<UpdateAssemblyInfo>UpdateAssemblyInfo.exe</UpdateAssemblyInfo>
<UpdateAssemblyInfo Condition="$(OS)=='Unix'">mono $(UpdateAssemblyInfo)</UpdateAssemblyInfo>
</PropertyGroup>
<MSBuild Projects="$(MSBuildProjectDirectory)\..\BuildTools\UpdateAssemblyInfo\UpdateAssemblyInfo.csproj" Targets="Build" Properties="Configuration=Debug" />
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\..\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="UpdateAssemblyInfo.exe --branchname $(BranchName)" Timeout="60000" Condition=" '$(BranchName)' != '' " />
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\..\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="UpdateAssemblyInfo.exe" Timeout="60000" Condition=" '$(BranchName)' == '' " />
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\..\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="$(UpdateAssemblyInfo) --branchname $(BranchName)" Timeout="60000" Condition=" '$(BranchName)' != '' " />
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\..\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="$(UpdateAssemblyInfo)" Timeout="60000" Condition=" '$(BranchName)' == '' " />
</Target>
</Project>

6
ICSharpCode.Decompiler/Tests/CustomAttributes/CustomAttributeTests.cs

@ -12,19 +12,19 @@ namespace ICSharpCode.Decompiler.Tests.CustomAttributes @@ -12,19 +12,19 @@ namespace ICSharpCode.Decompiler.Tests.CustomAttributes
[Test]
public void CustomAttributeSamples()
{
ValidateFileRoundtrip(@"CustomAttributes\S_CustomAttributeSamples.cs");
ValidateFileRoundtrip(@"CustomAttributes/S_CustomAttributeSamples.cs");
}
[Test]
public void CustomAttributesMultiTest()
{
ValidateFileRoundtrip(@"CustomAttributes\S_CustomAttributes.cs");
ValidateFileRoundtrip(@"CustomAttributes/S_CustomAttributes.cs");
}
[Test]
public void AssemblyCustomAttributesMultiTest()
{
ValidateFileRoundtrip(@"CustomAttributes\S_AssemblyCustomAttribute.cs");
ValidateFileRoundtrip(@"CustomAttributes/S_AssemblyCustomAttribute.cs");
}
}
}

4
ICSharpCode.Decompiler/Tests/DecompilerTestBase.cs

@ -35,7 +35,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -35,7 +35,7 @@ namespace ICSharpCode.Decompiler.Tests
{
protected static void ValidateFileRoundtrip(string samplesFileName)
{
var fullPath = Path.Combine(@"..\..\Tests", samplesFileName);
var fullPath = Path.Combine(@"../../Tests", samplesFileName);
AssertRoundtripCode(fullPath);
}
@ -68,7 +68,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -68,7 +68,7 @@ namespace ICSharpCode.Decompiler.Tests
CompilerResults results = provider.CompileAssemblyFromSource(options, code);
try
{
if (results.Errors.Count > 0)
if (results.Errors.Cast<CompilerError>().Any((arg) => !arg.IsWarning))
{
StringBuilder b = new StringBuilder("Compiler error:");
foreach (var error in results.Errors)

Loading…
Cancel
Save