Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 5a536d4

Browse files
committed
[tests] Capture the logging service output for our tests
This will make it possible to figure out what is going on when tests fail.
1 parent ec21a54 commit 5a536d4

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

main/tests/UnitTests/TestBase.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,20 @@ public class TestBase
4040
{
4141
static bool firstRun = true;
4242

43-
43+
static TestBase ()
44+
{
45+
var topPath = LocateTopLevel ();
46+
LoggingService.AddLogger (new MonoDevelop.Core.Logging.FileLogger (Path.Combine (topPath, "TestResult_LoggingService.log")));
47+
}
48+
49+
static string LocateTopLevel ()
50+
{
51+
var cwd = typeof (TestBase).Assembly.Location;
52+
while (!string.IsNullOrEmpty (cwd) && !File.Exists (Path.Combine (cwd, "top_level_monodevelop")))
53+
cwd = Path.GetDirectoryName (cwd);
54+
return cwd;
55+
}
56+
4457
[TestFixtureSetUp]
4558
public void Simulate ()
4659
{

top_level_monodevelop

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This file exists only to make sure our test suite can locate the top level of the checkout
2+

0 commit comments

Comments
 (0)