The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/test/default/index.html.tpl

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 <!doctype html>
    2 <html>
    3 <head>
    4 <style>
    5 <meta name="google" content="notranslate" />
    6 body {
    7   background: white;
    8   color: black;  
    9 }
   10 .test p {
   11   margin: 1px;
   12 }
   13 .test {
   14   font-family: monospace;
   15   white-space: pre;   
   16 }
   17 .err {
   18   background: red;
   19   color: white;
   20 }
   21 .passed {
   22   background: green;
   23   color: white; 
   24 }
   25 </style>
   26 </head>
   27 <body>
   28 <h1></h1>
   29 <section class="test" id="test-res"></section>
   30 <script>
   31 var performance;
   32 if (typeof performance !== 'object') {
   33   performance = {
   34     mark: function(s) { this[s] = new Date() },
   35     measure: function(_t, s1, s2) { this.t = this[s2] - this[s1] },
   36     getEntriesByName: function() { return [ { duration: this.t } ] }
   37   };
   38 }
   39 
   40 var Module = { preRun: function() { performance.mark('bench_start') } };
   41 
   42 function runTest(tname) {
   43     var xhr, expected, hn, idx = 0, passed = true;
   44 
   45     function outputReceived(e) {
   46         var found = e.data;
   47         var p = document.createElement('p');
   48         if (found !== expected[idx++]) {
   49             p.className = 'err';
   50             passed = false;
   51         }
   52         p.appendChild(document.createTextNode(found));
   53         document.getElementById('test-res').appendChild(p);
   54         if (idx >= expected.length) {
   55             if (passed) {
   56                 performance.mark('bench_end')
   57                 performance.measure('bench', 'bench_start', 'bench_end');
   58                 var duration = Math.round(performance.getEntriesByName('bench')[0].duration);
   59                 hn.appendChild(document.createTextNode(' - PASSED (time: ' + duration + ' ms)'));
   60                 hn.className = 'passed';
   61             } else {
   62                 hn.appendChild(document.createTextNode(' - FAILED'));
   63                 hn.className = 'err';
   64             }
   65         }        
   66     }
   67     
   68     hn = document.getElementsByTagName('h1')[0];
   69     hn.appendChild(document.createTextNode('Test: ' + tname));
   70 
   71     try {
   72         xhr = new ActiveXObject('Microsoft.XMLHTTP');
   73     } catch (e) {
   74         xhr = new XMLHttpRequest();
   75     }
   76     xhr.open('GET', tname + '.exp');
   77     xhr.onreadystatechange = function() {
   78         if (xhr.readyState != 4 ||
   79             (xhr.status != 200 && xhr.status != 302 && xhr.status != 0)) {
   80             return;
   81         }
   82         expected = xhr.responseText.split('\n');
   83         if (expected.length > 0 && expected[expected.length - 1] === '') {
   84             expected.pop();
   85         }
   86         expected.push('--- SUCCESS ---');
   87         window.addEventListener('test-output', outputReceived, false);
   88         var s = document.getElementsByTagName('script')[0];
   89         var st = document.createElement('script');
   90         st.src = tname + '.js';
   91         s.parentNode.insertBefore(st, s);
   92     }
   93     xhr.send(null);
   94 }
   95 runTest('{{tname}}');
   96 </script>
   97 </body>
   98 </html>

Cache object: dd5b49a323ec25f0656aac5236fa25b4


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.