using System.Text;
using System.Collections;
using System.Xml;
+using System.Collections.Generic;
namespace TestRunner {
return true;
if (md.ILSize > il_size) {
- checker.LogFileLine (test.FileName, "{0} (code size reduction {1} -> {2})", m_name, md.ILSize, il_size);
+ checker.LogFileLine (test.FileName, "{0} (code size reduction {1} -> {2})", decl_type + ": " + m_name, md.ILSize, il_size);
md.ILSize = il_size;
return true;
}
checker.HandleFailure (test.FileName, PositiveChecker.TestResult.ILError,
- string.Format ("{0} (code size {1} -> {2})", m_name, md.ILSize, il_size));
+ string.Format ("{0} (code size {1} -> {2})", decl_type + ": " + m_name, md.ILSize, il_size));
md.ILSize = il_size;
}
AppDomain domain = null;
+#if !NET_2_1
if (safe_execution) {
// Create a new AppDomain, with the current directory as the base.
AppDomainSetup setupInfo = new AppDomainSetup ();
setupInfo.LoaderOptimization = LoaderOptimization.SingleDomain;
domain = AppDomain.CreateDomain (Path.GetFileNameWithoutExtension (file), null, setupInfo);
}
-
+#endif
try {
DomainTester tester;
try {
+#if !NET_2_1
if (domain != null)
tester = (DomainTester) domain.CreateInstanceAndUnwrap (typeof (PositiveChecker).Assembly.FullName, typeof (DomainTester).FullName);
else
+#endif
tester = new DomainTester ();
if (!tester.Test (file))
ArrayList ld = new ArrayList ();
CompilerError result = CompilerError.Missing;
while (line != null) {
- if (ld.Contains (line)) {
+ if (ld.Contains (line) && result == CompilerError.Expected) {
if (line.IndexOf ("Location of the symbol related to previous") == -1)
return CompilerError.Duplicate;
}
if (check_msg) {
int first = line.IndexOf (':');
int second = line.IndexOf (':', first + 1);
- if (second == -1 || !check_error_line)
+ if (line.IndexOf ("Warning as Error: ", first, StringComparison.Ordinal) > 0) {
+ if (check_error_line) {
+ second = line.IndexOf (':', second + 1);
+ }
+ } else if (second == -1 || !check_error_line) {
second = first;
+ }
string msg = line.Substring (second + 1).TrimEnd ('.').Trim ();
if (msg != expected_message && msg != expected_message.Replace ('`', '\'')) {
}
Checker checker;
+ bool positive;
switch (mode) {
case "neg":
checker = new NegativeChecker (tester, true);
+ positive = false;
break;
case "pos":
string iltest;
GetOption ("il", args, false, out iltest);
checker = new PositiveChecker (tester, iltest);
+ positive = true;
if (iltest != null && GetOption ("update-il", args, false, out temp)) {
((PositiveChecker) checker).UpdateVerificationDataFile = true;
return 1;
}
- string [] files = Directory.GetFiles (".", test_pattern);
- if (files.Length == 0) {
+ var files = new List<string> ();
+ switch (test_pattern) {
+ case "v1":
+ files.AddRange (Directory.GetFiles (".", positive ? "test*.cs" : "cs*.cs"));
+ break;
+ case "v2":
+ files.AddRange (Directory.GetFiles (".", positive ? "gtest*.cs" : "gcs*.cs"));
+ goto case "v1";
+ case "v4":
+ files.AddRange (Directory.GetFiles (".", positive ? "dtest*.cs" : "dcs*.cs"));
+ goto case "v2";
+ default:
+ files.AddRange (Directory.GetFiles (".", test_pattern));
+ break;
+ }
+
+ if (files.Count == 0) {
Console.Error.WriteLine ("No files matching `{0}' found", test_pattern);
return 2;
}
checker.Initialize ();
+/*
+ files.Sort ((a, b) => {
+ if (a.EndsWith ("-lib.cs", StringComparison.Ordinal)) {
+ if (!b.EndsWith ("-lib.cs", StringComparison.Ordinal))
+ return -1;
+ } else if (b.EndsWith ("-lib.cs", StringComparison.Ordinal)) {
+ if (!a.EndsWith ("-lib.cs", StringComparison.Ordinal))
+ return 1;
+ }
+ return a.CompareTo (b);
+ });
+*/
foreach (string s in files) {
string filename = Path.GetFileName (s);
if (Char.IsUpper (filename, 0)) { // Windows hack