Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

IfDefd a test in mono and added xunit mono build task

  • Loading branch information...
commit f937f709bc2cc99607e0eff5107f165115879ebc 1 parent aa0ecc7
Steven Robbins grumpydev authored
26 rakefile.rb
View
@@ -7,6 +7,7 @@
NANCY_VERSION = "0.7.1"
OUTPUT = "build"
CONFIGURATION = 'Release'
+CONFIGURATIONMONO = 'MonoRelease'
SHARED_ASSEMBLY_INFO = 'src/SharedAssemblyInfo.cs'
SOLUTION_FILE = 'src/Nancy.sln'
@@ -21,6 +22,12 @@
desc "Executes all MSpec and Xunit tests"
task :test => [:mspec, :xunit]
+desc "Compiles solution and runs unit tests for Mono"
+task :mono => [:clean, :version, :compilemono, :testmono]
+
+desc "Executes all tests with Mono"
+task :testmono => [:xunitmono]
+
#Add the folders that should be cleaned as part of the clean task
CLEAN.include(OUTPUT)
CLEAN.include(FileList["src/**/#{CONFIGURATION}"])
@@ -43,6 +50,15 @@
msb.solution = SOLUTION_FILE
end
+desc "Compile solution file for Mono"
+msbuild :compilemono => [:version] do |msb|
+ msb.command = "xbuild"
+ msb.properties :configuration => CONFIGURATIONMONO
+ msb.targets :Clean, :Build
+ msb.solution = SOLUTION_FILE
+end
+
+
desc "Gathers output files and copies them to the output folder"
task :publish => [:compile] do
Dir.mkdir(OUTPUT)
@@ -67,6 +83,14 @@
xunit.assemblies = tests
end
+desc "Executes xUnit tests using Mono"
+xunit :xunitmono => [] do |xunit|
+ tests = FileList["src/**/#{CONFIGURATIONMONO}/*.Tests.dll"].exclude(/obj\//)
+
+ xunit.command = "tools/xunit/xunitmono.sh"
+ xunit.assemblies = tests
+end
+
desc "Zips up the built binaries for easy distribution"
zip :package => [:publish] do |zip|
Dir.mkdir("#{OUTPUT}/packages")
@@ -160,4 +184,4 @@ def update_xml(xml_path)
# 4. Zip binaries with docs (named with version number) - DONE
# 5. Create a how to build file - DONE
# 6. TeamCity integration - DONE
-# 7. NuGet task - DONE
+# 7. NuGet task - DONE
6 src/Nancy.Testing.Tests/BrowserResponseBodyWrapperFixture.cs
View
@@ -49,7 +49,11 @@ public void Should_return_querywrapper_for_css_selector_match()
var result = body["#bar"];
// Then
- result.ShouldContain("inner");
+#if __MonoCS__
+ AssertExtensions.ShouldContain(result, "inner", System.StringComparison.OrdinalIgnoreCase);
+#else
+ result.ShouldContain("inner");
+#endif
}
}
}
4 tools/xunit/xunitmono.sh
View
@@ -0,0 +1,4 @@
+#!/bin/sh
+BASEDIR=$(dirname $0)
+
+mono ${BASEDIR}/xunit.console.clr4.x86.exe $*
Please sign in to comment.
Something went wrong with that request. Please try again.