Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch coverage instrumentation work-in-progress, handles for loops, …
…while loops and do-while loops. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135128136
- Loading branch information
Showing
10 changed files
with
194 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...oogle/javascript/jscomp/testdata/CoverageInstrumentationPassTest/DoWhileLoopBranch.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
function AlwaysTrue(x){ | |||
var i = 0; | |||
do { | |||
return true; | |||
} while (i < x); | |||
return false; | |||
} |
18 changes: 18 additions & 0 deletions
18
...javascript/jscomp/testdata/CoverageInstrumentationPassTest/DoWhileLoopBranchGolden.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
var __jscov = window.top.__jscov || (window.top.__jscov = {fileNames:[], branchPresent:[], branchesInLine:[], branchesTaken:[]}); | |||
var JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata = []; | |||
__jscov.branchesTaken.push(JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata); | |||
__jscov.branchPresent.push("04"); | |||
var JSCompiler_lcov_branchesInLine = []; | |||
JSCompiler_lcov_branchesInLine[0] = 2; | |||
__jscov.branchesInLine.push(JSCompiler_lcov_branchesInLine); | |||
__jscov.fileNames.push("CoverageInstrumentationPassTest/DoWhileLoopBranch.jsdata"); | |||
function AlwaysTrue(x) { | |||
var i = 0; | |||
do { | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata[0] = true; | |||
return true; | |||
} while (i < x); | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata[1] = true; | |||
return false; | |||
} | |||
; |
10 changes: 10 additions & 0 deletions
10
...ascript/jscomp/testdata/CoverageInstrumentationPassTest/DoWhileLoopMultiLineBranch.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
function AlwaysTrue(x){ | |||
var i = 0; | |||
do { | |||
i++; | |||
i++; | |||
i++; | |||
return true; | |||
} while (i < x); | |||
return false; | |||
} |
21 changes: 21 additions & 0 deletions
21
...t/jscomp/testdata/CoverageInstrumentationPassTest/DoWhileLoopMultiLineBranchGolden.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
var __jscov = window.top.__jscov || (window.top.__jscov = {fileNames:[], branchPresent:[], branchesInLine:[], branchesTaken:[]}); | |||
var JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata = []; | |||
__jscov.branchesTaken.push(JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata); | |||
__jscov.branchPresent.push("04"); | |||
var JSCompiler_lcov_branchesInLine = []; | |||
JSCompiler_lcov_branchesInLine[0] = 2; | |||
__jscov.branchesInLine.push(JSCompiler_lcov_branchesInLine); | |||
__jscov.fileNames.push("CoverageInstrumentationPassTest/DoWhileLoopBranch.jsdata"); | |||
function AlwaysTrue(x) { | |||
var i = 0; | |||
do { | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata[0] = true; | |||
i++; | |||
i++; | |||
i++; | |||
return true; | |||
} while (i < x); | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_DoWhileLoopBranch_jsdata[1] = true; | |||
return false; | |||
} | |||
; |
8 changes: 8 additions & 0 deletions
8
...om/google/javascript/jscomp/testdata/CoverageInstrumentationPassTest/ForLoopBranch.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
function IsPostive(x){ | |||
for (var i = 0; i < x; i++) { | |||
return true; | |||
} | |||
{ | |||
return false; | |||
} | |||
} |
17 changes: 17 additions & 0 deletions
17
...gle/javascript/jscomp/testdata/CoverageInstrumentationPassTest/ForLoopBranchGolden.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
var __jscov = window.top.__jscov || (window.top.__jscov = {fileNames:[], branchPresent:[], branchesInLine:[], branchesTaken:[]}); | |||
var JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_ForLoopBranch_jsdata = []; | |||
__jscov.branchesTaken.push(JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_ForLoopBranch_jsdata); | |||
__jscov.branchPresent.push("02"); | |||
var JSCompiler_lcov_branchesInLine = []; | |||
JSCompiler_lcov_branchesInLine[0] = 2; | |||
__jscov.branchesInLine.push(JSCompiler_lcov_branchesInLine); | |||
__jscov.fileNames.push("CoverageInstrumentationPassTest/ForLoopBranch.jsdata"); | |||
function IsPostive(x) { | |||
for (var i = 0;i < x;i++) { | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_ForLoopBranch_jsdata[0] = true; | |||
return true; | |||
} | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_ForLoopBranch_jsdata[1] = true; | |||
return false; | |||
} | |||
; |
7 changes: 7 additions & 0 deletions
7
.../google/javascript/jscomp/testdata/CoverageInstrumentationPassTest/WhileLoopBranch.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
function IsPostive(x){ | |||
var i = 0; | |||
while(i < x) { | |||
return true; | |||
} | |||
return false; | |||
} |
17 changes: 17 additions & 0 deletions
17
...e/javascript/jscomp/testdata/CoverageInstrumentationPassTest/WhileLoopBranchGolden.jsdata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
var __jscov = window.top.__jscov || (window.top.__jscov = {fileNames:[], branchPresent:[], branchesInLine:[], branchesTaken:[]}); | |||
var JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_WhileLoopBranch_jsdata = []; | |||
__jscov.branchesTaken.push(JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_WhileLoopBranch_jsdata); | |||
__jscov.branchPresent.push("04"); | |||
var JSCompiler_lcov_branchesInLine = []; | |||
JSCompiler_lcov_branchesInLine[0] = 2; | |||
__jscov.branchesInLine.push(JSCompiler_lcov_branchesInLine); | |||
__jscov.fileNames.push("CoverageInstrumentationPassTest/WhileLoopBranch.jsdata"); | |||
function IsPostive(x) { | |||
for (var i = 0;i < x;) { | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_WhileLoopBranch_jsdata[0] = true; | |||
return true; | |||
} | |||
JSCompiler_lcov_branch_data_CoverageInstrumentationPassTest_WhileLoopBranch_jsdata[1] = true; | |||
return false; | |||
} | |||
; |