Browse Source

Making build and tests work on Mono

pull/728/head
David Karlaš 11 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 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<Target Name="BeforeBuild"> <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" /> <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) --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)" Timeout="60000" Condition=" '$(BranchName)' == '' " />
</Target> </Target>
</Project> </Project>

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

@ -12,19 +12,19 @@ namespace ICSharpCode.Decompiler.Tests.CustomAttributes
[Test] [Test]
public void CustomAttributeSamples() public void CustomAttributeSamples()
{ {
ValidateFileRoundtrip(@"CustomAttributes\S_CustomAttributeSamples.cs"); ValidateFileRoundtrip(@"CustomAttributes/S_CustomAttributeSamples.cs");
} }
[Test] [Test]
public void CustomAttributesMultiTest() public void CustomAttributesMultiTest()
{ {
ValidateFileRoundtrip(@"CustomAttributes\S_CustomAttributes.cs"); ValidateFileRoundtrip(@"CustomAttributes/S_CustomAttributes.cs");
} }
[Test] [Test]
public void AssemblyCustomAttributesMultiTest() 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
{ {
protected static void ValidateFileRoundtrip(string samplesFileName) protected static void ValidateFileRoundtrip(string samplesFileName)
{ {
var fullPath = Path.Combine(@"..\..\Tests", samplesFileName); var fullPath = Path.Combine(@"../../Tests", samplesFileName);
AssertRoundtripCode(fullPath); AssertRoundtripCode(fullPath);
} }
@ -68,7 +68,7 @@ namespace ICSharpCode.Decompiler.Tests
CompilerResults results = provider.CompileAssemblyFromSource(options, code); CompilerResults results = provider.CompileAssemblyFromSource(options, code);
try try
{ {
if (results.Errors.Count > 0) if (results.Errors.Cast<CompilerError>().Any((arg) => !arg.IsWarning))
{ {
StringBuilder b = new StringBuilder("Compiler error:"); StringBuilder b = new StringBuilder("Compiler error:");
foreach (var error in results.Errors) foreach (var error in results.Errors)

Loading…
Cancel
Save