diff --git a/build/test/test.js b/build/test/test.js new file mode 100644 index 000000000..453eb5db7 --- /dev/null +++ b/build/test/test.js @@ -0,0 +1,38 @@ +load( "build/js/writeFile.js", "build/js/parse.js" ); + +var dir = arguments[1]; + +var indexFile = readFile( "build/test/index.html" ); +var testFile = readFile( "build/test/test.html" ); +var files = {}; + +var jq = parse( readFile( arguments[0] ) ); + +for ( var i = 0; i < jq.length; i++ ) { + if ( jq[i].tests.length > 0 ) { + + var count = 1; + while ( files[ jq[i].name + count ] ) { count++; } + var name = jq[i].name + count; + + var myFile = testFile + .replace( /{TITLE}/g, jq[i].name ) + .replace( /{NUM}/g, jq[i].tests.length ) + .replace( /{TESTS}/g, jq[i].tests.join("\n") ); + + var fileName = "tests/" + name + ".js"; + + //writeFile( dir + "/" + fileName, myFile ); + writeFile( dir + "/" + fileName, jq[i].tests.join("\n") ); + + files[ fileName ] = 1; + } +} + +var fileString = ""; +for ( var i in files ) { + if ( fileString ) fileString += ", "; + fileString += "'" + i + "'"; +} + +writeFile( dir + "/index.html", indexFile.replace( /{FILES}/g, fileString ) ); diff --git a/build/test/tests/basic.html b/build/test/tests/basic.html deleted file mode 100644 index 9710083d1..000000000 --- a/build/test/tests/basic.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - -

Basic Usage

- - - - - -
- - diff --git a/build/test/tests/css1.html b/build/test/tests/css1.html deleted file mode 100644 index 014fe4fb1..000000000 --- a/build/test/tests/css1.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -

CSS 1 Selectors

- - - - -
- - diff --git a/build/test/tests/css2.html b/build/test/tests/css2.html deleted file mode 100644 index 5f19308c5..000000000 --- a/build/test/tests/css2.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - -

CSS 2 Selectors

- - - -
- - diff --git a/build/test/tests/css3.html b/build/test/tests/css3.html deleted file mode 100644 index ced1f9ca7..000000000 --- a/build/test/tests/css3.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - -

CSS 3 Selectors

- - - - -
- - diff --git a/build/test/tests/custom.html b/build/test/tests/custom.html deleted file mode 100644 index 8341a2f80..000000000 --- a/build/test/tests/custom.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - -

Custom Expressions

- - - - -
- - diff --git a/build/test/tests/prereq.html b/build/test/tests/prereq.html deleted file mode 100644 index e73f19b90..000000000 --- a/build/test/tests/prereq.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - -

Test for Prerequisites

- -
- - diff --git a/build/test/tests/xpath.html b/build/test/tests/xpath.html deleted file mode 100644 index 483f89692..000000000 --- a/build/test/tests/xpath.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - -

XPath Expressions

- - - - -
- -