Fixed an issue with broken logging in the unittest

This commit is contained in:
Kenneth Skovhede
2017-01-11 22:41:45 +01:00
parent 309df0f720
commit 37ee4d4cf8
+6 -3
View File
@@ -74,13 +74,14 @@ namespace Duplicati.UnitTest
/// <param name="target">The target destination for the backups</param>
public static void RunTest(string[] folders, Dictionary<string, string> options, string target)
{
using (var log = new LogHelper(string.Format("unittest-{0}.log", Library.Utility.Utility.SerializeDateTime(DateTime.Now))))
string tempdir = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "tempdir");
string logfilename = System.IO.Path.Combine(tempdir, string.Format("unittest-{0}.log", Library.Utility.Utility.SerializeDateTime(DateTime.Now)));
using (var log = new LogHelper(logfilename))
using (Log.StartScope(log))
{
Log.LogLevel = Duplicati.Library.Logging.LogMessageType.Profiling;
string tempdir = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "tempdir");
//Filter empty entries, commonly occuring with copy/paste and newlines
folders = (from x in folders
where !string.IsNullOrWhiteSpace(x)
@@ -362,6 +363,8 @@ namespace Duplicati.UnitTest
{
if (s == options["dbpath"])
continue;
if (s == logfilename)
continue;
if (s.StartsWith(Utility.AppendDirSeparator(tf)))
continue;