diff --git a/.gitignore b/.gitignore index ec1055155..4481e1fc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ target/ .idea/ *.iml +test/xspec/* +tutorial/xspec/* +test/result.log diff --git a/test/xspec.bats b/test/xspec.bats index 30bc147e8..ee1b89983 100644 --- a/test/xspec.bats +++ b/test/xspec.bats @@ -17,6 +17,18 @@ # #=============================================================================== +setup() { + mkdir ../tutorial/xspec + mkdir ../test/xspec +} + + +teardown() { + rm -rf ../tutorial/xspec + rm -rf ../test/xspec +} + + @test "invoking xspec without arguments prints usage" { run ../bin/xspec.sh echo $output @@ -70,13 +82,12 @@ } -# this test must run first to create xspec directory @test "invoking code coverage with Saxon9EE creates test stylesheet" { export SAXON_CP=/path/to/saxon9ee.jar run ../bin/xspec.sh -c ../tutorial/escape-for-regex.xspec echo $output [ "$status" -eq 1 ] - [ "${lines[2]}" = "Creating Test Stylesheet..." ] + [ "${lines[1]}" = "Creating Test Stylesheet..." ] } @@ -96,6 +107,7 @@ [ "$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 @@ -103,6 +115,7 @@ [ "$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 @@ -128,6 +141,7 @@ [ "${lines[18]}" = "Report available at ../tutorial/xspec/escape-for-regex-junit.xml" ] } + @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 @@ -135,6 +149,7 @@ [ "$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 diff --git a/test/xspec/xspec-junit-result.html b/test/xspec/xspec-junit-result.html deleted file mode 100644 index a04179e56..000000000 --- a/test/xspec/xspec-junit-result.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - Test Report for home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl (3/0/0/3) - - - -

Test Report

-

Stylesheet: home/sandro/Documents/programming/github/cirulls/xspec/src/reporter/junit-report.xsl

-

Tested: 17 August 2016 at 20:23

-

Contents

- - - - - - - - - - - - - - - - - - - - - - - -
passed/pending/failed/total3/0/0/3
When processing a successful test1/0/0/1
When processing a failing test1/0/0/1
When processing successful and failing tests1/0/0/1
-
-

When processing a successful test1/0/0/1

- - - - - - - - - - - - - -
When processing a successful test1/0/0/1
convert it to test case with status passedSuccess
-
-
-

When processing a failing test1/0/0/1

- - - - - - - - - - - - - -
When processing a failing test1/0/0/1
convert it to test case with status failedSuccess
-
-
-

When processing successful and failing tests1/0/0/1

- - - - - - - - - - - - - -
When processing successful and failing tests1/0/0/1
convert it to test cases with status passed and failingSuccess
-
- - \ No newline at end of file diff --git a/test/xspec/xspec-junit-result.xml b/test/xspec/xspec-junit-result.xml deleted file mode 100644 index 0cb32eb3e..000000000 --- a/test/xspec/xspec-junit-result.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - When processing a successful test - - - Successful test - -

Foo

-
- -

Foo

-
-
-
- - - - - convert it to test case with status passed - - - - - - - -
- - When processing a failing test - - - failing test - -

Foo

-
- -

Bar

-
-
-
- - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - convert it to test case with status failed - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - -
- - When processing successful and failing tests - - - Successful test - -

Foo

-
- -

Foo

-
-
- - Failing test - -

Foo

-
- -

Bar

-
-
-
- - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - convert it to test cases with status passed and failing - - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - -
-
diff --git a/test/xspec/xspec-junit.xsl b/test/xspec/xspec-junit.xsl deleted file mode 100644 index 1ab81b0c9..000000000 --- a/test/xspec/xspec-junit.xsl +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - Testing with - - - - - - type="text/xsl" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/format-xspec-report.xsl" - - - - - - - - - When processing a successful test - - When processing a successful test - - - - Successful test - - -

- Foo -

-
- -

- Foo -

-
-
-
- - - - - - Successful test - - -

- Foo -

-
- -

- Foo -

-
-
-
-
- - - - - - - - - - - -
-
- - - convert it to test case with status passed - - - - - - - - - - - - - - - - - - FAILED - - - convert it to test case with status passed - - - - - - - - - - - - - - When processing a failing test - - When processing a failing test - - - - failing test - - -

- Foo -

-
- -

- Bar -

-
-
-
- - - - - - failing test - - -

- Foo -

-
- -

- Bar -

-
-
-
-
- - - - - - - - - - - -
-
- - - convert it to test case with status failed - - - - - - - - - - - - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - - - - - FAILED - - - convert it to test case with status failed - - - - - - - - - - - - - - When processing successful and failing tests - - When processing successful and failing tests - - - - Successful test - - -

- Foo -

-
- -

- Foo -

-
-
- - - Failing test - - -

- Foo -

-
- -

- Bar -

-
-
-
- - - - - - Successful test - - -

- Foo -

-
- -

- Foo -

-
-
- - - Failing test - - -

- Foo -

-
- -

- Bar -

-
-
-
-
- - - - - - - - - - - -
-
- - - convert it to test cases with status passed and failing - - - - - - - - - - - - - - - <x:expect xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:test="http://www.jenitennison.com/xslt/unit-test" xmlns:x="http://www.jenitennison.com/xslt/xspec"><p>Bar</p></x:expect> - - - - - - - - FAILED - - - convert it to test cases with status passed and failing - - - - - - - - - - - - -
diff --git a/test/xspec/xspec-variable-result.html b/test/xspec/xspec-variable-result.html deleted file mode 100644 index 4eef2b2bd..000000000 --- a/test/xspec/xspec-variable-result.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - Test Report for home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl (4/0/0/4) - - - -

Test Report

-

Stylesheet: home/sandro/Documents/programming/github/cirulls/xspec/test/xspec-tested.xsl

-

Tested: 11 August 2016 at 23:20

-

Contents

- - - - - - - - - - - - - - - - - - - -
passed/pending/failed/total4/0/0/4
call global var2/0/0/2
call local var2/0/0/2
-
-

call global var2/0/0/2

- - - - - - - - - - - - - - - - - -
call global var2/0/0/2
the resultSuccess
the resultSuccess
-
-
-

call local var2/0/0/2

- - - - - - - - - - - - - - - - - -
call local var2/0/0/2
the resultSuccess
the resultSuccess
-
- - \ No newline at end of file diff --git a/test/xspec/xspec-variable-result.xml b/test/xspec/xspec-variable-result.xml deleted file mode 100644 index 75feb3e36..000000000 --- a/test/xspec/xspec-variable-result.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - call global var - - - - - - the result - - - - the result - - - - - call local var - - - - - - the result - - - - the result - - - - diff --git a/test/xspec/xspec-variable.xsl b/test/xspec/xspec-variable.xsl deleted file mode 100644 index 65ed55443..000000000 --- a/test/xspec/xspec-variable.xsl +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - Testing with - - - - - - type="text/xsl" href="file:/home/sandro/Documents/programming/github/cirulls/xspec/src/compiler/format-xspec-report.xsl" - - - - - - - - call global var - - call global var - - - - - - - - - - - - - - - - - - - - - - - the result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ERROR in scenario "the result": @assert|@test did not return a boolean - - - - FAILED - - - the result - - - - - - - - - - the result - - - - - - - - - - - - - - - - - - - - - - - ERROR in scenario "the result": @assert|@test did not return a boolean - - - - FAILED - - - the result - - - - - - - - - call local var - - call local var - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - the result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ERROR in scenario "the result": @assert|@test did not return a boolean - - - - FAILED - - - the result - - - - - - - - - - - - the result - - - - - - - - - - - - - - - - - - - - - - - ERROR in scenario "the result": @assert|@test did not return a boolean - - - - FAILED - - - the result - - - - - - - -