Skip to content
Permalink
Browse files

Adding build status badges to the README.md (#63)

* Adding build status badges to the README.md

* Resolving remaining CI issues
  • Loading branch information...
tannergooding committed Jun 6, 2019
1 parent 32250ce commit 2740afee2cb6a74f22811462fea9545cf21d4f75
@@ -22,6 +22,7 @@

<!-- Package versions for package references across all projects -->
<ItemGroup>
<PackageReference Update="libClang" Version="5.0.0" NoWarn="NU1701" />
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="3.2.0-beta1-final" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.6.0" />
<PackageReference Update="System.CommandLine.Experimental" Version="0.2.0-alpha.19174.3" />
@@ -2,6 +2,12 @@

ClangSharp are strongly-typed safe Clang bindings written in C# for .NET and Mono, tested on Linux and Windows. ClangSharp is self-hosted and ClangSharp auto-generates itself parsing LLVM-C header files.

| Job | Debug Status | Release Status |
| --- | ------------ | -------------- |
| Windows x86 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_debug_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_release_x86)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
| Windows x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=windows_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |
| Ubuntu 16.04 x64 | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=ubuntu_1604_debug_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) | [![Build Status](https://dev.azure.com/ms/ClangSharp/_apis/build/status/microsoft.ClangSharp?branchName=master&jobName=ubuntu_1604_release_x64)](https://dev.azure.com/ms/ClangSharp/_build/latest?definitionId=155&branchName=master) |

If you're on Windows, consider using the [**ClangSharp 3.6 NuGet Package**](http://www.nuget.org/packages/ClangSharp/3.6.0) - built from Clang 3.6 Release.

## Building ClangSharp
@@ -110,16 +110,19 @@ try {
Create-Directory -Path $LogDir

if ($architecture -ne "") {
$DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
$env:DOTNET_MULTILEVEL_LOOKUP = 0
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1

$DotNetInstallScript = Join-Path -Path $ArtifactsDir -ChildPath "dotnet-install.ps1"
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile $DotNetInstallScript -UseBasicParsing

$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory

& $DotNetInstallScript -Channel 2.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
& $DotNetInstallScript -Channel release/3.0.1xx -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
& $DotNetInstallScript -Channel 2.1 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet
& $DotNetInstallScript -Channel 2.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture -Runtime dotnet

$env:PATH="$DotNetInstallDirectory;$env:PATH"
}
@@ -194,16 +194,19 @@ LogDir="$ArtifactsDir/log"
CreateDirectory "$LogDir"

if [[ ! -z "$architecture" ]]; then
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_MULTILEVEL_LOOKUP=0
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

DotNetInstallScript="$ArtifactsDir/dotnet-install.ps1"
DotNetInstallScript="$ArtifactsDir/dotnet-install.sh"
wget -O "$DotNetInstallScript" "https://dot.net/v1/dotnet-install.sh"

DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"

. "$DotNetInstallScript" --channel 2.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
. "$DotNetInstallScript" --channel release/3.0.1xx --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
. "$DotNetInstallScript" --channel 2.1 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet
. "$DotNetInstallScript" --channel 2.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture" --runtime dotnet

PATH="$DotNetInstallDirectory:$PATH:"
fi
@@ -5,4 +5,8 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="libClang" />
</ItemGroup>

</Project>
@@ -100,6 +100,7 @@ public static int Run(InvocationContext context)

var clangCommandLineArgs = new string[]
{
"-std=c++11", // The input files should be compiled for C++ 11
"-xc++", // The input files are C++
"-Wno-pragma-once-outside-header" // We are processing files which may be header files
};
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;

@@ -9,7 +9,7 @@ public sealed class EnumDeclarationTest : PInvokeGeneratorTest
[Fact]
public async Task BasicTest()
{
var inputContents = @"enum MyEnum
var inputContents = @"enum MyEnum : int
{
MyEnum_Value0,
MyEnum_Value1,
@@ -34,7 +34,7 @@ public enum MyEnum
[Fact]
public async Task BasicValueTest()
{
var inputContents = @"enum MyEnum
var inputContents = @"enum MyEnum : int
{
MyEnum_Value1 = 1,
MyEnum_Value2,
@@ -59,7 +59,14 @@ public enum MyEnum
[Fact]
public async Task ExcludeTest()
{
var inputContents = "typedef enum MyEnum MyEnum;";
var inputContents = @"enum MyEnum : int
{
MyEnum_Value0,
MyEnum_Value1,
MyEnum_Value2,
};
";

var expectedOutputContents = string.Empty;

var excludedNames = new string[] { "MyEnum" };
@@ -98,64 +105,30 @@ public enum MyEnum : {expectedManagedType}
await ValidateGeneratedBindings(inputContents, expectedOutputContents);
}

[Fact]
public async Task NoDefinitionTest()
{
var inputContents = "typedef enum MyEnum MyEnum;";

var expectedOutputContents = $@"namespace ClangSharp.Test
{{
public enum MyEnum
{{
}}
}}
";

await ValidateGeneratedBindings(inputContents, expectedOutputContents);
}

[Fact]
public async Task RemapTest()
{
var inputContents = "typedef enum _MyEnum MyEnum;";

var expectedOutputContents = $@"namespace ClangSharp.Test
{{
public enum MyEnum
{{
}}
}}
";

var remappedNames = new Dictionary<string, string> { ["_MyEnum"] = "MyEnum" };
await ValidateGeneratedBindings(inputContents, expectedOutputContents, excludedNames: null, remappedNames);
}

[Fact]
public async Task SkipNonDefinitionTest()
{
var inputContents = $@"typedef enum MyEnum MyEnum;
enum MyEnum
{{
MyEnum_Value0,
var inputContents = @"typedef enum _MyEnum : int
{
MyEnum_Value1,
MyEnum_Value2,
}};
MyEnum_Value3,
} MyEnum;
";

var expectedOutputContents = $@"namespace ClangSharp.Test
{{
public enum MyEnum
{{
MyEnum_Value0,
MyEnum_Value1,
MyEnum_Value2,
MyEnum_Value3,
}}
}}
";

await ValidateGeneratedBindings(inputContents, expectedOutputContents);
var remappedNames = new Dictionary<string, string> { ["_MyEnum"] = "MyEnum" };
await ValidateGeneratedBindings(inputContents, expectedOutputContents, excludedNames: null, remappedNames);
}
}
}
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Xunit;
@@ -16,6 +16,7 @@ public abstract class PInvokeGeneratorTest

protected static readonly string[] DefaultClangCommandLineArgs = new string[]
{
"-std=c++11", // The input files should be compiled for C++ 11
"-xc++", // The input files are C++
"-Wno-pragma-once-outside-header" // We are processing files which may be header files
};

0 comments on commit 2740afe

Please sign in to comment.
You can’t perform that action at this time.