[banshee] [tests] Fix performance tests crash



commit 168b808b1e64567de1034d81456b8aeab8fc1215
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Fri Dec 3 16:24:47 2010 -0600

    [tests] Fix performance tests crash

 tests/Performance/PerformanceTests.cs |   40 +++++++++++++++++++--------------
 tests/test-perf                       |    1 +
 2 files changed, 24 insertions(+), 17 deletions(-)
---
diff --git a/tests/Performance/PerformanceTests.cs b/tests/Performance/PerformanceTests.cs
index 6b49c6c..b5592c2 100644
--- a/tests/Performance/PerformanceTests.cs
+++ b/tests/Performance/PerformanceTests.cs
@@ -271,6 +271,7 @@ namespace Banshee.Tests
                 "--uninstalled",
                 Environment.GetEnvironmentVariable ("BANSHEE_DEV_OPTIONS") }, 0);
             Log.Debugging = false;
+            Paths.ApplicationName = Application.InternalName;
 
             Application.TimeoutHandler = RunTimeout;
             Application.IdleHandler = RunIdle;
@@ -285,23 +286,28 @@ namespace Banshee.Tests
 
         private void RunBanshee ()
         {
-            Gtk.Application.Init ();
-            ThreadAssist.InitializeMainThread ();
-            ThreadAssist.ProxyToMainHandler = Banshee.ServiceStack.Application.Invoke;
-            Application.PushClient (client);
-            Application.Run ();
-
-            music_library = ServiceManager.SourceManager.MusicLibrary;
-
-            var provider = DatabaseTrackInfo.Provider;
-            select_single_command = String.Format (
-                    "SELECT {0} FROM {1} WHERE {2}{3}{4} = ?",
-                    provider.Select, provider.From, provider.Where,
-                    (String.IsNullOrEmpty (provider.Where) ? String.Empty : " AND "),
-                    provider.PrimaryKey
-            );
-
-            client.Start ();
+            try {
+                Gtk.Application.Init ();
+                ThreadAssist.InitializeMainThread ();
+                ThreadAssist.ProxyToMainHandler = Banshee.ServiceStack.Application.Invoke;
+                Application.PushClient (client);
+                Application.Run ();
+
+                music_library = ServiceManager.SourceManager.MusicLibrary;
+
+                var provider = DatabaseTrackInfo.Provider;
+                select_single_command = String.Format (
+                        "SELECT {0} FROM {1} WHERE {2}{3}{4} = ?",
+                        provider.Select, provider.From, provider.Where,
+                        (String.IsNullOrEmpty (provider.Where) ? String.Empty : " AND "),
+                        provider.PrimaryKey
+                );
+
+                client.Start ();
+            } catch (Exception e) {
+                Console.WriteLine (e);
+                throw;
+            }
         }
 
         [TestFixtureTearDown]
diff --git a/tests/test-perf b/tests/test-perf
index 6485c7e..de2c945 100755
--- a/tests/test-perf
+++ b/tests/test-perf
@@ -150,6 +150,7 @@ foreach my $rev_name (@ordered_revisions) {
     #foreach my $asm (glob("*.dll"))
     foreach my $asm (glob("Performance.dll")) {
         for (my $i = 0; $i < $RUNS_PER_TEST; $i++) {
+            print "    - Run $i\n";
             `$ENV_OPTIONS nunit-console2 -nologo -noshadow -xml=$rev_dir/$i-$asm.xml $asm 2>/dev/null`;
             `cp ~/.config/banshee-1/banshee.db.bak ~/.config/banshee-1/banshee.db`;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]