Skip to content

Commit a6b92b0

Browse files
committedOct 17, 2012
Deploy script runs unit tests and verifies VSIX
The deploy script now runs the unit test DLLs in release and verifies that the VSIX contents are correct. The VSIX in particular is troublesome because it's easy to mess up the contents and have files randomly get added or deleted. Can't fully verify the script because I have failing tests. Will clean them up with another change.
1 parent 981a0f9 commit a6b92b0

5 files changed

+1287
-2
lines changed
 

‎Deploy.ps1

+54-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,51 @@ function test-vsixcontents() {
3636
$dest = $shellApp.NameSpace($target)
3737
$items = $source.Items()
3838
$dest.Copyhere($items, 20)
39+
40+
$files = gci $target | %{ $_.Name }
41+
if ($files.Count -ne 13) {
42+
write-error "Found $($files.Count) but expected 13"
43+
}
44+
45+
# The set of important files that are easy to miss
46+
# - FSharp.Core.dll: We bind to the 4.0 version but 2012 only installs
47+
# the 4.5 version that we can't bind to
48+
# - EditorUtils.dll: Not a part of the build but necessary. Make sure
49+
# that it's found
50+
$expected =
51+
"FSharp.Core.dll",
52+
"EditorUtils.dll",
53+
"Vim.Core.dll",
54+
"Vim.UI.Wpf.dll",
55+
"VsVim.Dev10.dll",
56+
"VsVim.Dev11.dll",
57+
"VsVim.dll",
58+
"VsVim.Shared.dll"
59+
60+
foreach ($item in $expected) {
61+
if (-not ($files -contains $item)) {
62+
write-error "Didn't found $item in the zip file ($target)"
63+
}
64+
}
65+
}
66+
67+
# Run all of the unit tests
68+
function test-unittests() {
69+
$all =
70+
"VimCoreTest\bin\Release\Vim.Core.UnitTest.dll",
71+
"VimWpfTest\bin\Release\Vim.UI.Wpf.UnitTest.dll",
72+
"VsVimSharedTest\bin\Release\VsVim.Shared.UnitTest.dll"
73+
$xunit = join-path $scriptPath "Tools\xunit.console.clr4.x86.exe"
74+
75+
write-host "Running Unit Tests"
76+
foreach ($file in $all) {
77+
$name = split-path -leaf $file
78+
write-host -NoNewLine ("`t{0}: " -f $name)
79+
$output = & $xunit $file /silent
80+
test-return
81+
$last = $output[$output.Count - 1]
82+
write-host $last
83+
}
3984
}
4085

4186
function build-clean() {
@@ -68,9 +113,15 @@ if (-not $fast) {
68113
}
69114
}
70115

116+
# Build all of the relevant projects. Both the deployment binaries and the
117+
# test infrastructure
118+
write-host "Building Projects"
119+
build-release VimCoreTest\VimCoreTest.csproj
120+
build-release VimWpfTest\VimWpfTest.csproj
121+
build-release VsVimSharedTest\VsVimSharedTest.csproj
122+
71123
# Next step is to build the 2012 components. We need to get the 2010 specific DLL
72124
# to deploy with the standard install
73-
write-host "Building Projects"
74125
build-release VsVimSpecific\VsVimDev11.csproj
75126

76127
# Copy the 2012 specfic components into the location expected by the build system
@@ -79,6 +130,7 @@ copy VsVimSpecific\bin11\Release\VsVim.Dev11.dll VsVim
79130
# Now build the final output project
80131
build-release VsVim\VsVim.csproj
81132

133+
write-host "Verifying the Vsix Contents"
82134
$vsixPath = "VsVim\bin\Release\VsVim.vsix"
83135
test-vsixcontents $vsixPath
84-
136+
test-unittests

‎Tools/xunit.console.clr4.x86.exe

25 KB
Binary file not shown.
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
4+
<configSections>
5+
<section name="xunit" type="Xunit.ConsoleClient.XunitConsoleConfigurationSection, xunit.console.clr4.x86"/>
6+
</configSections>
7+
8+
<xunit>
9+
<transforms>
10+
<add
11+
commandline="html"
12+
xslfile="HTML.xslt"
13+
description="output results to HTML file"/>
14+
<add
15+
commandline="nunit"
16+
xslfile="NUnitXml.xslt"
17+
description="output results to NUnit-style XML file"/>
18+
</transforms>
19+
</xunit>
20+
21+
</configuration>

‎Tools/xunit.runner.utility.dll

45.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)