-
-
-
[0-9A-Fa-f]+);",
+ RegexOptions.Multiline | RegexOptions.Compiled);
int testsPassed = 0;
int testsFailed = 0;
int testsSkipped = 0;
@@ -169,8 +123,20 @@
foreach (string testResultFile in testResultFiles)
{
+ // Replace potentially illegal escaped characters (if they get through validations done during Save).
+ string fullPath = Path.GetFullPath(testResultFile);
+ string originalText = File.ReadAllText(fullPath);
+ bool matched = regex.IsMatch(originalText);
+
+ if (matched)
+ {
+ File.SetAttributes(fullPath, File.GetAttributes(fullPath) & ~FileAttributes.ReadOnly);
+ File.WriteAllText(fullPath, regex.Replace(originalText, "\0x${char}"), Encoding.UTF8);
+ }
+
+ // Collect test failure information from results file.
XElement xml;
- using (FileStream fileStream = File.OpenRead(testResultFile))
+ using (FileStream fileStream = File.OpenRead(fullPath))
{
xml = XElement.Load(fileStream);
}
@@ -213,23 +179,32 @@
}
}
+ // Log all test failures.
if (testFailures.Count > 0)
{
- Console.WriteLine();
- Console.WriteLine(" Test Failures:");
- ConsoleColor originalColor = Console.ForegroundColor;
- Console.ForegroundColor = ConsoleColor.Red;
+ Log.LogMessage(MessageImportance.High, string.Empty);
+ Log.LogError("Tests failed...");
foreach (string testFailure in testFailures)
{
- Console.WriteLine(" " + testFailure);
+ // Provide the list of failed tests but don't repeat it in the build summary. List
+ // is usually less helpful than errors from tests themselves (which are repeated)
+ // because those errors include the exact failure locations. On the other hand,
+ // this is more compact.
+ Log.LogMessage(MessageImportance.High, testFailure);
}
- Console.ForegroundColor = originalColor;
}
- Console.WriteLine();
- Console.WriteLine(" Tests passed: {0}, Tests failed: {1}, Tests skipped: {2}", testsPassed, testsFailed, testsSkipped);
- Console.WriteLine(" Time spent running tests: {0} seconds", timeSpent);
- return true;
+ // Log summary of all results.
+ Log.LogMessage(MessageImportance.High, string.Empty);
+ Log.LogMessage(MessageImportance.High,
+ "Tests passed: {0}, Tests failed: {1}, Tests skipped: {2}",
+ testsPassed,
+ testsFailed,
+ testsSkipped);
+ Log.LogMessage(MessageImportance.High,
+ "Time spent running tests: {0} seconds", timeSpent);
+
+ return !Log.HasLoggedErrors;
}
catch (Exception ex)
{
@@ -240,4 +215,4 @@
Sourced from Newtonsoft.Json's releases.
13.0.1
- New feature - Add JsonSelectSettings with configuration for a regex timeout
- Change - Remove portable assemblies from NuGet package
- Change - JsonReader and JsonSerializer MaxDepth defaults to 64
- Fix - Fixed throwing missing member error on ignored fields
- Fix - Fixed various nullable annotations
- Fix - Fixed annotations not being copied when tokens are cloned
- Fix - Fixed naming strategy not being used when deserializing dictionary enum keys
- Fix - Fixed serializing nullable struct dictionaries
- Fix - Fixed JsonWriter.WriteToken to allow null with string token
- Fix - Fixed missing error when deserializing JToken with a contract type mismatch
- Fix - Fixed JTokenWriter when writing comment to an object
12.0.3
- New feature - Added support for nullable reference types
- New feature - Added KebabCaseNamingStrategy
- Change - Package now uses embedded package icon
- Fix - Fixed bug when merging JToken with itself
- Fix - Fixed performance of calling ICustomTypeDescriptor.GetProperties
- Fix - Fixed serializing Enumerable.Empty and empty arrays on .NET Core 3.0
- Fix - Fixed deserializing some collection types with constructor
- Fix - Fixed deserializing IImmutableSet to ImmutableHashSet instead of ImmutableSortedSet
- Fix - Fixed deserializing IImmutableDictionary to ImmutableDictionary instead of ImmutableSortedDictionary
- Fix - Fixed deserializing into constructors with more than 256 parameters
- Fix - Fixed hang when deserializing JTokenReader with preceding comment
- Fix - Fixed JSONPath scanning with nested indexer
- Fix - Fixed deserializing incomplete JSON object to JObject
- Fix - Fixed using StringEnumConverter with naming strategy and specified values
12.0.2
- New feature - Added MissingMemberHandling to JsonObjectAttribute and JsonObjectContract
- New feature - Added constructor to JTokenReader to specify initial path
- New feature - Added JsonProperty.IsRequiredSpecified
- New feature - Added JsonContract.InternalConverter
- Change - Moved embedded debug symbols in NuGet package to a symbol package on NuGet.org
- Fix - Fixed deserializing nullable struct collections
- Fix - Fixed memory link when serializing enums to named values
- Fix - Fixed error when setting JsonLoadSettings.DuplicatePropertyNameHandling to Replace
12.0.1
- New feature - Added NuGet package signing
- New feature - Added Authenticode assembly signing
- New feature - Added SourceLink support
- New feature - Added constructors to StringEnumConverter for setting AllowIntegerValue
- New feature - Added JsonNameTable and JsonTextReader.PropertyNameTable
- New feature - Added line information to JsonSerializationException
- New feature - Added JObject.Property overload with a StringComparison
- New feature - Added JsonMergeSettings.PropertyNameComparison
- New feature - Added support for multiple Date constructors with JavaScriptDateTimeConverter
- New feature - Added support for strict equals and strict not equals in JSON Path queries
... (truncated)
ae9fe44
Remove compiler package and update sourcelink (#2498)8ef6621
Remove prerelease for 13.0.111331f5
Update SDK to 5.0.200 (#2495)c7e8abc
Update to 13.0.1-beta21745d7c
Fix JTokenWriter when writing comment to an object (#2493)583eb12
Fix missing error when deserializing JToken with a contract type mismatch (#2...b6dc05b
Change MaxDepth default to 64 (#2473)15525f1
Fix JsonWriter.WriteToken to allow null with string token (#2472)926d2f0
Enable embed untracked sources (#2471)0a56633
Fixes #2372 - variable typos (#2465)