Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LinkerTestLogger.cs « TestCasesRunner « Mono.Linker.Tests « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 17a746103eb90d21530c694fdf4034dab9ec0244 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Collections.Generic;

namespace Mono.Linker.Tests.TestCasesRunner
{
	public class LinkerTestLogger : ILogger
	{
		readonly List<MessageContainer> MessageContainers;

		public LinkerTestLogger ()
		{
			MessageContainers = new List<MessageContainer> ();
		}

		public List<MessageContainer> GetLoggedMessages ()
		{
			return MessageContainers;
		}

		public void LogMessage (MessageContainer message)
		{
			// This is to force Cecil to load all the information from the assembly
			// When the message is logged, the assembly is still opened by the linker and available
			// later on during validation, it may already be closed and Cecil's lazy loading might fail.
			message.ToString ();

			MessageContainers.Add (message);
		}
	}
}