Author: raja
Date: 2005-03-17 04:05:06 -0500 (Thu, 17 Mar 2005)
New Revision: 41928

Modified:
   trunk/mcs/errors/ChangeLog
   trunk/mcs/errors/Makefile
   trunk/mcs/errors/TestRunner.cs
   trunk/mcs/errors/generics-expect-no-error
   trunk/mcs/errors/generics-expect-wrong-error
   trunk/mcs/errors/gmcs-expect-no-error
   trunk/mcs/errors/gmcs-ignore-tests
   trunk/mcs/errors/know-issues-gmcs
   trunk/mcs/errors/know-issues-mcs
   trunk/mcs/errors/mcs-ignore-tests
Log:
* Makefile (test-local): Depend on TestRunner-$(PROFILE).cs.
(run-mcs-tests): Clean up.  Use profile specific test runner.
* TestRunner.cs (ProcessTester): Redirect stdout too.
(Tester.Log, Tester.LogLine): New.  Replacements for Console.Write
and Console.WriteLine that also log to files.
(Tester.Main): Add new command line argument for log file name.
Use the name of the compiler to select tests rather than "1".


Modified: trunk/mcs/errors/ChangeLog
===================================================================
--- trunk/mcs/errors/ChangeLog  2005-03-17 07:57:49 UTC (rev 41927)
+++ trunk/mcs/errors/ChangeLog  2005-03-17 09:05:06 UTC (rev 41928)
@@ -1,3 +1,13 @@
+2005-03-17  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * Makefile (test-local): Depend on TestRunner-$(PROFILE).cs.
+       (run-mcs-tests): Clean up.  Use profile specific test runner.
+       * TestRunner.cs (ProcessTester): Redirect stdout too.
+       (Tester.Log, Tester.LogLine): New.  Replacements for Console.Write
+       and Console.WriteLine that also log to files.
+       (Tester.Main): Add new command line argument for log file name.
+       Use the name of the compiler to select tests rather than "1".
+
 2005-03-16 Marek Safar <[EMAIL PROTECTED]>
 
        * Makefile: Enabled TestRunner for default profile.

Modified: trunk/mcs/errors/Makefile
===================================================================
--- trunk/mcs/errors/Makefile   2005-03-17 07:57:49 UTC (rev 41927)
+++ trunk/mcs/errors/Makefile   2005-03-17 09:05:06 UTC (rev 41928)
@@ -2,11 +2,13 @@
 SUBDIRS = 
 include ../build/rules.make
 
+with_mono_path = 
MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
+
 ifeq (default, $(PROFILE))
 # force this, we don't case if CSC is broken. This also
 # means we can use --options, yay.
 
-MCS = 
MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" 
$(INTERNAL_MCS)
+MCS = $(with_mono_path) $(INTERNAL_MCS)
 endif
 
 GENERICS_COMPILE = $(CSCOMPILE) /target:library
@@ -29,7 +31,7 @@
        CS0612-2-lib.dll CS0618-2-lib.dll CS0619-8-lib.dll CS0619-17-lib.dll 
CS0619-32-lib.dll CS0619-33-lib.dll CS0619-36-lib.dll \
        CS3005-16-lib.dll CS3013-module.dll
 
-test-local:
+test-local: TestRunner-$(PROFILE).exe
 
 run-test-ondotnet-local:
 
@@ -41,18 +43,28 @@
 test-everything:
        $(MAKE) PROFILE=default run-test
        $(MAKE) PROFILE=net_2_0 run-test
-
-run-mcs-tests: TestRunner.exe
-ifeq (net_2_0, $(PROFILE))
-       -rm -f generics.log
-       @./do-tests.pl generics '$(GENERICS_COMPILE)' "gcs*.cs"
-
-#      Is disabled until we solve problem with running
-#      $(RUNTIME) TestRunner.exe "2" $(topdir)/class/lib/$(PROFILE)/gmcs.exe 
know-issues-gmcs
-else
-       $(RUNTIME) TestRunner.exe "1" $(topdir)/class/lib/$(PROFILE)/mcs.exe 
know-issues-mcs
+
+ifeq (net_2_0, $(PROFILE))
+COMPILER_NAME = gmcs
+COMPILER = $(topdir)/gmcs/gmcs.exe
+TEST_PATTERN = '*cs*.cs'
+else
+COMPILER_NAME = mcs
+COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
+TEST_PATTERN = 'cs*.cs'
 endif
 
+# ifeq (net_2_0, $(PROFILE))
+# run-mcs-tests:
+#      -rm -f gmcs.log
+#      @./do-tests.pl gmcs '$(CSCOMPILE)' "cs*.cs"
+#      -rm -f generics.log
+#      @./do-tests.pl generics '$(GENERICS_COMPILE)' "gcs*.cs"
+# else
+run-mcs-tests: TestRunner-$(PROFILE).exe
+       $(with_mono_path) $(RUNTIME) TestRunner-$(PROFILE).exe $(COMPILER_NAME) 
$(COMPILER) know-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
+#endif
+
 clean-local:
        rm -f *.exe *.dll *.log *.mdb dummy.xml *.junk
 
@@ -66,5 +78,5 @@
 %-module.dll: %-module.cs
        $(BOOTSTRAP_MCS) /target:module /out:$@ $<
 
-TestRunner.exe:
-       $(CSCOMPILE) TestRunner.cs
\ No newline at end of file
+TestRunner-$(PROFILE).exe: TestRunner.cs
+       $(CSCOMPILE) /out:$@ TestRunner.cs


Property changes on: trunk/mcs/errors/Makefile
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/errors/TestRunner.cs
===================================================================
--- trunk/mcs/errors/TestRunner.cs      2005-03-17 07:57:49 UTC (rev 41927)
+++ trunk/mcs/errors/TestRunner.cs      2005-03-17 09:05:06 UTC (rev 41928)
@@ -59,6 +59,7 @@
                        pi.FileName = p_path;
                        pi.CreateNoWindow = true;
                        pi.WindowStyle = ProcessWindowStyle.Hidden;
+                       pi.RedirectStandardOutput = true;
                        pi.RedirectStandardError = true;
                        pi.UseShellExecute = false;
                }
@@ -98,21 +99,44 @@
                static ArrayList no_error_list = new ArrayList ();
                static ArrayList regression = new ArrayList ();
 
+               static StreamWriter log_file;
+
+               static void Log (string msg, params object [] rest)
+               {
+                       Console.Write (msg, rest);
+                       log_file.Write (msg, rest);
+               }
+
+               static void LogLine ()
+               {
+                       Console.WriteLine ();
+                       log_file.WriteLine ();
+               }
+
+               static void LogLine (string msg, params object [] rest)
+               {
+                       Console.WriteLine (msg, rest);
+                       log_file.WriteLine (msg, rest);
+               }
+
                static int Main(string[] args) {
-                       if (args.Length != 3) {
-                               Console.WriteLine ("Usage: TestRunner 
test-pattern compiler know-issues");
+                       if (args.Length != 4) {
+                               Console.Error.WriteLine ("Usage: TestRunner 
(test-pattern|compiler-name) compiler know-issues log-file");
                                return 1;
                        }
 
                        string test_pattern = args [0];
                        string mcs = args [1];
                        string issue_file = args [2];
+                       string log_fname = args [3];
 
+                       log_file = new StreamWriter (log_fname, false);
+
                        // THIS IS BUG #73763 workaround
-                       if (test_pattern == "1")
+                       if (test_pattern == "gmcs")
+                               test_pattern = "*cs*.cs";
+                       else
                                test_pattern = "cs*.cs";
-                       else
-                               test_pattern = "*cs*.cs";
 
                        string wrong_errors_file = issue_file;
                        string[] files = Directory.GetFiles (".", test_pattern);
@@ -125,7 +149,7 @@
                        catch (Exception) {
                                Console.Error.WriteLine ("Switching to command 
line mode (compiler entry point was not found)");
                                if (!File.Exists (mcs)) {
-                                       Console.WriteLine ("ERROR: Tested 
compiler was not found");
+                                       Console.Error.WriteLine ("ERROR: Tested 
compiler was not found");
                                        return 1;
                                }
                                tester = new ProcessTester (mcs);
@@ -141,7 +165,7 @@
                                        continue;
                                }
                            
-                               Console.Write (filename);
+                               Log (filename);
 
                                string[] extra = GetExtraOptions (s);
                                if (extra != null) {
@@ -152,54 +176,60 @@
                                }
                                test_args [test_args.Length - 1] = s;
 
-                               Console.Write ("...\t");
+                               Log ("...\t");
 
                                if (ignore_list.Contains (filename)) {
-                                       Console.WriteLine ("NOT TESTED");
+                                       LogLine ("NOT TESTED");
                                        total--;
                                        continue;
                                }
 
                                try {
+                                       int start_char = 0;
+                                       while (Char.IsLetter (filename, 
start_char))
+                                               ++start_char;
 
+                                       int end_char = filename.IndexOfAny (new 
char [] { '-', '.' } );
+                                       string expected = filename.Substring 
(start_char, end_char - start_char);
+
                                        bool result = tester.Invoke (test_args);
                                        if (result) {
                                                HandleFailure (filename, 
CompilerError.Missing);
                                                continue;
                                        }
 
-                                       int end_char = filename.IndexOfAny (new 
char [] { '-', '.' } );
-                                       string expected = filename.Substring 
(2, end_char - 2);
                                        CompilerError result_code = 
GetCompilerError (expected, tester.Output);
                                        if (HandleFailure (filename, 
result_code)) {
                                                success++;
                                        } else {
-                                               Console.WriteLine 
(tester.Output);
+                                               LogLine (tester.Output);
                                        }
                                }
                                catch (Exception e) {
                                        HandleFailure (filename, 
CompilerError.Missing);
-                                       Console.WriteLine (e.ToString ());
+                                       Log (e.ToString ());
                                }
                        }
 
-                       Console.WriteLine ("Done" + Environment.NewLine);
-                       Console.WriteLine ("{0} correctly detected error cases 
({1:.##%})", success, (float) (success) / (float)total);
+                       LogLine ("Done" + Environment.NewLine);
+                       LogLine ("{0} correctly detected error cases 
({1:.##%})", success, (float) (success) / (float)total);
 
                        know_issues.AddRange (no_error_list);
                        if (know_issues.Count > 0) {
-                               Console.WriteLine ();
-                               Console.WriteLine (issue_file + " contains {0} 
already fixed issues. Please remove", know_issues.Count);
+                               LogLine ();
+                               LogLine (issue_file + " contains {0} already 
fixed issues. Please remove", know_issues.Count);
                                foreach (string s in know_issues)
-                                       Console.WriteLine (s);
+                                       LogLine (s);
                        }
                        if (regression.Count > 0) {
-                               Console.WriteLine ();
-                               Console.WriteLine ("The latest changes caused 
regression in {0} file(s)", regression.Count);
+                               LogLine ();
+                               LogLine ("The latest changes caused regression 
in {0} file(s)", regression.Count);
                                foreach (string s in regression)
-                                       Console.WriteLine (s);
+                                       LogLine (s);
                        }
 
+                       log_file.Close ();
+
                        return 0;
                }
 
@@ -235,47 +265,47 @@
                        switch (status) {
                                case CompilerError.Expected:
                                        if (know_issues.Contains (file) || 
no_error_list.Contains (file)) {
-                                               Console.WriteLine ("FIXED 
ISSUE");
+                                               LogLine ("FIXED ISSUE");
                                                return true;
                                        }
-                                       Console.WriteLine ("OK");
+                                       LogLine ("OK");
                                        return true;
 
                                case CompilerError.Wrong:
                                        if (know_issues.Contains (file)) {
-                                               Console.WriteLine ("KNOW 
ISSUE");
+                                               LogLine ("KNOWN ISSUE");
                                                know_issues.Remove (file);
                                                return false;
                                        }
                                        if (no_error_list.Contains (file)) {
-                                               Console.WriteLine ("REGRESSION 
(NO ERROR -> WRONG ERROR)");
+                                               LogLine ("REGRESSION (NO ERROR 
-> WRONG ERROR)");
                                                no_error_list.Remove (file);
                                        }
                                        else {
-                                               Console.WriteLine ("REGRESSION 
(CORRECT ERROR -> WRONG ERROR)");
+                                               LogLine ("REGRESSION (CORRECT 
ERROR -> WRONG ERROR)");
                                        }
 
                                        break;
 
                                case CompilerError.Missing:
                                        if (no_error_list.Contains (file)) {
-                                               Console.WriteLine ("KNOW 
ISSUE");
+                                               LogLine ("KNOW ISSUE");
                                                no_error_list.Remove (file);
                                                return false;
                                        }
 
                                        if (know_issues.Contains (file)) {
-                                               Console.WriteLine ("REGRESSION 
(WRONG ERROR -> NO ERROR)");
+                                               LogLine ("REGRESSION (WRONG 
ERROR -> NO ERROR)");
                                                know_issues.Remove (file);
                                        }
                                        else {
-                                               Console.WriteLine ("REGRESSION 
(CORRECT ERROR -> NO ERROR)");
+                                               LogLine ("REGRESSION (CORRECT 
ERROR -> NO ERROR)");
                                        }
 
                                        break;
                        }
 
-                       regression.Add (file);;
+                       regression.Add (file);
                        return false;
                }
 


Property changes on: trunk/mcs/errors/generics-expect-no-error
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/mcs/errors/generics-expect-wrong-error
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/errors/gmcs-expect-no-error
===================================================================
--- trunk/mcs/errors/gmcs-expect-no-error       2005-03-17 07:57:49 UTC (rev 
41927)
+++ trunk/mcs/errors/gmcs-expect-no-error       2005-03-17 09:05:06 UTC (rev 
41928)
@@ -26,8 +26,8 @@
 cs0576.cs
 cs0611-2.cs
 cs0611.cs
-cs0642-2.cs # new in GMCS
-cs0642.cs # new in GMCS
+cs0642-2.cs
+cs0642.cs
 cs0652.cs
 cs1035.cs
 cs1041.cs


Property changes on: trunk/mcs/errors/gmcs-ignore-tests
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/errors/know-issues-gmcs
===================================================================
--- trunk/mcs/errors/know-issues-gmcs   2005-03-17 07:57:49 UTC (rev 41927)
+++ trunk/mcs/errors/know-issues-gmcs   2005-03-17 09:05:06 UTC (rev 41928)
@@ -4,67 +4,151 @@
 
 # If you fix the compiler so that it emits the correct error,
 # the file should be removed.
-
-# This file supports extended syntax
-# csXXXX.cs            : error test case reports wrong error
-# csXXXX.cs IGNORE     : adds test to ignore list
-# csXXXX.cs NO ERROR   : error test case doesn't report any error. An 
exception is considered
-#                        as NO ERROR and CS5001 is automatically ignored.
 
+# This file supports extended syntax
+# csXXXX.cs            : error test case reports wrong error
+# csXXXX.cs IGNORE     : adds test to ignore list
+# csXXXX.cs NO ERROR   : error test case doesn't report any error. An 
exception is considered
+#                        as NO ERROR and CS5001 is automatically ignored.
+
+cs0053-2.cs
+cs0108-3.cs NO ERROR
 cs0118.cs
-cs0119.cs
+cs0119.cs
+cs0120-5.cs
+cs0120-6.cs
+cs0120-7.cs
 cs0121-3.cs NO ERROR
+cs0121-4.cs NO ERROR
+cs0122-10.cs
+cs0122-11.cs
 cs0122-12.cs
-cs0128.cs
-cs0156-2.cs
+cs0128.cs
+cs0131-3.cs
+cs0133-2.cs
+cs0146-2.cs # new in GMCS
+cs0156-2.cs
 cs0157-5.cs NO ERROR
+cs0161-2.cs NO ERROR # new in GMCS
+cs0164.cs   NO ERROR
+cs0176-4.cs # new in GMCS
+cs0187-1.cs NO ERROR
+cs0187-2.cs NO ERROR
 cs0192-2.cs
+cs0200.cs
 cs0201.cs
-cs0208-3.cs
+cs0202.cs # new in GMCS
+cs0208-3.cs
+cs0217.cs
+cs0229-2.cs
 cs0229.cs NO ERROR
-cs0229-2.cs
-cs0266.cs
+cs0231.cs # new in GMCS
+cs0239.cs
+cs0249.cs   NO ERROR
+cs0257.cs # new in GMCS
 cs0266-2.cs NO ERROR
 cs0266-3.cs
+cs0266.cs
+cs0269.cs
+cs0407.cs
 cs0428.cs
+cs0525-2.cs
 cs0525.cs
-cs0526.cs
+cs0526.cs
 cs0529.cs
+cs0531-2.cs
+cs0531.cs
+cs0534-3.cs NO ERROR
+cs0534-4.cs NO ERROR
+cs0547-2.cs
 cs0547.cs
+cs0548-2.cs
+cs0548-3.cs
 cs0548-4.cs
 cs0548.cs
+cs0550-2.cs
+cs0550.cs
+cs0551.cs
+cs0557-2.cs
+cs0557.cs
 cs0560.cs
-cs0567.cs
-cs0642.cs NO ERROR
+cs0567.cs
+cs0611-2.cs NO ERROR
+cs0611.cs   NO ERROR
+cs0628-3.cs NO ERROR
 cs0642-2.cs NO ERROR
 cs0642-3.cs
 cs0642-4.cs
 cs0642-5.cs NO ERROR
-cs0642-6.cs NO ERROR
-cs0647.cs NO ERROR # corlib bug #73142
-cs0647-15.cs NO ERROR # corlib bug 73143
+cs0642-6.cs NO ERROR
+cs0642.cs NO ERROR
+cs0647-12.cs
+cs0647-13.cs
+cs0647-15.cs # corlib bug 73143
+cs0650.cs
 cs0652.cs NO ERROR
-cs0657-17.cs NO ERROR
+cs0681.cs
+cs0683.cs NO ERROR
+cs0686.cs NO ERROR
+cs0712.cs # new in GMCS
+cs0720.cs
+cs1007.cs
+cs1013.cs # new in GMCS
+cs1014.cs
+cs1035.cs   NO ERROR
+cs1041.cs   NO ERROR
 cs1501-5.cs
 cs1513.cs
 cs1518.cs
-cs1525.cs
-cs1527-2.cs NO ERROR
+cs1525.cs
+cs1527-2.cs NO ERROR
 cs1527-3.cs NO ERROR
 cs1528.cs
+cs1534.cs
 cs1535.cs
+cs1540-2.cs NO ERROR # new in GMCS
+cs1540-3.cs NO ERROR # new in GMCS
+cs1540-4.cs # new in GMCS
+cs1540-5.cs NO ERROR # new in GMCS
+cs1540-6.cs
+cs1540.cs # new in GMCS
 cs1552.cs
 cs1586.cs
-cs1615.cs
-cs1618-2.cs
-cs1620.cs
-cs1625-2.cs NO ERROR
-cs1626.cs NO ERROR
+cs1599-2.cs
+cs1599-3.cs NO ERROR
+cs1599.cs
+cs1609.cs
+cs1615.cs
+cs1618.cs NO ERROR
+cs1620.cs
+cs1622.cs
+cs1625-2.cs
 cs1626-2.cs NO ERROR
+cs1626.cs NO ERROR
+cs1627.cs
+cs1629-2.cs NO ERROR
+cs1629.cs NO ERROR
+cs1633.cs NO ERROR
+cs1634.cs NO ERROR
+cs1635.cs   NO ERROR
 cs1638.cs NO ERROR
 cs1641.cs
+cs1642.cs
+cs1644-3.cs
+cs1646.cs
 cs1656.cs
 cs1657.cs
-cs1666.cs NO ERROR
+cs1663.cs
+cs1665.cs
+cs1666.cs
+cs1670.cs
+cs1671-2.cs
+cs1671.cs
+cs1677-2.cs
+cs1677.cs
+cs1715.cs
 cs2007.cs
-cs2023.cs NO ERROR
+cs2023.cs NO ERROR
+cs3003-5.cs
+gcs0080.cs
+gcs1644-2.cs NO ERROR


Property changes on: trunk/mcs/errors/know-issues-gmcs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/errors/know-issues-mcs
===================================================================
--- trunk/mcs/errors/know-issues-mcs    2005-03-17 07:57:49 UTC (rev 41927)
+++ trunk/mcs/errors/know-issues-mcs    2005-03-17 09:05:06 UTC (rev 41928)
@@ -4,62 +4,61 @@
 
 # If you fix the compiler so that it emits the correct error,
 # the file should be removed.
-
-# This file supports extended syntax
-# csXXXX.cs            : error test case reports wrong error
-# csXXXX.cs IGNORE     : adds test to ignore list
-# csXXXX.cs NO ERROR   : error test case doesn't report any error. An 
exception is considered
-#                        as NO ERROR and CS5001 is automatically ignored.
 
+# This file supports extended syntax
+# csXXXX.cs            : error test case reports wrong error
+# csXXXX.cs IGNORE     : adds test to ignore list
+# csXXXX.cs NO ERROR   : error test case doesn't report any error. An 
exception is considered
+#                        as NO ERROR and CS5001 is automatically ignored.
+
 cs0118.cs
-cs0119.cs
+cs0119.cs
 cs0121-3.cs NO ERROR
 cs0122-12.cs
-cs0128.cs
-cs0156-2.cs
+cs0128.cs
+cs0156-2.cs
 cs0157-5.cs NO ERROR
 cs0192-2.cs
 cs0201.cs
-cs0208-3.cs
+cs0208-3.cs
 cs0229.cs NO ERROR
 cs0229-2.cs
-cs0266.cs
+cs0245.cs
+cs0266.cs
 cs0266-2.cs NO ERROR
 cs0266-3.cs
 cs0428.cs
 cs0525.cs
-cs0526.cs
+cs0526.cs
 cs0529.cs
 cs0547.cs
 cs0548-4.cs
 cs0548.cs
 cs0560.cs
-cs0567.cs
-cs0642.cs NO ERROR
+cs0567.cs
+cs0642.cs NO ERROR
 cs0642-2.cs NO ERROR
 cs0642-3.cs
 cs0642-4.cs
 cs0642-5.cs NO ERROR
-cs0642-6.cs NO ERROR
+cs0642-6.cs NO ERROR
 cs0647.cs NO ERROR # corlib bug #73142
-cs0647-15.cs NO ERROR # corlib bug 73143
+cs0647-15.cs NO ERROR # corlib bug 73143
 cs0652.cs NO ERROR
 cs0657-17.cs NO ERROR
 cs1501-5.cs
 cs1513.cs
 cs1518.cs
-cs1525.cs
-cs1527-2.cs NO ERROR
-cs1527-3.cs NO ERROR
+cs1525.cs
 cs1528.cs
 cs1535.cs
 cs1552.cs
 cs1586.cs
-cs1615.cs
+cs1615.cs
 cs1618-2.cs
-cs1620.cs
-cs1625-2.cs NO ERROR
-cs1626.cs NO ERROR
+cs1620.cs
+cs1625-2.cs NO ERROR
+cs1626.cs NO ERROR
 cs1626-2.cs NO ERROR
 cs1638.cs NO ERROR
 cs1641.cs
@@ -67,4 +66,4 @@
 cs1657.cs
 cs1666.cs NO ERROR
 cs2007.cs
-cs2023.cs NO ERROR
+cs2023.cs NO ERROR


Property changes on: trunk/mcs/errors/know-issues-mcs
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/mcs/errors/mcs-ignore-tests
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to