Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run C++ unit tests on AppVeyor #2875

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "ToolsVersion" is lower because we're still stuck on 2013. ? Maybe 12.0

Copy link
Contributor Author

@glebm glebm Apr 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took it from here but I think you're right: https://github.com/sass/libsass/blob/9740de67d01d1f9da0278dca1ffad984304f9124/win/libsass.vcxproj#2

This MSDN article says:

Visual Studio 2013 uses a ToolsVersion of 12.0. Visual Studio 2015 uses ToolsVersion 14.0

<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>