relaxng / jing-trang

Schema validation and conversion based on RELAX NG
http://www.thaiopensource.com/relaxng/
Other
228 stars 69 forks source link

How to run test suite #269

Open datho7561 opened 2 years ago

datho7561 commented 2 years ago

The repository says that there is a test suite that I should be able to run with ant test, but this doesn't work. How do I run the test suite?

Initial investigation:

In a recent change, the ant task in build.xml for running the tests was renamed to ant-test to distinguish it from gradle tasks. gradle test isn't setup to run this task yet. When I try to run ant ant-test, I get an error, saying that modbuild.xml doesn't have ant-test. The generated modbuild.xml has a test task, so it's likely just a matter of running the correct modbuild.xml task from build.xml.

datho7561 commented 2 years ago

It seems like the test suite fails because it uses features of Saxon-EE that the version of Saxon in this repo doesn't support. This suggests to me that Saxon-B was used in this repo at some point, which supported some Saxon-EE features, but then the repo switch over to Saxon-HE (perhaps in https://github.com/relaxng/jing-trang/commit/f45d16d3362de7da5c24b8e59e1e4210a7b5f40a?).

Then again, one of the Saxon-EE features being used is used to reflexively call Java code to create a directory on the filesystem using the java.io.File API. Micheal Kay said on Stack Overflow that using side effects with this Saxon feature is a bad idea, so maybe its worthwhile to investigate if this can be done somewhere else in the code.

sjvudp commented 1 year ago

Just downloaded and built "master" with "BUILD SUCCESSFUL", but "test" doesn't work (on openSUSE 15.5) it seems:

Projects/jing-trang> ./ant test
Buildfile: ./build.xml

BUILD FAILED
Target "test" does not exist in the project "jing-trang". 

Total time: 0 seconds
datho7561 commented 1 year ago

@sjvudp I have a PR open to fix the test suite. If you are interested in running the tests, please check it out. It seems like this repo hasn't been active in a while, so I don't know if it will get merged. Also, I'm not sure who is still active on this repo to ask for a review.

ndw commented 1 year ago

I expect we're all still around, but I've been a bit swamped with other things and I'm not sure I was ever that sure I understood how the build system worked.

sjvudp commented 1 year ago

I expect we're all still around, but I've been a bit swamped with other things and I'm not sure I was ever that sure I understood how the build system worked.

I see two options:

  1. Merge the branch that claims to have fixed the issue
  2. Modify the docs, stating that the "./ant test" is broken and needs fixing.