From b9eaca9a3a2ffc9b3fd734078f8dfe6360adc277 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 12:49:18 -0400 Subject: [PATCH 1/7] First draft of testing approach with current WIP prune phase transform. --- .../metaschema-prune-unused-definitions.xspec | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec diff --git a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec new file mode 100644 index 000000000..a1a77437b --- /dev/null +++ b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec @@ -0,0 +1,43 @@ + + + + + + + + + BOX + Just a box, no relationship to anything else. + BOX + + + + + + + + + + BOX + Just a box, no relationship to anything else. + BOX + + + Folder + One or more folders belong in a box. + + + + + + + + + From eeeb60ac2516ead40fe321c7523f9b54f91fef7b Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 13:07:08 -0400 Subject: [PATCH 2/7] Woops, maybe that is the real issue with a test. --- .../testing/metaschema-prune-unused-definitions.xspec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec index a1a77437b..fbd780be4 100644 --- a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec +++ b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec @@ -18,7 +18,7 @@ + test="count($x:result//m:EXCEPTION) = 0"/> @@ -27,6 +27,9 @@ BOX Just a box, no relationship to anything else. BOX + + + Folder @@ -36,7 +39,7 @@ + test="count($x:result//m:EXCEPTION) = 0"/> From 578ac9162f088bd30f6c9dcd50fc8dc66fb7137e Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 13:34:04 -0400 Subject: [PATCH 3/7] Update tests after pairing with Wendell. --- .../metaschema-prune-unused-definitions.xspec | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec index fbd780be4..92da3dc4a 100644 --- a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec +++ b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec @@ -18,9 +18,9 @@ + test="$x:result//m:EXCEPTION => empty()"/> - + @@ -28,18 +28,36 @@ Just a box, no relationship to anything else. BOX - + Folder One or more folders belong in a box. - + test="$x:result//m:EXCEPTION => empty()"/> + + + + + pruning003 + + BOX + Just a box, no relationship to anything else. + BOX + + + + Folder + One or more folders belong in a box. + + + + From 14f31582687e6c75b0b9819d1223cd8cadbddc6e Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 18:24:41 -0400 Subject: [PATCH 4/7] Fix tests to align with Wendell exception msg check. --- .../metaschema-prune-unused-definitions.xspec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec index 92da3dc4a..ff15d075c 100644 --- a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec +++ b/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec @@ -1,5 +1,6 @@ - + BOX Just a box, no relationship to anything else. @@ -22,7 +23,7 @@ - + BOX Just a box, no relationship to anything else. @@ -42,8 +43,7 @@ - - pruning003 + BOX Just a box, no relationship to anything else. @@ -56,8 +56,12 @@ - + + + From 8454f0096572b8c87cddc23d99051b7e20714595 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 18:29:13 -0400 Subject: [PATCH 5/7] Move pruning tests back to their own folder. --- .../{ => 4_pruning}/metaschema-prune-unused-definitions.xspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename toolchains/xslt-M4/compose/testing/{ => 4_pruning}/metaschema-prune-unused-definitions.xspec (100%) diff --git a/toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec similarity index 100% rename from toolchains/xslt-M4/compose/testing/metaschema-prune-unused-definitions.xspec rename to toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec From 098143c4829a3dc08369ce4629855c30cdf9657a Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Thu, 7 Apr 2022 18:38:26 -0400 Subject: [PATCH 6/7] Refactor test input XML docs into separate files Make the tests more reusable across implementations. --- .../metaschema-prune-unused-definitions.xspec | 44 ++----------------- .../compose/testing/4_pruning/pruning001.xml | 9 ++++ .../compose/testing/4_pruning/pruning002.xml | 16 +++++++ .../compose/testing/4_pruning/pruning003.xml | 14 ++++++ 4 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 toolchains/xslt-M4/compose/testing/4_pruning/pruning001.xml create mode 100644 toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml create mode 100644 toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec index ff15d075c..9940ee04b 100644 --- a/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec +++ b/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec @@ -4,58 +4,22 @@ xmlns:x="http://www.jenitennison.com/xslt/xspec" xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0" xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0" - stylesheet="../metaschema-prune-unused-definitions.xsl" + stylesheet="../../metaschema-prune-unused-definitions.xsl" run-as="external"> - - - - BOX - Just a box, no relationship to anything else. - BOX - - - + - - - - BOX - Just a box, no relationship to anything else. - BOX - - - - - - Folder - One or more folders belong in a box. - - - + - - - - BOX - Just a box, no relationship to anything else. - BOX - - - - Folder - One or more folders belong in a box. - - - + + + + BOX + Just a box, no relationship to anything else. + BOX + + \ No newline at end of file diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml b/toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml new file mode 100644 index 000000000..b12282240 --- /dev/null +++ b/toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml @@ -0,0 +1,16 @@ + + + + BOX + Just a box, no relationship to anything else. + BOX + + + + + + Folder + One or more folders belong in a box. + + \ No newline at end of file diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml b/toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml new file mode 100644 index 000000000..5d86d8432 --- /dev/null +++ b/toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml @@ -0,0 +1,14 @@ + + + + BOX + Just a box, no relationship to anything else. + BOX + + + + Folder + One or more folders belong in a box. + + \ No newline at end of file From 28a830b5205c3f91a86b852651387dd2f8c22f0d Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Fri, 8 Apr 2022 15:27:41 -0400 Subject: [PATCH 7/7] Relocate input files to subdir per convo with @wendellpiez. --- .../compose/testing/4_pruning/{ => input}/pruning001.xml | 0 .../compose/testing/4_pruning/{ => input}/pruning002.xml | 0 .../compose/testing/4_pruning/{ => input}/pruning003.xml | 0 .../4_pruning/metaschema-prune-unused-definitions.xspec | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename toolchains/xslt-M4/compose/testing/4_pruning/{ => input}/pruning001.xml (100%) rename toolchains/xslt-M4/compose/testing/4_pruning/{ => input}/pruning002.xml (100%) rename toolchains/xslt-M4/compose/testing/4_pruning/{ => input}/pruning003.xml (100%) diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/pruning001.xml b/toolchains/xslt-M4/compose/testing/4_pruning/input/pruning001.xml similarity index 100% rename from toolchains/xslt-M4/compose/testing/4_pruning/pruning001.xml rename to toolchains/xslt-M4/compose/testing/4_pruning/input/pruning001.xml diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml b/toolchains/xslt-M4/compose/testing/4_pruning/input/pruning002.xml similarity index 100% rename from toolchains/xslt-M4/compose/testing/4_pruning/pruning002.xml rename to toolchains/xslt-M4/compose/testing/4_pruning/input/pruning002.xml diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml b/toolchains/xslt-M4/compose/testing/4_pruning/input/pruning003.xml similarity index 100% rename from toolchains/xslt-M4/compose/testing/4_pruning/pruning003.xml rename to toolchains/xslt-M4/compose/testing/4_pruning/input/pruning003.xml diff --git a/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec b/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec index 9940ee04b..662ff934b 100644 --- a/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec +++ b/toolchains/xslt-M4/compose/testing/4_pruning/metaschema-prune-unused-definitions.xspec @@ -9,17 +9,17 @@ - + - + - +