Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit 435c02f

Browse files
committed
Update test runner
1 parent 2e303ac commit 435c02f

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

examples/03-CreateAppPool/Web.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if ($pool -eq $null) {
2525

2626
# Older applications may require "Classic" mode, but most modern ASP.NET
2727
# apps use the integrated pipeline
28-
Set-ItemProperty -Path "IIS:\AppPools\My Pool 3" -name "managedPipelineMode" -value "Integrated"
28+
Set-ItemProperty -Path "IIS:\AppPools\My Pool 3" -name "managedPipelineMode" -value Integrated
2929

3030
# What version of the .NET runtime to use. Valid options are "v2.0" and
3131
# "v4.0". IIS Manager often presents them as ".NET 4.5", but these still

src/ExampleRunner/Program.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ class Program
1616
static readonly string OutputFile = Path.GetFullPath("..\\..\\..\\..\\out.md");
1717
static readonly Regex FileNameFilterRegex = new Regex("^[^_].*README\\.md$", RegexOptions.IgnoreCase);
1818

19-
static void Main(string[] args)
19+
static int Main(string[] args)
2020
{
2121
Initialize();
2222
EnsureExamplesDirectory();
2323
GenerateDocumentation();
2424
RunAllExamples();
25+
26+
if (TeamCitySink.Errors != 0)
27+
{
28+
Console.WriteLine("Failed {0} errors", TeamCitySink.Errors);
29+
}
30+
else
31+
{
32+
Console.WriteLine("Success!");
33+
}
34+
return TeamCitySink.Errors;
2535
}
2636

2737
static void Initialize()

src/ExampleRunner/TeamCitySink.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
using System;
2+
using System.Threading;
23
using Serilog.Core;
34
using Serilog.Events;
45

56
namespace ExampleRunner
67
{
78
class TeamCitySink : ILogEventSink
89
{
10+
public static int Errors = 0;
11+
912
public void Emit(LogEvent logEvent)
1013
{
1114
if (logEvent.Level >= LogEventLevel.Warning)
1215
{
16+
Interlocked.Increment(ref Errors);
17+
1318
var formatter = new JetBrains.TeamCity.ServiceMessages.Write.ServiceMessageFormatter();
1419
var formatted = formatter.FormatMessage("message",
1520
new

0 commit comments

Comments
 (0)