From 2515000d028af35183ecda8f4c55cd42f1adf09d Mon Sep 17 00:00:00 2001 From: Wendell Piez Date: Tue, 30 Jan 2024 15:34:37 -0500 Subject: [PATCH] Some XProc for running XSpec (#94) * Towards #93: support for calling XSpec using XProc and bash scripting (calling XML Calabash under Maven), with batch processing. Includes XProc and XSLT-based pipelines for executing XSpec as well as shell scripting and utility code. With aggregation capabilities and a new HTML format for XSpec results. --- bin/metaschema-xslt | 11 + support/pom.xml | 25 + support/xspec-dev/XSPEC-BATCH.xsl | 236 ++++++++ support/xspec-dev/XSPEC-SINGLE.xsl | 100 ++++ support/xspec-dev/mvn-saxon-xspec-batch.sh | 77 +++ support/xspec-dev/mvn-saxon-xspec-html.sh | 36 ++ support/xspec-dev/mvn-xproc-xspec-html.sh | 33 ++ support/xspec-dev/planning.md | 20 + support/xspec-dev/readme.md | 174 ++++++ support/xspec-dev/testing/copy_me.xsl | 9 + support/xspec-dev/testing/iso8601.ixml | 171 ++++++ support/xspec-dev/testing/ixml-demo.xsl | 57 ++ support/xspec-dev/testing/ixml-parsing.xspec | 92 +++ .../testing/mvn-xproc-xspec-test-batch.sh | 32 ++ .../xspec-dev/testing/test/xspec-basicR.xspec | 47 ++ support/xspec-dev/testing/xspec-basic.xspec | 47 ++ support/xspec-dev/testing/xspec-shell.xspec | 35 ++ .../xspec-dev/testing/xspec-test-batch.xpl | 75 +++ support/xspec-dev/xspec-assurance.sch | 13 + support/xspec-dev/xspec-batch-report.xpl | 98 ++++ support/xspec-dev/xspec-mx-html-report.xsl | 538 ++++++++++++++++++ support/xspec-dev/xspec-single-report.xpl | 85 +++ .../xspec-single-xspec-repo-report.xpl | 78 +++ support/xspec-dev/xspec-summarize.xsl | 50 ++ support/xspec-dev/xspec-summary-reduce.xsl | 72 +++ 25 files changed, 2211 insertions(+) create mode 100644 support/xspec-dev/XSPEC-BATCH.xsl create mode 100644 support/xspec-dev/XSPEC-SINGLE.xsl create mode 100644 support/xspec-dev/mvn-saxon-xspec-batch.sh create mode 100644 support/xspec-dev/mvn-saxon-xspec-html.sh create mode 100644 support/xspec-dev/mvn-xproc-xspec-html.sh create mode 100644 support/xspec-dev/planning.md create mode 100644 support/xspec-dev/readme.md create mode 100644 support/xspec-dev/testing/copy_me.xsl create mode 100644 support/xspec-dev/testing/iso8601.ixml create mode 100644 support/xspec-dev/testing/ixml-demo.xsl create mode 100644 support/xspec-dev/testing/ixml-parsing.xspec create mode 100644 support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh create mode 100644 support/xspec-dev/testing/test/xspec-basicR.xspec create mode 100644 support/xspec-dev/testing/xspec-basic.xspec create mode 100644 support/xspec-dev/testing/xspec-shell.xspec create mode 100644 support/xspec-dev/testing/xspec-test-batch.xpl create mode 100644 support/xspec-dev/xspec-assurance.sch create mode 100644 support/xspec-dev/xspec-batch-report.xpl create mode 100644 support/xspec-dev/xspec-mx-html-report.xsl create mode 100644 support/xspec-dev/xspec-single-report.xpl create mode 100644 support/xspec-dev/xspec-single-xspec-repo-report.xpl create mode 100644 support/xspec-dev/xspec-summarize.xsl create mode 100644 support/xspec-dev/xspec-summary-reduce.xsl diff --git a/bin/metaschema-xslt b/bin/metaschema-xslt index 33ab14f3..a8b0ecda 100755 --- a/bin/metaschema-xslt +++ b/bin/metaschema-xslt @@ -25,6 +25,11 @@ Subcommands: Generate converter transformations (XSLT) between JSON and XML for a given metaschema - composition-validate METASCHEMA_XML [ADDITIONAL_ARGS] Test metaschema composition (assembling modules and linking definitions) and report issues +- xpec-test XSPEC_XML [ADDITIONAL_ARGS] + Compile and run a (single) XSpec test set, producing a report in a folder named xspec +- xpec-batch [ADDITIONAL_ARGS] + Compile and run a collection of XSpec test sets, echoing a summary report to the console + Parameters: folder, pattern, stop-on-error (TODO: UPDATE ME) EOF } @@ -69,6 +74,12 @@ case "$SUBCOMMAND" in ;; composition-validate) "$SRC_DIR"/validate/mvn-composition-validate-xpl.sh "$@" + ;; + xspec-batch) + "$ROOT_DIR"/support/xspec-dev/mvn-saxon-xspec-batch.sh "$@" + ;; + xspec-test) + "$ROOT_DIR"/support/xspec-dev/mvn-saxon-xspec-html.sh "$@" ;; ?) msg "Unknown subcommand: $SUBCOMMAND" diff --git a/support/pom.xml b/support/pom.xml index ff2f62d7..e6d64aa4 100644 --- a/support/pom.xml +++ b/support/pom.xml @@ -23,6 +23,10 @@ redirect. https://github.com/restlet/restlet-framework-java/issues/1390 --> + + Maven Central + https://repo1.maven.org/maven2 + maven.restlet.org maven.restlet.org @@ -41,6 +45,27 @@ xmlcalabash 1.5.3-110 + + + + org.nineml + coffeegrinder + 3.2.6 + runtime + + + org.nineml + coffeefilter + 3.2.6 + runtime + + + org.nineml + coffeesacks + 3.2.6 + runtime + + diff --git a/support/xspec-dev/XSPEC-BATCH.xsl b/support/xspec-dev/XSPEC-BATCH.xsl new file mode 100644 index 00000000..de456acd --- /dev/null +++ b/support/xspec-dev/XSPEC-BATCH.xsl @@ -0,0 +1,236 @@ + + + + + + + + + + + ../xspec/src/compiler/compile-xslt-tests.xsl + + + + + + + + + src + + *.xspec + + no + + + + + + + no + + + + + + + select={$pattern} + recurse={ if ($recurse=('no','false')) then 'no' else 'yes' } + on-error={ if ($stopping-on-error) then 'fail' else 'warning' } + + + + + + + + + + ERROR: Unable to resolve collection at URI {$collection-uri} - getting {$err:code} '{$err:description}' + + + + + + Param $baseURI is: { $baseURI } + Static base URI is: { static-base-uri() } + + + + + + Acquiring collection from { $collection-uri } + + + + + + + + ERROR: Unable to compile XSpec at { $my?name } - getting {$err:code} '{$err:description}' + + + + + + + + + + ERROR: + Unable to execute compiled XSpec from { /*/xsl:variable[@name='Q{{http://www.jenitennison.com/xslt/xspec}}xspec-uri'] } - getting {$err:code} + '{$err:description}' + + + + + + + + + + + + + + + + + + + + + + WARNING: of { count($collection-in) } { if (count($collection-in)=1) then 'file' else 'files' }, { count($dropped) } { if (count($dropped) = 1) then 'file selected was' else 'were' } dropped - either unavailable, would not compile (XSpec to XSLT), or would not execute (XSLT): + { $dropped?name => string-join(', ') } + + + + + + + + + + + + + + + + + + + + + + + + + {$report-to}/{$xspec-basename}.html + + + + + + + + + + + + + + Writing report {$filename} ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/support/xspec-dev/XSPEC-SINGLE.xsl b/support/xspec-dev/XSPEC-SINGLE.xsl new file mode 100644 index 00000000..5599a8ee --- /dev/null +++ b/support/xspec-dev/XSPEC-SINGLE.xsl @@ -0,0 +1,100 @@ + + + + + + + + ../xspec/src/compiler/compile-xslt-tests.xsl + + + + + + + + + + + + + + + ... and formatted a report. + + + + + + + + + + + + + + + + + + + + + + + + + + ... compiled XSpec ... + + + + + + + + + + + + + + + + + + + + ... executed XSpec ... + + + \ No newline at end of file diff --git a/support/xspec-dev/mvn-saxon-xspec-batch.sh b/support/xspec-dev/mvn-saxon-xspec-batch.sh new file mode 100644 index 00000000..24548edb --- /dev/null +++ b/support/xspec-dev/mvn-saxon-xspec-batch.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../src/common/subcommand_common.bash" + +XSLT_FILE="${SCRIPT_DIR}/XSPEC-BATCH.xsl" + +usage() { + cat </dev/null to drop all runtime messages / progress reports instead of logging +# the process should error out only if stop-on-error=yes, otherwise it will do its best to complete +invoke_saxon "${SAXON_ARGS}" 2>${LOGFILE} || echo_on_error "Errors encountered running XSpec - check log file" diff --git a/support/xspec-dev/mvn-saxon-xspec-html.sh b/support/xspec-dev/mvn-saxon-xspec-html.sh new file mode 100644 index 00000000..8aae060a --- /dev/null +++ b/support/xspec-dev/mvn-saxon-xspec-html.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../src/common/subcommand_common.bash" + +XSLT_FILE="${SCRIPT_DIR}/XSPEC-SINGLE.xsl" + +usage() { + cat </dev/null` in the command invoking the script. + +``` +./mvn-saxon-xspec-batch.sh folder=src/project recurse=yes 2>/dev/null +``` + +All XSpec files in the folder `src/project` and any subfolders, reporting results to the console (STDOUT) but not creating HTML reports and not echoing warning or error messages to the console. + +It is best to silence STDERR only after you are confident that all XSpecs in your file set can be run successfully, especially if the "break early on error" option is set (since you will neither see STDERR nor get any results). + +## Enhanced HTML Production + +In order to work around limitations in the current XSpec HTML production (details with respect to its deployment under XProc 1.0), a [new HTML production XSLT](xspec-mx-html-report.xsl) is provided here, for use either for standalone XSpec reporting, or for reporting results from several XSpecs in aggregate ("batch"). + +[This XSLT ](xspec-mx-html-report.xsl) produces standalone HTML including embedded CSS and some lightweight Javascript supporting navigation features. + +### Theming HTML from XProc + +The XProc files support a runtime option, `theme`, which also exposes control of the theme setting (in the HTML and CSS). This takes the form of an HTML `class` value on the `body` element, along with CSS to be applied to the page on the basis of that setting. + +- `theme=clean` (the default) produces a medium-contrast color-neutral format +- `theme=uswds` uses colors for emphasis from the USWDS color scheme +- `theme=classic` uses colors drawn from the good-old XSpec HTML +- `theme=toybox` provides a more extravagant scheme. + +New themes can be added in the XSLT or in a new "shell" XSLT importing it, by copying and modifying an appropriate template to match the new theme and give it style. Such an importing XSLT can also modify any other feature of the HTML page result. + diff --git a/support/xspec-dev/testing/copy_me.xsl b/support/xspec-dev/testing/copy_me.xsl new file mode 100644 index 00000000..6e34968e --- /dev/null +++ b/support/xspec-dev/testing/copy_me.xsl @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/support/xspec-dev/testing/iso8601.ixml b/support/xspec-dev/testing/iso8601.ixml new file mode 100644 index 00000000..9a4b6933 --- /dev/null +++ b/support/xspec-dev/testing/iso8601.ixml @@ -0,0 +1,171 @@ +{ An Invisible XML grammar for ISO 8601(:2004?) dates and times. } +{ Originally constructed by Norm Tovey-Walsh, 17 April 2022 } +{ See https://en.wikipedia.org/wiki/ISO_8601 among others } + +-iso8601-datetime = date + ; time + ; datetime + ; duration + ; interval + ; recurrence . + +date = calendar-date ; ordinal-date ; week-date . + +-time = local-time ; utc-time . + +-datetime = local-datetime ; utc-datetime . + +local-datetime = -date, -'T', -local-time-no-t . +utc-datetime = -date, -'T', -utc-time-no-t . + +duration = -standard-duration; -alternate-duration . + +interval = start-end-interval + ; start-plus-duration-interval + ; duration-plus-end-interval . + +recurrence = repeat-count, -'/', interval . + +{ -- Calendar dates -- } + +-calendar-date = complete-calendar-date + ; reduced-accuracy-calendar-date + ; expanded-calendar-date . + +-complete-calendar-date = year, month, day; year, -'-', month, -'-', day . + +-reduced-accuracy-calendar-date = year, -'-', month; year; century . + +-expanded-calendar-date = expanded-year, month, day + ; expanded-year, -'-', month, -'-', day + ; expanded-year, -'-', month + ; expanded-year + ; expanded-century . + +{ -- Ordinal dates -- } + +-ordinal-date = complete-ordinal-date ; expanded-ordinal-date . + +-complete-ordinal-date = year, day-of-year + ; year, -'-', day-of-year . + +-expanded-ordinal-date = expanded-year, day-of-year + ; expanded-year, -'-', day-of-year . + +{ -- Week dates -- } + +-week-date = complete-week-date + ; reduced-accuracy-week-date + ; expanded-week-date . + +-complete-week-date = year, -'W', week, day-of-week + ; year, -'-W', week, -'-', day-of-week . + +-reduced-accuracy-week-date = year, -'W', week + ; year, -'-W', week . + +-expanded-week-date = expanded-year, -'W', week, day-of-week + ; expanded-year, -'-W', week, '-', day-of-week + ; expanded-year, -'W', week + ; expanded-year, -'-W', week . + +{ -- Local time -- } + +local-time = local-time-t ; local-time-no-t . + +-local-time-t = local-time-without-utc-t; local-time-with-utc-t . +-local-time-no-t = local-time-without-utc; local-time-with-utc . + +-local-time-without-utc-t = -'T', local-time-without-utc . + +-local-time-without-utc = hour, minute, second + ; hour, -':', minute, -':', second + ; hour, minute + ; hour, -':', minute + ; hour + ; fractional-second-local-time + ; fractional-minute-local-time + ; fractional-hour-local-time . + +-local-time-with-utc-t = -local-time-without-utc-t, utc-offset . +-local-time-with-utc = -local-time-without-utc, utc-offset . + +-fractional-second-local-time = (hour, minute, second; hour, -':', minute, -':', second), + fraction-sep, + fractional-second . + +-fractional-minute-local-time = (hour, minute; hour, -':', minute), + fraction-sep, + fractional-minute . + +-fractional-hour-local-time = hour, fraction-sep, fractional-hour . + +utc-offset = offset-hour, (-':'?, offset-minute)? . + +{ -- UTC time -- } + +utc-time = utc-time-t ; utc-time-no-t . +-utc-time-t = -local-time-without-utc-t, -'Z' . +-utc-time-no-t = -local-time-without-utc, -'Z' . + +{ -- Durations -- } + +-standard-duration = -'P', (standard-ymdhs-duration ; standard-week-duration) . + +{ N.B. This tecnically allows a standard-ymdhs-duration with no fields. } +-standard-ymdhs-duration = duration-years?, duration-months?, duration-days?, + (-'T', duration-hours?, duration-minutes?, duration-seconds?)? . +-standard-week-duration = duration-weeks . + +-alternate-duration = -'P', (alternate-ymd-duration ; alternate-yd-duration) . + +-alternate-ymd-duration = year, month, day, -'T', hour, minute, second + ; year, -'-', month, -'-', day, -'T', hour, -':', minute, -':', second . +-alternate-yd-duration = year, number-of-days, -'T', hour, minute, second + ; year, -'-', number-of-days, -'T', hour, -':', minute, -':', second . + +-start-end-interval = (date; datetime), -'/', (date; datetime) . +-start-plus-duration-interval = (date; datetime), -'/', duration . +-duration-plus-end-interval = duration, -'/', (date; datetime) . + +duration-years = digit+, -'Y' . +duration-months = digit+, -'M' . +duration-days = digit+, -'D' . +duration-hours = digit+, -'H' . +duration-minutes = digit+, -'M' . +duration-seconds = digit+, -'S' . +duration-weeks = digit+, -'W' . + +{ -- Recurrence -- } + +-repeat-count = -'R-1' ; -'R' ; -'R', repetitions . +repetitions = digit+ . + +{ -- Utility rules -- } + +expanded-year = sign, digit+, digit, digit, digit . +expanded-century = sign, digit+, digit, digit . +-sign = -'+' ; '-' . + +offset-hour = @direction, digit, digit . +offset-minute = digit, digit . +direction = '+'; '-' . + +year = digit, digit, digit, digit . +century = digit, digit . +month = digit, digit . +week = digit, digit . +day = digit, digit . +hour = digit, digit . +minute = digit, digit . +second = digit, digit . +fractional-second = digit+ . +fractional-minute = digit+ . +fractional-hour = digit+ . + +day-of-year = digit, digit, digit . +number-of-days = -day-of-year . +day-of-week = digit . + +-digit = ["0"-"9"] . +-fraction-sep = -[','; '.'] . diff --git a/support/xspec-dev/testing/ixml-demo.xsl b/support/xspec-dev/testing/ixml-demo.xsl new file mode 100644 index 00000000..da0232d5 --- /dev/null +++ b/support/xspec-dev/testing/ixml-demo.xsl @@ -0,0 +1,57 @@ + + + + + + + + iso8601.ixml + + + + + 1962-06-28 + 1963-11-04 + 2024-02-30 + 2024-02-99 + 2024-01-17T17:26:38.416457100-05:00 + 2024-02-300 + 2025-12-25 + 2025-12-31T + + + + + + + + + + + + + + + + + + + + BUST on '{ $maybeDateTime }' + + + + + + diff --git a/support/xspec-dev/testing/ixml-parsing.xspec b/support/xspec-dev/testing/ixml-parsing.xspec new file mode 100644 index 00000000..6fdc1345 --- /dev/null +++ b/support/xspec-dev/testing/ixml-parsing.xspec @@ -0,0 +1,92 @@ + + + + + Parsing some dates + + + + 2024-01-20 + + + + + 2024 + 01 + 20 + + + + + + + 2024-01-0 + + + + BUST on '2024-01-0' + + + + + + 2024-01-18T14:44 + + + + + 2024 + 01 + 18 + 14 + 44 + + + + + + + 2024-01-18T14:44:10 + + + + + 2024 + 01 + 18 + 14 + 44 + 10 + + + + + + + 2024-01-18T14:44:10.777578600-05:00 + + + + + 2024 + 01 + 18 + 14 + 44 + 10 + 777578600 + + 05 + 00 + + + + + + + diff --git a/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh b/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh new file mode 100644 index 00000000..2fceeba5 --- /dev/null +++ b/support/xspec-dev/testing/mvn-xproc-xspec-test-batch.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# shellcheck source=../common/subcommand_common.bash + +source "$SCRIPT_DIR/../../../src/common/subcommand_common.bash" + +XPROC_FILE="${SCRIPT_DIR}/xspec-test-batch.xpl" +REPORT_HTML="xspec-test-report.html" + +usage() { + cat < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/testing/xspec-basic.xspec b/support/xspec-dev/testing/xspec-basic.xspec new file mode 100644 index 00000000..bdccf48c --- /dev/null +++ b/support/xspec-dev/testing/xspec-basic.xspec @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/testing/xspec-shell.xspec b/support/xspec-dev/testing/xspec-shell.xspec new file mode 100644 index 00000000..ba66430f --- /dev/null +++ b/support/xspec-dev/testing/xspec-shell.xspec @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/testing/xspec-test-batch.xpl b/support/xspec-dev/testing/xspec-test-batch.xpl new file mode 100644 index 00000000..2b25a22f --- /dev/null +++ b/support/xspec-dev/testing/xspec-test-batch.xpl @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/xspec-assurance.sch b/support/xspec-dev/xspec-assurance.sch new file mode 100644 index 00000000..42c624c2 --- /dev/null +++ b/support/xspec-dev/xspec-assurance.sch @@ -0,0 +1,13 @@ + + + + + + + + No document found at + + + + \ No newline at end of file diff --git a/support/xspec-dev/xspec-batch-report.xpl b/support/xspec-dev/xspec-batch-report.xpl new file mode 100644 index 00000000..abd9ea5d --- /dev/null +++ b/support/xspec-dev/xspec-batch-report.xpl @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/xspec-mx-html-report.xsl b/support/xspec-dev/xspec-mx-html-report.xsl new file mode 100644 index 00000000..a817368b --- /dev/null +++ b/support/xspec-dev/xspec-mx-html-report.xsl @@ -0,0 +1,538 @@ + + + + + + + + + clean + + + + + + + + + + + + + + XSpec - { $result-count } { if ($result-count eq 1) then 'test' else 'tests'} in { $report-count } { if ($report-count eq 1) then 'report' else 'reports'} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • FAILING + + { ancestor-or-self::*/x:label => string-join(' - ') } +
  • +
    + + +
    +
    + +
    +

    XSpec Report - { @xspec/replace(.,'.*/','') }

    + +
    +
    + + + +
    + + XSpec Report - { @xspec/replace(.,'.*/','') } + +
    + +
    + +
    +
    + + + + + +
    + +
    +
    + +
    + + + + + + +
    + +
    +
    + + + + + + + + + + 🤞 + + + 👍 + + + 👎 + + + + +

    { local-name(..) }/{ local-name(.) }: { . }

    +
    + + + + +

    { local-name(..) }/{ local-name(.) }: { . }

    +
    + + +

    { local-name(..) }/{ local-name(.) }: { format-dateTime(xs:dateTime(.),'[MNn] [D1], [Y0001] [H01]:[m01]:[s01]') } ({.})

    +
    + + + + + +
    + + + open + + + + +
    + +
    +
    +
    + + + + + { $whose/ancestor::x:report ! ('report' || count(.|preceding-sibling::x:report || '-' )) }{ $whose/@id } + + + + + + + + + + { self::x:report/'Total tests '}{ child::x:label } +   + + + + + + + + + + + + { . } + : + + + + + + + + + { child::x:label } +   + + + { (child::x:test/@pending/('Pending ' || .),child::x:test[@successful='true']/'Passes','Fails')[1] } + + + + + Expecting { child::x:label } + + + +
    + + + +
    +
    + + +
    + + + + + +
    +
    + + +

    Expecting (testing against)

    +
    + + +

    Producing (actual result)

    +
    + + + + + + + + + +
    + +
    +
    + + +
    + +
    +
    + + + + + +

    From input

    +
    + + + +

    Expecting

    +
    + + + + + + +
    + + + +
    +
    + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +.uswds { + background-color: #f0f0f0; + + .label { background-color: #1a4480; color: white} + .pending .label { background-color: inherit; color: black } + .passing { background-color: #d9e8f6 } + .pending { background-color: white } + .failing { background-color: #f8dfe2 } + .failing .passing { background-color: #d9e8f6 } + .pending.zero, .failing.zero { background-color: inherit } +} + + + + + + + +.classic { + h1, .h1, .label { background-color: #606; color: #6f6 } + h1 { padding: 0.2em } + .pending .label { background-color: inherit; color: black } + .passing { background-color: #cfc } + .pending { background-color: #eee } + .failing { background-color: #fcc } + .failing .passing { background-color: #cfc } + .pending.zero, .failing.zero { background-color: inherit } +} + + + + + +.toybox { + .label { background-color: black; color: white } + .failing .label { background-color: darkred } + .passing .label { background-color: darkgreen } + .pending .label { background-color: inherit; color: black } + .passing { background-color: honeydew } + .pending { background-color: cornsilk } + .failing { background-color: mistyrose } + .failing .passing { background-color: honeydew } + .pending.zero, .failing.zero { background-color: inherit } +} + + + + + No template for theme '{ $theme }' - using 'simple' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/support/xspec-dev/xspec-single-report.xpl b/support/xspec-dev/xspec-single-report.xpl new file mode 100644 index 00000000..a847de3b --- /dev/null +++ b/support/xspec-dev/xspec-single-report.xpl @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/xspec-single-xspec-repo-report.xpl b/support/xspec-dev/xspec-single-xspec-repo-report.xpl new file mode 100644 index 00000000..402b1557 --- /dev/null +++ b/support/xspec-dev/xspec-single-xspec-repo-report.xpl @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/xspec-dev/xspec-summarize.xsl b/support/xspec-dev/xspec-summarize.xsl new file mode 100644 index 00000000..451f8d5e --- /dev/null +++ b/support/xspec-dev/xspec-summarize.xsl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + { @xspec } + { @stylesheet } + + + + + + { ancestor-or-self::*/child::label => string-join(' : ') } + + + + + \ No newline at end of file diff --git a/support/xspec-dev/xspec-summary-reduce.xsl b/support/xspec-dev/xspec-summary-reduce.xsl new file mode 100644 index 00000000..fc0f3251 --- /dev/null +++ b/support/xspec-dev/xspec-summary-reduce.xsl @@ -0,0 +1,72 @@ + + + + + + + + XSpec summary report: { mx:enumerate('XSpec',count(report)) } + + { (1 to 20) ! '--- ' } + + + + + + SUCCESS - { mx:give-report-counts(.) } - NO FAILURES REPORTED + + + + + + FAILURE - { mx:give-report-counts(.) } - { count(descendant::fail) } { mx:pluralize('FAILURE',count(descendant::fail)) } REPORTED + + + + + + { xspec-file ! tokenize(.,'/')[last()] } testing { xslt-file ! tokenize(.,'/')[last()] }: { mx:enumerate('test',@test-count) }, { @pending-count} pending, { mx:enumerate('failure',count(fail)) } + + + + + { mx:enumerate('report',count($r/report)) } with { mx:enumerate('test', sum($r/report/@test-count)) } ({ sum($r/report/@pending-count) } pending) + + + + + + + { $c } { mx:pluralize($nom,$c) } + + + + + + + + + + + + + { . }{ 's'[$plural] } + + + + + { . }{ 'S'[$plural] } + + + \ No newline at end of file