Permalink
Browse files

Removing docTests agin, causes failing. Testing built file.

  • Loading branch information...
1 parent 7cca07d commit 40c0a3bd574355cef581fd4d9f96eb700ce91b01 Jens Arps committed Sep 19, 2011
Showing with 67 additions and 13 deletions.
  1. +32 −0 tests/helper.js
  2. +33 −11 tests/test_AMD_built.html
  3. +1 −1 tests/tests/array/array.js
  4. +1 −1 tests/tests/html/style.js
View
32 tests/helper.js
@@ -83,6 +83,38 @@ var helper = {
});
},
+ runBuilt: function(runAll){
+ var features = [];
+ var tests = [];
+ var inputs = document.getElementsByTagName('input');
+ for(var i = 0, m = inputs.length; i < m; i++){
+ var input = inputs[i];
+ if(input.type == 'checkbox' && ( input.checked || runAll )){
+ var f = input.id;
+ var radios = document.getElementsByClassName(f);
+ for (var n = 0, r = radios.length; n < r; n++){
+ if(radios[n].checked){
+ features.push('feature!' + radios[n].id);
+ var parts = f.split('-');
+ tests.push('../tests/tests/' + parts[0] + '/' + (parts[1] || parts[0]));
+ }
+ }
+ }
+ }
+
+ console.log('Features to test:', features);
+ embed.global.dojo = embed;
+
+
+ require(tests, function(){
+ console.log('Tests loaded.');
+ document.body.innerHTML = '';
+
+ // kick off.
+ require(['../tests/modules']);
+ });
+ },
+
// Some global UI helpers:
toggleClass: function(nodeId, classString){
View
44 tests/test_AMD_built.html
@@ -1,19 +1,41 @@
<!DOCTYPE html>
<html>
<head>
- <title>AMD test, built file</title>
-<!-- <script src="../src/require.js"></script>-->
-<!-- <script src="../src/built.js"></script>-->
+ <title>EmbedJS Testrunner for built files</title>
+ <link rel="stylesheet" type="text/css" href="tests.css" />
+ <script src="../build/embed-kitchensink-android.js"></script>
<script>
-<!-- require(['embed', 'feature!array'], function(embed) {-->
-<!-- console.log('embedjs loaded.');-->
-<!-- console.log(embed);-->
-<!-- console.log(embed.forEach.toString());-->
-<!-- });-->
- </script>
- <script src="../build/testbuild-android.js.cleaned.js"></script>
+ var require = {
+ baseUrl: '../src/',
+ paths: {
+ 'implementations': '../platforms/unknown',
+ 'text': '../tests/text'
+ }
+ };
+ </script>
+ <script type="text/javascript" src="../src/require.js"></script>
+ <script type="text/javascript">
+ require([
+ //'../tests/DocTest',
+ '../tests/runner-embed',
+ '../tests/helper',
+ 'implementations'
+ ], function(/*DocTest, */runner_, helper_, implementations){
+ //window.DocTest = DocTest;
+ helper.exportGlobals(window);
+ helper.renderTable(implementations);
+
+ // DocTests currently screw up testing of specific impls, as it
+ // requires certain features, which then are chached by require.js
+ // which prevents pulling in other impls.
+ // So, it is disabled for now.
+ tests.registerDocTest = function(){};
+ });
+ </script>
</head>
<body>
- <p>This tests dynamic feature implementation in a built file.</p>
+ <div id="featureTable"></div>
+ <button onclick="helper.runBuilt()">Test selected features</button>
+ <button onclick="helper.runBuilt(true)">Test all features</button>
</body>
</html>
View
2 tests/tests/array/array.js
@@ -1,4 +1,4 @@
-tests.registerDocTests("../src/array/native.js");
+//tests.registerDocTests("../src/array/native.js");
tests.register("array",
[
//
View
2 tests/tests/html/style.js
@@ -13,7 +13,7 @@ tests.register("html-style",
// Init the stuff with what we expect, acutally this belongs in the HTML itself,
// but how do i build the .js for it? :)
dojo.style('sq100nopos', {opacity: 1, color: "red", position: "static", backgroundColor: "black"});
- tests.registerDocTests("../src/html/style.js");
+ //tests.registerDocTests("../src/html/style.js");
},
function basicStyle(){

0 comments on commit 40c0a3b

Please sign in to comment.