running qunit in envjs

running qunit in envjs

I noticed we where using an older testrunner.js with envjs even when running 1.3.2 unit tests.  i start playing with it and realized qunit works great and i can even use QUnit.done to output a static html file with the result of running the tests in envjs.  the only snag I had was being able to hook to QUnit.log .  this may be a bug with envjs implementation of onload
so please feel free to point out if im mistaken.
here is the script that initiates it:
load("build/runtest/env.js");
(function($env){
   
    //let it load the script from the html
    $env.scriptTypes = {
        "text/javascript"   :true
    };
   
    var count = 0;
    window.onload = function(){
       
        //this doesnt work because onload isn't called until after the tests run
        QUnit.log = function(result, message){
            $env.log('('+(count++)+')['+((!!result)?'PASS':'FAIL')+'] ' + message );
        };
            
        //this works because done is called from syncronize()
        QUnit.done = function(pass, fail){
            //write resulting window less scripts to an html file
            jQuery('script').each(function(){
               this.type = 'text/envjs';
            });
            $env.writeToFile(
                document.documentElement.xml,
                $env.location('jqenv.html')
            );
        };
       
    };
   
    window.location = "test/index.html";
   
})(__env__);
I was wondering if you could either add a synchronized 'begin' or let log just be global
$.extend(window, {
      ///...
      log: log?log:function(result, message);
});
thanks
thatcher
--
Christopher Thatcher