diff --git a/test/JsTestDriver.jar b/test/JsTestDriver.jar index d3fa9ee55..9de7cf64a 100644 Binary files a/test/JsTestDriver.jar and b/test/JsTestDriver.jar differ diff --git a/test/core/BracketsTest.js b/test/core/BracketsTest.js new file mode 100644 index 000000000..a0cb1e8ac --- /dev/null +++ b/test/core/BracketsTest.js @@ -0,0 +1,18 @@ +BracketsTest = TestCase("BracketsTest"); + +BracketsTest.prototype.testCodeMirrorInit = function() { + // add #editor to document + /*:DOC +=
*/ + + // init CodeMirror instance + var content = 'Brackets is going to be awesome!"\n'; + var myCodeMirror = CodeMirror($('#editor').get(0), { + value: content + }); + + // verify editor content + assertEquals(content, myCodeMirror.getValue()); + + // print to console + jstestdriver.console.log("CodeMirror.getValue() = ", myCodeMirror.getValue()); +}; \ No newline at end of file diff --git a/test/core/DemoTest.js b/test/core/DemoTest.js new file mode 100644 index 000000000..6275ca26b --- /dev/null +++ b/test/core/DemoTest.js @@ -0,0 +1,6 @@ +DemoTest = TestCase("DemoTest"); + +DemoTest.prototype.testFail = function() { + // sanity check + fail("fail"); +}; \ No newline at end of file diff --git a/test/jsTestDriver.conf b/test/jsTestDriver.conf index 3c3daadbe..876e8c83f 100644 --- a/test/jsTestDriver.conf +++ b/test/jsTestDriver.conf @@ -1,5 +1,10 @@ server: http://localhost:9876 load: - - src/*.js - - src-test/*.js + - ../src/thirdparty/CodeMirror2/lib/*.js + - ../src/thirdparty/CodeMirror2/lib/util/*.js + - ../src/thirdparty/CodeMirror2/mode/javascript/javascript.js + - ../src/thirdparty/*.js + +test: + - core/*.js diff --git a/test/server.sh b/test/server.sh new file mode 100755 index 000000000..eba9a3e92 --- /dev/null +++ b/test/server.sh @@ -0,0 +1,19 @@ +#!/bin/bash +while getopts "j:p:" flag +do + if [ $flag == "j" ]; then + JSTD=$OPTARG + elif [ $flag == "p" ]; then + PORT=$OPTARG + fi +done + +if [ -z "$PORT" ]; then + PORT=9876 +fi + +if [ -z "$JSTD" ]; then + JSTD=`ls JsTestDriver.jar` +fi + +java -jar $JSTD --port $PORT --config jsTestDriver.conf \ No newline at end of file diff --git a/test/test.sh b/test/test.sh new file mode 100755 index 000000000..fb8547a56 --- /dev/null +++ b/test/test.sh @@ -0,0 +1,22 @@ +#!/bin/bash +while getopts "j:t:" flag +do + if [ $flag == "j" ]; then + JSTD=$OPTARG + elif [ $flag == "t" ]; then + TESTS=$OPTARG + fi +done + +if [ -z "$JSTD" ]; then + JSTD=`ls JsTestDriver.jar` +fi + +if [ -z "$TESTS" ]; then + TESTS="all" + echo "Running all tests" +else + echo "Running '$TESTS'" +fi + +java -jar $JSTD --tests "$TESTS" --config jsTestDriver.conf --reset \ No newline at end of file