<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,8 @@ task :default =&gt; :rexap
   
 SL  = 'C:\Program Files\Microsoft Silverlight\3.0.40307.0'
 CSC = 'C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe'
-DLR = 'c:\users\jimmysch\dev\agdlr\bin\debug'
+DLR = 'c:\users\jimmysch\dev\agdlr\bin\release'
+#DLR = 'c:\users\jimmysch\dev\releases\agdlr-0.5.0\bin'
 CHR = &quot;#{DLR}\\Chiron.exe&quot;
 
 SYSTEM_REFERENCES = %W(mscorlib System System.Core System.Net System.Windows System.Windows.Browser)</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -50,8 +50,10 @@ class Eggs
     end
 
     def run(engine = nil)
+      # eggs_config should call something like Eggs.config(:tests =&gt; ['sample'])
+      load 'eggs_config.rb'
       engine ? Repl.show(engine, engine.create_scope) : Repl.show
-      Repl.current.input_buffer.write(&quot;Eggs.current.run_tests\n&quot;)
+      Repl.current.input_buffer.write &quot;Eggs.current.run_tests\n&quot;
     end
 
     def current
@@ -62,22 +64,23 @@ class Eggs
   # 
   # Test Running
   #
-  # TODO need a way to walk all *_test.rb files in tests directory
   def run_tests
     Eggs.get_config.each do |test_type, test_files|
       test_files.each do |file|
         loaded = false
         [&quot;#{test_type}/#{file}_test.rb&quot;, &quot;#{test_type}/test_#{file}.rb&quot;].each do |pth|
-          prepend = File.dirname(DynamicApplication.current ? 
+          prepend = File.dirname(
+            DynamicApplication.current ? 
               DynamicApplication.current.entry_point.to_s :
-              '')
+              ''
+          )
           pth = &quot;#{prepend}/#{pth}&quot; if prepend != '.'
           if !loaded &amp;&amp; Package.get_file(pth)
             load pth 
             loaded = true
           end
         end
-        raise &quot;#{file} is not a known test (check your Eggs.config call)&quot; unless loaded
+        raise &quot;#{file} is not a known test (check your eggs_config.rb file)&quot; unless loaded
       end
     end
     Eggs.execute_at_exit_blocks</diff>
      <filename>lib/eggs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,11 +32,13 @@ public class Eggs {
         &quot;IronRuby.Libraries&quot; 
     }; //, &quot;IronPython&quot;, &quot;IronPython.Modules&quot;
 
-    public static void Start(Dictionary&lt;string, List&lt;string&gt;&gt; tests, StreamResourceInfo xap) {
-        var assemblies = LoadDLRAssemblies(xap);
-        InitializeDLR(xap, assemblies);
+    public static void Start(Uri testsXapUri, StreamResourceInfo eggsXap) {
+        var assemblies = LoadDLRAssemblies(eggsXap);
+        InitializeDLR(eggsXap, assemblies);
         LoadEggs();
-        ConfigureAndRunEggs(tests);
+        DownloadTestsXap(testsXapUri, delegate(StreamResourceInfo testsXap) {
+            ConfigureAndRunEggs(testsXap);
+        });
     }
 
     private static void InitializeDLR(StreamResourceInfo xap, List&lt;Assembly&gt; assemblies) {
@@ -74,18 +76,33 @@ public class Eggs {
         Repl.Show(_engine, _scope);
     }
 
-    private static void ConfigureAndRunEggs(Dictionary&lt;string, List&lt;string&gt;&gt; tests) {
+    private static Action&lt;StreamResourceInfo&gt; _onDownloadComplete;
+
+    private static void DownloadTestsXap(Uri testsXapUri, Action&lt;StreamResourceInfo&gt; OnDownloadComplete) {
+        _onDownloadComplete = OnDownloadComplete;
+        WebClient wc = new WebClient(); 
+        wc.OpenReadCompleted += new OpenReadCompletedEventHandler(DownloadTestXap_Complete);
+        wc.OpenReadAsync(testsXapUri);
+    }
+
+    private static void DownloadTestXap_Complete(object sender, OpenReadCompletedEventArgs e) {
+        if (e.Error == null) {
+            var sri = new StreamResourceInfo(e.Result, null);
+            if (_onDownloadComplete != null) {
+                _onDownloadComplete.Invoke(sri);
+            }
+        } else {
+            System.Windows.Browser.HtmlPage.Window.Alert(&quot;Tests failed to download&quot;);
+        }
+    }
+
+    private static void ConfigureAndRunEggs(StreamResourceInfo testsXap) {
+        DynamicApplication.XapFile = testsXap;
+
         ScriptScope scope = _engine.Runtime.Globals;
         IronRuby.Ruby.GetExecutionContext(_engine).DefineGlobalVariable(&quot;engine&quot;, _engine);
-        IronRuby.Ruby.GetExecutionContext(_engine).DefineGlobalVariable(&quot;test_list&quot;, tests);
-
-        DynamicApplication.XapFile = null;
         
-        var code = @&quot;
-$test_list = $test_list.inject({}) {|h, kvp| h[kvp.key.to_s] = kvp.value.to_s; h}
-Eggs.config($test_list)
-Eggs.run($engine)
-&quot;;
+        var code = &quot;Eggs.run($engine)&quot;;
         var source = _engine.CreateScriptSourceFromString(code, SourceCodeKind.File);
         source.Compile(new ErrorFormatter.Sink()).Execute(scope);
     }</diff>
      <filename>src/Eggs.cs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>191a29bcdca95e08708f43ee4cafd6bd0fbfb71d</id>
    </parent>
  </parents>
  <author>
    <name>Jimmy Schementi</name>
    <email>jschementi@gmail.com</email>
  </author>
  <url>http://github.com/jschementi/eggs/commit/a9f4976a90102e39326b6f36c79713c65f3aa070</url>
  <id>a9f4976a90102e39326b6f36c79713c65f3aa070</id>
  <committed-date>2009-03-27T16:03:25-07:00</committed-date>
  <authored-date>2009-03-27T16:03:25-07:00</authored-date>
  <message>Ability for tests to be in a separate XAP file</message>
  <tree>1c18c5a7b9cceee06270034cbbc8c72888d4e7c5</tree>
  <committer>
    <name>Jimmy Schementi</name>
    <email>jschementi@gmail.com</email>
  </committer>
</commit>
