-
Notifications
You must be signed in to change notification settings - Fork 684
Increase test coverage: Array.prototype.sort #2674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@repasics: How did you measure branch coverage? Which tool did you use? |
@akosthekiss |
tests/jerry/array-prototype-sort.js
Outdated
|
||
try { | ||
arr.sort(); | ||
assert(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines are misaligned.
@repasics @matedabis Could you please elaborate on the whole measurement setup a bit more? How did you build jerryscript, how did you invoke lcov, which test suite(s) did you execute? |
@matedabis Thanks for the link. The script and your note raise some further questions:
|
|
|
Sorry I realized I misunderstood a thing, I did not want to mislead you. |
I will create a modified version of the coverage tester script and test the coverage with the test suites. |
re. asserts: If I get it correctly, what you'd like to achieve is to disable asserts in debug builds. In that case you should disable |
Yes, that is what I would like to achieve. That will help for sure, thank you. |
I checked the coverage including jerry-test-suite and test262 tests, then removed the unnecessary test cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (informal)
After the #2721 statistic this PR should contain the tests for the sort_compare_helper
function as well to achive the full branch coverage.
I added new test cases what covers the sort_compare_helper function too. |
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including jerryscript-project#2682 and jerryscript-project#2674: -before: 492 / 578 -after: 570 / 574 There are 28 functions in ecma-builtin-arraybuffer-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. Co-authored-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
Added new test cases to array-prototype-sort.js to improve branch coverage. Branch coverage: sort: - before: 44/50 - after: 48/48 sort compare helper: - before: 18/24 - after: 24/24 Also removed an unnecessary condition from the while loop what counts properties with lower index than len. JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including jerryscript-project#2682 and jerryscript-project#2674: -before: 492 / 578 -after: 570 / 574 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. Co-authored-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
Summary: While measuring the branch coverage we don't count JERRY_ASSERT s. Branch coverage (covered branch/all branch): sort compare helper: |
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 401 / 478 -after: 474 / 478 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information on the link below: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e Co-authored-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 401 / 478 -after: 474 / 478 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 401 / 478 -after: 474 / 478 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 401 / 478 -after: 474 / 478 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Closed PR because of moving into a unified PR. |
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to improve branch coverage in Array.prototype routines. The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file. https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs. Branch coverage including pando-project#2682 and pando-project#2674: -before: 399 / 476 -after: 472 / 476 There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them. The other 14 functions are either already covered, or we could not improve the coverage of it. More information about the coverage improvement and the branches not reached: https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e While improving the coverage we found an unnecessary condition check, which can not be false in any cases. Co-authored-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected] JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
Added new test cases to array-prototype-sort.js to improve branch coverage.
Branch coverage:
sort:
- before: 44/50
- after: 48/48
sort compare helper:
- before: 18/24
- after: 24/24
Also removed an unnecessary condition from the while loop what counts properties
with lower index than len.
JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]