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 1612937
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
10 changes: 10 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ 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..."
$tests = @("test_shared_ptr", "test_util_string")
foreach ($test in $tests) {
msbuild -verbosity:m /m:4 /p:"Configuration=$env:Config;Platform=$env:Platform" "test\$test.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
39 changes: 39 additions & 0 deletions test/test.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<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" />
<Target Name="Run Tests">
<Exec Command="$(OutDir)\$(AssemblyName)"/>
</Target>
<Target Name="AfterBuild" DependsOnTargets="Run Tests" />
</Project>
8 changes: 8 additions & 0 deletions test/test_shared_ptr.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<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>
</Project>
8 changes: 8 additions & 0 deletions test/test_util_string.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<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>
</Project>

0 comments on commit 1612937

Please sign in to comment.