X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Fdata%2Ftestrunner.js;h=9d869258e639afec940b84ef828e162a095b72b2;hb=6eb2bfe6aefaeff522a9d3a8ac9511e15932bfcf;hp=69377e45216b48970067d81f551148c103534bc4;hpb=b4e23b5af0820a66c2e275051f613f3df9a4444d;p=jquery.git diff --git a/test/data/testrunner.js b/test/data/testrunner.js index 69377e4..9d86925 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -1,3 +1,5 @@ +jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. + var _config = { fixture: null, Test: [], @@ -13,10 +15,13 @@ var _config = { asyncTimeout: 2 // seconds for async timeout }; +_config.filters = location.search.length > 1 && //restrict modules/tests by get parameters + jQuery.map( location.search.slice(1).split('&'), decodeURIComponent ); + var isLocal = !!(window.location.protocol == 'file:'); -$(function() { - $('#userAgent').html(navigator.userAgent); +jQuery(function() { + jQuery('#userAgent').html(navigator.userAgent); runTest(); }); @@ -54,18 +59,39 @@ function start() { }, 13); } +function validTest( name ) { + var filters = _config.filters; + if( !filters ) + return true; + + var i = filters.length, + run = false; + while( i-- ){ + var filter = filters[i], + not = filter.charAt(0) == '!'; + if( not ) + filter = filter.slice(1); + if( name.indexOf(filter) != -1 ) + return !not; + if( not ) + run = true; + } + return run; +} + function runTest() { _config.blocking = false; var time = new Date(); _config.fixture = document.getElementById('main').innerHTML; + _config.ajaxSettings = jQuery.ajaxSettings; synchronize(function() { time = new Date() - time; - $("
Tests completed in ', + jQuery("
Tests completed in ',
time, ' milliseconds.
',
_config.stats.bad, ' tests of ', _config.stats.all, ' failed.