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

Align Travis configuration with AppVeyor in #86 #96

Merged
merged 3 commits into from Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions .travis.yml
Expand Up @@ -2,6 +2,7 @@ env:
matrix:
# latest Saxon 9.7 version
- SAXON_VERSION=9.7.0-15
XMLCALABASH_VERSION=1.1.15-97
# latest Saxon 9.6 version
- SAXON_VERSION=9.6.0-10
# Saxon version used in oXygen
Expand All @@ -19,10 +20,13 @@ before_script:
- wget -O ${SAXON_CP} http://central.maven.org/maven2/net/sf/saxon/Saxon-HE/${SAXON_VERSION}/Saxon-HE-${SAXON_VERSION}.jar
- chmod +x ${SAXON_CP}
# install XML Calabash
- export XMLCALABASH_VERSION=1.1.15-97
- wget -O /tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}.zip https://github.com/ndw/xmlcalabash1/releases/download/${XMLCALABASH_VERSION}/xmlcalabash-${XMLCALABASH_VERSION}.zip
- unzip /tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}.zip -d /tmp/xspec
- export XMLCALABASH_CP=/tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}/xmlcalabash-${XMLCALABASH_VERSION}.jar
- if [ -z ${XMLCALABASH_VERSION} ]; then
echo "XMLCalabash will not be installed as it uses a higher version of Saxon";
else
wget -O /tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}.zip https://github.com/ndw/xmlcalabash1/releases/download/${XMLCALABASH_VERSION}/xmlcalabash-${XMLCALABASH_VERSION}.zip;
unzip /tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}.zip -d /tmp/xspec;
export XMLCALABASH_CP=/tmp/xspec/xmlcalabash-${XMLCALABASH_VERSION}/xmlcalabash-${XMLCALABASH_VERSION}.jar;
fi

script:
- cd test
Expand Down
60 changes: 32 additions & 28 deletions test/xspec.bats
Expand Up @@ -18,20 +18,20 @@
#===============================================================================

setup() {
mkdir ../tutorial/xspec
mkdir ../test/xspec
mkdir ../tutorial/xspec
mkdir ../test/xspec
}


teardown() {
rm -rf ../tutorial/xspec
rm -rf ../test/xspec
rm -rf ../tutorial/xspec
rm -rf ../test/xspec
}


@test "invoking xspec without arguments prints usage" {
run ../bin/xspec.sh
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[2]}" = "Usage: xspec [-t|-q|-c|-j|-h] filename [coverage]" ]
}
Expand All @@ -40,7 +40,7 @@ teardown() {
@test "invoking code coverage with Saxon9HE returns error message" {
export SAXON_CP=/path/to/saxon9he.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
}
Expand All @@ -49,7 +49,7 @@ teardown() {
@test "invoking code coverage with Saxon9SA returns error message" {
export SAXON_CP=/path/to/saxon9sa.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
}
Expand All @@ -58,7 +58,7 @@ teardown() {
@test "invoking code coverage with Saxon9 returns error message" {
export SAXON_CP=/path/to/saxon9.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
}
Expand All @@ -67,7 +67,7 @@ teardown() {
@test "invoking code coverage with Saxon8SA returns error message" {
export SAXON_CP=/path/to/saxon8sa.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
}
Expand All @@ -76,7 +76,7 @@ teardown() {
@test "invoking code coverage with Saxon8 returns error message" {
export SAXON_CP=/path/to/saxon8.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Code coverage requires Saxon extension functions which are available only under Saxon9EE or Saxon9PE." ]
}
Expand All @@ -94,7 +94,7 @@ teardown() {
@test "invoking code coverage with Saxon9PE creates test stylesheet" {
export SAXON_CP=/path/to/saxon9pe.jar
run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Creating Test Stylesheet..." ]
}
Expand All @@ -103,23 +103,23 @@ teardown() {
@test "invoking xspec generates XML report file" {
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
run stat ../tutorial/xspec/escape-for-regex-result.xml
echo $output
echo $output
[ "$status" -eq 0 ]
}


@test "invoking xspec generates HTML report file" {
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
run stat ../tutorial/xspec/escape-for-regex-result.html
echo $output
echo $output
[ "$status" -eq 0 ]
}


@test "invoking xspec with -j option with Saxon8 returns error message" {
export SAXON_CP=/path/to/saxon8.jar
run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Saxon8 detected. JUnit report requires Saxon9." ]
}
Expand All @@ -128,15 +128,15 @@ teardown() {
@test "invoking xspec with -j option with Saxon8-SA returns error message" {
export SAXON_CP=/path/to/saxon8sa.jar
run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Saxon8 detected. JUnit report requires Saxon9." ]
}


@test "invoking xspec with -j option generates message with JUnit report location" {
run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 0 ]
[ "${lines[18]}" = "Report available at ../tutorial/xspec/escape-for-regex-junit.xml" ]
}
Expand All @@ -145,56 +145,60 @@ teardown() {
@test "invoking xspec with -j option generates XML report file" {
run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
run stat ../tutorial/xspec/escape-for-regex-result.xml
echo $output
echo $output
[ "$status" -eq 0 ]
}


@test "invoking xspec with -j option generates JUnit report file" {
run ../bin/xspec.sh -j ../tutorial/escape-for-regex.xspec
run stat ../tutorial/xspec/escape-for-regex-junit.xml
echo $output
echo $output
[ "$status" -eq 0 ]
}


@test "invoking xspec with Saxon-B-9-1-0-8 creates test stylesheet" {
export SAXON_CP=/path/to/saxonb9-1-0-8.jar
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
echo $output
[ "$status" -eq 1 ]
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
echo $output
[ "$status" -eq 1 ]
[ "${lines[1]}" = "Creating Test Stylesheet..." ]
}


@test "invoking xspec.sh with TEST_DIR already set externally generates files inside TEST_DIR" {
export TEST_DIR=/tmp
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 0 ]
[ "${lines[18]}" = "Report available at /tmp/escape-for-regex-result.html" ]
}


@test "invoking xspec.sh without TEST_DIR generates files in default location" {
run ../bin/xspec.sh ../tutorial/escape-for-regex.xspec
echo $output
echo $output
[ "$status" -eq 0 ]
[ "${lines[18]}" = "Report available at ../tutorial/xspec/escape-for-regex-result.html" ]
}


@test "invoking xspec.sh that passes a non xs:boolean does not raise a warning #46" {
run ../bin/xspec.sh ../test/xspec-46.xspec
echo $output
echo $output
[ "$status" -eq 0 ]
[[ "${lines[3]}" =~ "Testing with" ]]
}


@test "executing the Saxon XProc harness generates a report with UTF-8 encoding" {
run java -Xmx1024m -cp ${XMLCALABASH_CP} com.xmlcalabash.drivers.Main -isource=xspec-72.xspec xspec-home=file:${PWD}/../ -oresult=xspec/xspec-72-result.html ../src/harnesses/saxon/saxon-xslt-harness.xproc
run java -cp ${SAXON_CP} net.sf.saxon.Query -s:xspec/xspec-72-result.html -qs:"declare default element namespace 'http://www.w3.org/1999/xhtml'; concat(/html/head/meta[@http-equiv eq 'Content-Type']/@content = 'text/html; charset=UTF-8', '
')" !method=text
echo $output
if [ -z ${XMLCALABASH_CP} ]; then
skip "test for XProc skipped as XMLCalabash uses a higher version of Saxon";
fi

run java -Xmx1024m -cp ${XMLCALABASH_CP} com.xmlcalabash.drivers.Main -isource=xspec-72.xspec xspec-home=file://${TRAVIS_BUILD_DIR}/ -oresult=${TRAVIS_BUILD_DIR}/test/xspec/xspec-72-result.html ${TRAVIS_BUILD_DIR}/src/harnesses/saxon/saxon-xslt-harness.xproc
run java -cp ${SAXON_CP} net.sf.saxon.Query -s:${TRAVIS_BUILD_DIR}/test/xspec/xspec-72-result.html -qs:"declare default element namespace 'http://www.w3.org/1999/xhtml'; /html/head/meta[@http-equiv eq 'Content-Type']/@content = 'text/html; charset=UTF-8'" !method=text
Copy link
Member

@AirQuick AirQuick Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take the run java lines from #86? It corresponds to the initial comment of #86:

  • xspec.bats is also modified a bit. (in order to be more platform independent)
  • '
' is added to XQuery. (in order to avoid conflict with the "Picked up JAVA_TOOL_OPTIONS..." stderr line which is emitted when the JAVA_TOOL_OPTIONS environment variable is defined)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Already merged to master. I'll make another pull request for this...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, for once I was too quick ;-) Yes, please make another pull request so that we can trace every change. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submitted #98

echo $output
[[ "${lines[0]}" = 'true' ]]
}
}