summaryrefslogtreecommitdiffstats
path: root/Tests/JavascriptCoverage/test3.js
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2014-10-23 21:03:30 (GMT)
committerBrad King <brad.king@kitware.com>2014-10-29 15:27:11 (GMT)
commit220e81345b68ed3ad15ef294f6de653fcd1a874c (patch)
tree759f57741cb0ba02e764515142284d6bf99ae8a1 /Tests/JavascriptCoverage/test3.js
parenta2456e157223255f0e2a71f2ddd510510e42b9e4 (diff)
downloadCMake-220e81345b68ed3ad15ef294f6de653fcd1a874c.zip
CMake-220e81345b68ed3ad15ef294f6de653fcd1a874c.tar.gz
CMake-220e81345b68ed3ad15ef294f6de653fcd1a874c.tar.bz2
CTest: Add Javascript coverage parser
Add a coverage parser for the Blanket.js library using the JSON output of the mocha.js test runner. Add a test for the new parser.
Diffstat (limited to 'Tests/JavascriptCoverage/test3.js')
-rw-r--r--Tests/JavascriptCoverage/test3.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/Tests/JavascriptCoverage/test3.js b/Tests/JavascriptCoverage/test3.js
new file mode 100644
index 0000000..a1e31bc
--- /dev/null
+++ b/Tests/JavascriptCoverage/test3.js
@@ -0,0 +1,37 @@
+var assert = require("assert")
+var test = {
+ version: "1.0.0"
+}
+function covTest(p1,p2) {
+ if (p1 > 3) {
+ return 1;
+ }
+ else {
+ return p1 + p2;
+ }
+}
+
+function covTest2(p1,p2) {
+ return 0;
+}
+
+function covTest3(p1) {
+ for(i=0;i < p1;i++){
+ }
+ return i;
+}
+function covTest4(p1) {
+ i=0;
+ while(i < p1){
+ i++;
+ }
+ return i;
+}
+
+describe('Array', function(){
+ describe('CovTest2', function(){
+ it('should return when the value is not present', function(){
+ assert.equal(0,covTest2(2,2));
+ })
+ })
+})