Skip to content
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

expath#40 fix code coverage #80

Closed
wants to merge 49 commits into from
Closed

expath#40 fix code coverage #80

wants to merge 49 commits into from

Conversation

cirulls
Copy link

@cirulls cirulls commented Aug 10, 2016

This pull request fixes the code coverage which has been broken since the release of Saxon 9.3 few years ago. The code coverage relies on having SaxonEE9 or SaxonPE9 as extension functions are available only with these two versions of Saxon (http://www.saxonica.com/html/documentation/extensions/functions/saxon-extension-functions.html).

This is an example of code coverage with the provided tutorial example:

$ bin/xspec.sh -c tutorial/escape-for-regex.xspec    
Saxon script not found, invoking JVM directly instead.

Creating Test Stylesheet...

Running Tests...
Collecting test coverage data; suppressing progress report...
****************************************
controller=net.sf.saxon.Controller@294bdeb4

Formatting Report...
passed: 5 / pending: 0 / failed: 1 / total: 6
Report available at tutorial/xspec/escape-for-regex-coverage.html
Done.

Technical notes

I describe here in more detail the changes I made.

My starting point was this thread on the Google Groups forum. I reused the example provided by Vasu Chakkera for XSLTCoverageTraceListener.java and updated it for SaxonEE 9.7. I fixed compilation errors by updating Java imported classed. I also fixed compilation warnings by specifying the types in the declaration of HashMap and HashSet.

I changed the shell script xspec.sh in order to stop the code coverage execution if Saxon9EE or Saxon9PE are not detected. When the pull request is approved and merged I'll implement the same behaviour in the Windows batch script (not really my cup of tea but I guess it's used). I would suggest to remove the deprecated coverage option (i.e. coverage instead of -c) as code coverage has been broken for few years and it's time to finally deprecate this option.

I wrote few basic unit tests for the shell script xspec.sh using the Bats framework. The tests are in xspec.bats and included in this pull request. They test that the code coverage is executed only when Saxon9EE or Saxon9PE is available.

cirulls and others added 4 commits February 21, 2016 16:10
- change schema to allow context in named scenario
- add $impl to context (now $impl:context)

References in original XSpec project:
PR 76: expath#76
issue 66: expath#66
PR-76 issue #66 allow context in named templates
- fix code coverage in shell script
- update Java class XSLTCoverageTraceListener for SaxonEE/PE 9.7
- unit tests for shell script
Sandro Cirulli added 8 commits August 11, 2016 21:54
# The first commit's message is:
#2 initial commit

# This is the 2nd commit message:

add saxon9he

# This is the 3rd commit message:

remove cat and saxon

# This is the 4th commit message:

add tests
- replace saxon:serialize() with fn:serialize and use XSLT 3.0
- output error message for Saxon8 and Saxon8-SA
- update XSpec unit test (unit test requires support for XSLT 3.0 to run as requested in #74)
- update bats unit test
@cirulls cirulls mentioned this pull request Aug 17, 2016
@cirulls
Copy link
Author

cirulls commented Aug 21, 2016

I originally committed this pull request from my branch develop. As I am going to develop more code in that branch I isolated the changes made for this pull request in branch bugfix/code-coverage. Branch bugfix/code-coverage only contains the changes for this specific pull request.

If the pull request is accepted the merge into the mainstream XSpec project should be done from branch bugfix/code-coverage.

Sandro Cirulli and others added 22 commits September 29, 2016 22:06
override TEST_DIR if set externally
output HTML report to custom directory if TEST_DIR is set as environment variable
output HTML report to custom directory if TEST_DIR is set as environment variable
- test naming collision in result file when a function read a document containing more than 100 nodes
- update travis configuration after repo transfer
- move location of Saxon processor and add license information
- remove Saxon binaries
- amend travis configuration to download Saxon jar file from Maven repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants