You could try to adapt the approach used by https://github.com/robwhitby/xray/blob/v2.1/src/coverage.xqy#L142
It's a bit complicated but basically it uses the debug and profiler APIs to implement coverage. First it uses the debug API to find out where all the expressions are. Then it runs the test cases with profiling enabled. Line numbers that show up in the profiler report are covered, while any other expressions aren't. I also tried an approach using only the debug API, but that was much slower. — Mike > On Dec 23, 2014, at 22:48, <[email protected]> > <[email protected]> wrote: > > Thanks Mike for your immediate response. We came across xray and as it > requires unit testing to be rewritten completely for coverage, we are looking > for options to cover it as part of our existing unit testing itself. Please > let me know if there are any other options. > > Thanks, > Lakshmi. > > From: [email protected] > [mailto:[email protected]] On Behalf Of Michael Blakeley > Sent: Wednesday, December 24, 2014 12:04 PM > To: MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] Code Coverage for Xquery > > There's https://github.com/robwhitby/xray/tree/v2.1 — still somewhat > experimental, but it might help. > > — Mike > > On Dec 23, 2014, at 22:12, <[email protected]> > <[email protected]> wrote: > > Hi, > > One of our client is having Web service interface connecting to ML as back > end. We have automated test cases using SOAP UI to test REST webservice. > While REST services are invoked, corresponding XQuery module files will be > called and response will be returned. Is there any way to measure the code > coverage of XQuery during this testing. > > Please let me know. > > Thanks, > Lakshmi. > > > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient(s), please reply to the > sender and destroy all copies of the original message. Any unauthorized > review, use, disclosure, dissemination, forwarding, printing or copying of > this email, and/or any action taken in reliance on the contents of this > e-mail is strictly prohibited and may be unlawful. Where permitted by > applicable law, this e-mail and other e-mail communications sent to and from > Cognizant e-mail addresses may be monitored. > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > This e-mail and any files transmitted with it are for the sole use of the > intended recipient(s) and may contain confidential and privileged > information. If you are not the intended recipient(s), please reply to the > sender and destroy all copies of the original message. Any unauthorized > review, use, disclosure, dissemination, forwarding, printing or copying of > this email, and/or any action taken in reliance on the contents of this > e-mail is strictly prohibited and may be unlawful. Where permitted by > applicable law, this e-mail and other e-mail communications sent to and from > Cognizant e-mail addresses may be monitored. > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
