Skip to content

Commit

Permalink
Run C++ unit tests on AppVeyor
Browse files Browse the repository at this point in the history
Previously, these only ran on Travis.
  • Loading branch information
glebm committed Apr 13, 2019
1 parent bfa4472 commit 86267ec
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
8 changes: 8 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ test_script:
git -C sass-spec checkout -q --force ci-spec-pr-$SPEC_PR
}
}
if ($env:Compiler -eq "mingw") {
Write-Host "Running libsass unit tests via mingw32-make..."
mingw32-make -C test test
} else {
Write-Host "Running libsass unit tests via msbuild..."
msbuild /m:4 /p:"Configuration=$env:Config;Platform=$env:Platform" test\test_shared_ptr.vcxproj
msbuild /m:4 /p:"Configuration=$env:Config;Platform=$env:Platform" test\test_util_string.vcxproj
}
$env:TargetPath = Join-Path $pwd.Path $env:TargetPath
If (Test-Path "$env:TargetPath") {
ruby sass-spec/sass-spec.rb --probe-todo --impl libsass -c $env:TargetPath -s sass-spec/spec
Expand Down
35 changes: 35 additions & 0 deletions test/test.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup>
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
<OutputPath>$(SolutionDir)\build\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
<OutDir>$(OutputPath)</OutDir>
<UseCommonOutputDirectory>True</UseCommonOutputDirectory>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<IncludePath>../include;$(IncludePath)</IncludePath>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
</Project>
11 changes: 11 additions & 0 deletions test/test_shared_ptr.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="test.props" />
<ItemGroup>
<ClInclude Include="../src/memory/SharedPtr.h" />
<ClCompile Include="../src/memory/SharedPtr.cpp" />
<ClCompile Include="test_shared_ptr.cpp" />
</ItemGroup>
<Target Name="AfterBuild">
<Exec Command="$(OutDir)\test_shared_ptr.exe"/>
</Target>
</Project>
11 changes: 11 additions & 0 deletions test/test_util_string.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="test.props" />
<ItemGroup>
<ClInclude Include="../src/util_string.h" />
<ClCompile Include="../src/util_string.cpp" />
<ClCompile Include="test_util_string.cpp" />
</ItemGroup>
<Target Name="AfterBuild">
<Exec Command="$(OutDir)\test_util_string.exe"/>
</Target>
</Project>

0 comments on commit 86267ec

Please sign in to comment.