diff --git a/appveyor.yml b/appveyor.yml
index 2909da65b7..db7d129dd1 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -20,6 +20,11 @@ build_script:
- ps: .\build.ps1 -Target "AppVeyor" -Platform "$env:platform" -Configuration "$env:configuration"
after_build:
- .\packages\JetBrains.dotMemoryUnit.2.1.20150828.125449\tools\dotMemoryUnit.exe -targetExecutable="%xunit20%\xunit.console.x86.exe" -returnTargetExitCode --"tests\Avalonia.LeakTests\bin\Release\Avalonia.LeakTests.dll"
+
+- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
+- pip install codecov
+- codecov -f "./artifacts/coverage.xml"
+
test: off
artifacts:
- path: artifacts\nuget\*.nupkg
diff --git a/build.cake b/build.cake
index d128fbcc5e..a3d7cf64d2 100644
--- a/build.cake
+++ b/build.cake
@@ -10,6 +10,7 @@
///////////////////////////////////////////////////////////////////////////////
#tool "nuget:?package=xunit.runner.console&version=2.1.0"
+#tool "nuget:?package=OpenCover"
///////////////////////////////////////////////////////////////////////////////
// USINGS
@@ -92,6 +93,7 @@ var artifactsDir = (DirectoryPath)Directory("./artifacts");
var nugetRoot = artifactsDir.Combine("nuget");
var zipRoot = artifactsDir.Combine("zip");
var binRoot = artifactsDir.Combine("bin");
+var testsRoot = artifactsDir.Combine("tests");
var dirSuffix = configuration;
var dirSuffixSkia = (isPlatformAnyCPU ? "x86" : platform) + "/" + configuration;
@@ -585,6 +587,7 @@ Task("Clean")
CleanDirectory(nugetRoot);
CleanDirectory(zipRoot);
CleanDirectory(binRoot);
+ CleanDirectory(testsRoot);
});
Task("Restore-NuGet-Packages")
@@ -670,18 +673,35 @@ Task("Run-Unit-Tests")
"./tools/xunit.runner.console/tools/xunit.console.x86.exe" :
"./tools/xunit.runner.console/tools/xunit.console.exe";
- var settings = new XUnit2Settings
+ var xUnitSettings = new XUnit2Settings
{
ToolPath = toolPath,
- Parallelism = ParallelismOption.None
+ Parallelism = ParallelismOption.None,
+ ShadowCopy = false
};
- settings.NoAppDomain = !isRunningOnWindows;
+ xUnitSettings.NoAppDomain = !isRunningOnWindows;
- foreach (var file in unitTests)
+ var openCoverOutput = artifactsDir.GetFilePath(new FilePath("./coverage.xml"));
+ var openCoverSettings = new OpenCoverSettings()
+ .WithFilter("+[Avalonia.*]* -[*Test*]* -[ControlCatalog*]*")
+ .WithFilter("-[Avalonia.*]OmniXaml.* -[Avalonia.*]Glass.*")
+ .WithFilter("-[Avalonia.HtmlRenderer]TheArtOfDev.HtmlRenderer.* +[Avalonia.HtmlRenderer]TheArtOfDev.HtmlRenderer.Avalonia.* -[Avalonia.ReactiveUI]*");
+
+ foreach(var test in unitTests)
{
- Information("Running test " + file.GetFilenameWithoutExtension());
- XUnit2(file.FullPath, settings);
+ CopyDirectory(test.GetDirectory(), testsRoot);
+ }
+
+ if(isRunningOnWindows)
+ {
+ OpenCover(context => {
+ context.XUnit2(unitTests.Select(test => testsRoot.GetFilePath(test).FullPath), xUnitSettings);
+ }, openCoverOutput, openCoverSettings);
+ }
+ else
+ {
+ XUnit2(unitTests.Select(test => test.FullPath), xUnitSettings);
}
});
diff --git a/samples/BindingTest/MainWindow.xaml b/samples/BindingTest/MainWindow.xaml
index 02c364346d..95f671fd84 100644
--- a/samples/BindingTest/MainWindow.xaml
+++ b/samples/BindingTest/MainWindow.xaml
@@ -41,6 +41,10 @@
+
+
+
+
diff --git a/samples/BindingTest/ViewModels/MainWindowViewModel.cs b/samples/BindingTest/ViewModels/MainWindowViewModel.cs
index 94f7ff595a..4b58bf2279 100644
--- a/samples/BindingTest/ViewModels/MainWindowViewModel.cs
+++ b/samples/BindingTest/ViewModels/MainWindowViewModel.cs
@@ -3,6 +3,8 @@ using System.Collections.ObjectModel;
using System.Linq;
using ReactiveUI;
using System.Reactive.Linq;
+using System.Threading.Tasks;
+using System.Threading;
namespace BindingTest.ViewModels
{
@@ -12,6 +14,7 @@ namespace BindingTest.ViewModels
private double _doubleValue = 5.0;
private string _stringValue = "Simple Binding";
private bool _booleanFlag = false;
+ private string _currentTime;
public MainWindowViewModel()
{
@@ -37,6 +40,15 @@ namespace BindingTest.ViewModels
BooleanFlag = !BooleanFlag;
StringValue = param.ToString();
});
+
+ Task.Run(() =>
+ {
+ while (true)
+ {
+ CurrentTime = DateTimeOffset.Now.ToString();
+ Thread.Sleep(1000);
+ }
+ });
}
public ObservableCollection Items { get; }
@@ -67,6 +79,12 @@ namespace BindingTest.ViewModels
set { this.RaiseAndSetIfChanged(ref _booleanFlag, value); }
}
+ public string CurrentTime
+ {
+ get { return _currentTime; }
+ private set { this.RaiseAndSetIfChanged(ref _currentTime, value); }
+ }
+
public ReactiveCommand