Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ NUnit-Frame-Report
NUnit-NoFrame-Report
Mock-Frame-Report
Mock-NoFrame-Report
/src/.vs
15 changes: 15 additions & 0 deletions src/Tasks/ValidateXmlTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ public class ValidateXmlTask : Task {

#region Public Instance Properties

/// <summary>
/// Report warnings as errors.
/// </summary>
[TaskAttribute("failonwarn")]
[BooleanValidator]
public bool FailOnWarn
{
get;
set;
}

/// <summary>
/// The XML files that must be validated.
/// </summary>
Expand Down Expand Up @@ -157,6 +168,10 @@ private void OnValidationError(object sender, ValidationEventArgs args) {
case XmlSeverityType.Warning:
// output error message
Log(Level.Info, "Validation warning: {0}", args.Message);
if (this.FailOnWarn)
{
_numErrors++;
}
break;
}
}
Expand Down