[Mono-dev] Proposed change to TestDriver.dll

Mark Mason mmason at upwardaccess.com
Tue Dec 2 05:01:58 EST 2008


Hello all,

I'd like to propose the following change to TestDriver.dll. The purpose
of this patch is to avoid using the DateTime class unless timings are
explicitly called for. DateTime pulls in a lot of additional
infrastructure code which may cause the test harness itself to fail.
With this change, it's a lot easier to run the regression tests such as
basic.cs & others with a JIT port in progress.

[Which is where the MIPS port is right now. There's something failing
waaaay down in the guts of DateTime, daylight savings time computations,
and such. It'd be a lot better to be able to uncover these problems with
the simple test cases in basic*.cs]

Thanks in advance,
Mark

Index: TestDriver.cs
===================================================================
--- TestDriver.cs       (revision 120080)
+++ TestDriver.cs       (working copy)
@@ -13,7 +13,6 @@
                bool do_timings = false;
                bool verbose = false;
                int tms = 0;
-               DateTime start, end = DateTime.Now;
 
                if (args != null && args.Length > 0) {
                        for (j = 0; j < args.Length; j++) {
@@ -61,15 +60,18 @@
                        if (verbose)
                                Console.WriteLine ("Running '{0}' ...",
name);
                        expected = Int32.Parse (name.Substring (5, j -
5));
-                       start = DateTime.Now;
-                       result = (int)methods [i].Invoke (null, null);
                        if (do_timings) {
-                               end = DateTime.Now;
+                               DateTime start = DateTime.Now;
+                               result = (int)methods [i].Invoke (null,
null);
+                               DateTime end = DateTime.Now;
                                long tdiff = end.Ticks - start.Ticks;
                                int mdiff = (int)tdiff/10000;
                                tms += mdiff;
                                Console.WriteLine ("{0} took {1} ms",
name, mdiff);
                        }
+                       else {
+                               result = (int)methods [i].Invoke (null,
null);
+                       }
                        ran++;
                        if (result != expected) {
                                failed++;




More information about the Mono-devel-list mailing list