}
}
-#if !NET_2_1
+#if !MOBILE
class ProcessTester: ITester
{
ProcessStartInfo pi;
bool update_verif_file;
Hashtable verif_data;
-#if !NET_2_1
+#if !MOBILE
ProcessStartInfo pi;
#endif
readonly string mono;
files_folder = Directory.GetCurrentDirectory ();
this.verif_file = verif_file;
-#if !NET_2_1
+#if !MOBILE
pi = new ProcessStartInfo ();
pi.CreateNoWindow = true;
pi.WindowStyle = ProcessWindowStyle.Hidden;
string filename = test.FileName;
AppDomain domain = null;
-#if !NET_2_1
+#if !MOBILE
if (safe_execution) {
// Create a new AppDomain, with the current directory as the base.
AppDomainSetup setupInfo = new AppDomainSetup ();
try {
DomainTester tester;
try {
-#if !NET_2_1
+#if !MOBILE
if (domain != null)
tester = (DomainTester) domain.CreateInstanceAndUnwrap (typeof (PositiveChecker).Assembly.FullName, typeof (DomainTester).FullName);
else
if (doc_output != null) {
string ref_file = filename.Replace (".cs", "-ref.xml");
try {
-#if !NET_2_1
+#if !MOBILE
new XmlComparer ("doc").Compare (ref_file, doc_output);
#endif
} catch (Exception e) {
static bool TryToMatchErrorMessage (string actual, string expected)
{
actual = actual.Replace ("\\", "/");
- var path_mask_start = expected.IndexOf ("*PATH*");
+ var path_mask_start = expected.IndexOf ("*PATH*", StringComparison.Ordinal);
if (path_mask_start > 0 && actual.Length > path_mask_start) {
- var path_mask_continue = expected.Substring (path_mask_start + 6);
- var expected_continue = actual.IndexOf (path_mask_continue, path_mask_start);
- if (expected_continue > 0) {
- var path = actual.Substring (path_mask_start, expected_continue - path_mask_start);
- if (actual == expected.Replace ("*PATH*", path))
- return true;
-
- throw new ApplicationException (expected.Replace ("*PATH*", path));
+ var parts = expected.Split (new [] { "*PATH*" }, StringSplitOptions.None);
+ foreach (var part in parts) {
+ if (!actual.Contains (part))
+ return false;
}
+
+ return true;
}
return false;