OpenLayers OpenLayers

Changeset 5444

Show
Ignore:
Timestamp:
12/16/07 19:55:07 (1 year ago)
Author:
crschmidt
Message:

Add auto-tester page for OpenLayers. Three differences from the main run-tests.html:

  1. Meta-refresh, set to 20 minutes.
  2. 20 second page download timeout, instead of the standard 6.
  3. After all tests have finished, posts results back to
    http://openlayers.org/test/results.cgi , which shows the results. Failures kick
    off an email (currently only to me).

To set up auto-testing for your platform, set up a machine with a browser running full
time, and open the URL:

http://openlayers.org/dev/tests/auto-tests.html?run=all

tests will be run automatically on load, and every time the page refreshes, they will
run again, recording their results each time.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/auto-tests.html

    r4224 r5444  
    11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
    2 <html><head><title> Run the testsuite</title> 
     2<html><head> 
     3<meta http-equiv="refresh" content="1200" /> 
     4<title> Run the testsuite</title> 
    35<noscript>Javascript is disabled in your browser. This page cannot be displayed correctly without Javascript. Sorry. <br/> If you want to view this page, please change your browser settings so that Javascript is enabled.</noscript> 
    46<!-- 
     
    8284<script type="text/javascript"> 
    8385<!-- 
     86 
     87function report_results() { 
     88    req = false; 
     89    // branch for native XMLHttpRequest object 
     90    if(window.XMLHttpRequest && !(window.ActiveXObject)) { 
     91        try { 
     92            req = new XMLHttpRequest(); 
     93        } catch(e) { 
     94            req = false; 
     95        } 
     96    // branch for IE/Windows ActiveX version 
     97    } else if(window.ActiveXObject) { 
     98        try { 
     99            req = new ActiveXObject("Msxml2.XMLHTTP"); 
     100        } catch(e) { 
     101            try { 
     102                req = new ActiveXObject("Microsoft.XMLHTTP"); 
     103            } catch(e) { 
     104                req = false; 
     105            } 
     106        } 
     107    }  
     108    req.open("POST", "/test/results.cgi"); 
     109    req.setRequestHeader("Content-Type", 'application/x-www-form-urlencoded'); 
     110    var results = document.getElementById('total').innerHTML; 
     111    var test_text = ""; 
     112    if (results.match("fail")) { 
     113        test_text = document.getElementById("results").innerHTML; 
     114    }     
     115    req.send("results="+escape(results)+"&test_text="+escape(test_text)); 
     116} 
     117 
    84118if( typeof( Test )=="undefined" ) { 
    85119    Test={}; 
     
    735769            Test.AnotherWay._g_test_iframe.location.replace( "about:blank" ); 
    736770        } 
    737     } 
     771        report_results(); 
     772    } 
    738773} 
    739774Test.AnotherWay._g_opera_path_correction=null; // ugly wart to support opera 
     
    788823{ 
    789824    var test_page=Test.AnotherWay._g_tests_queue[0]; 
    790     test_page.loading_timeout_milliseconds=6000; 
     825    test_page.loading_timeout_milliseconds=20000; 
    791826    test_page.timeout_id=setTimeout( Test.AnotherWay._loading_timeout, Test.AnotherWay._g_timeout_granularity ); 
    792827    test_page.wait_msg=Test.AnotherWay._print_counter_result( test_page.url, "loading...", test_page.loading_timeout_milliseconds, "loading" );