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

June 2024 Integration #118

Merged
merged 5 commits into from
Jun 7, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/converter-gen/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@ include ../testing/make_common.mk

# XML Calabash prefers absolute paths
test_metaschema:=../testing/models_metaschema.xml
output_folder:=test_output
module_path:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
output_folder:=$(module_path)/test_output

xspec_script=$(realpath $(module_path)/../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch-quiet.sh)
xspec_ci_script=$(realpath $(module_path)/../../support/xslt3-functions/xspec-dev/mvn-saxon-xspec-batch.sh)
folder=.

.PHONY: test
test: smoke-test ## Run all tests

.PHONY: smoke-test
smoke-test: ## Run all smoke-tests
smoke-test: ## Apply generators to ../testing/models_metaschema.xml metaschema
./mvn-converters-xpl.sh "$(test_metaschema)" $(output_folder) models_metaschema

.PHONY: spec-test
spec-test: ## Run all XSpec in testing folder
LOGFILE="$(output_folder)/converter-gen-xspec.log" $(xspec_ci_script) \
"folder=$(module_path)/testing/" \
"report-to=$(output_folder)/converter-gen_report.html" \
"junit-to=$(output_folder)/converter-gen_junit-report.xml" \
"stop-on-error=yes" \
"recurse=yes"

.PHONY: clean
clean: ## Remove test output
rm -fr $(output_folder)/*
65 changes: 65 additions & 0 deletions src/schema-gen/InspectorXSLT/testing/OSCAL-INSPECTOR-XSLT.xpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"
xmlns:metaschema="http://csrc.nist.gov/ns/metaschema/1.0" type="metaschema:OSCAL-INSPECTOR-XSLT"
name="OSCAL-INSPECTOR-XSLT">

<!-- Purpose: Produces an Inspector XSLT for the OSCAL Catalog metaschema -->
<!-- Input: is hard-wired to a current copy of the metaschema on Github -->
<!-- Output: Writes artifacts to the file system, in 'current' subdirectory -->

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Ports -->

<p:input port="METASCHEMA" primary="true">
<p:document
href="https://raw.githubusercontent.com/usnistgov/OSCAL/main/src/metaschema/oscal_catalog_metaschema.xml"/>
</p:input>

<p:input port="parameters" kind="parameter"/>

<!-- ports for diagnostics

<p:serialization port="OUT_inspector-xslt" indent="true" method="xml" encoding="us-ascii" omit-xml-declaration="false"/>
<p:output port="OUT_inspector-xslt">
<p:pipe port="OUT_inspector-xslt" step="produce-inspector"/>
</p:output>

<p:serialization port="OUT_inspector-xslt-PATCHED" indent="true" method="xml" encoding="us-ascii" omit-xml-declaration="false"/>
<p:output port="OUT_inspector-xslt-PATCHED" primary="true">
<p:pipe port="result" step="patch-inspector"/>
</p:output>-->


<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Import (subpipeline) -->

<p:import href="../../METASCHEMA-INSPECTOR-XSLT.xpl"/>

<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Pipeline -->

<metaschema:METASCHEMA-INSPECTOR-XSLT name="produce-inspector">
<p:with-option name="xslt-test" select="'skip'"/>
</metaschema:METASCHEMA-INSPECTOR-XSLT>

<p:store href="current/oscal-catalog_inspector-RAW.xsl" indent="true" method="xml"
encoding="us-ascii">
<p:input port="source">
<p:pipe port="OUT_inspector-xslt" step="produce-inspector"/>
</p:input>
</p:store>

<p:xslt name="patch-inspector">
<p:input port="source">
<p:pipe port="OUT_inspector-xslt" step="produce-inspector"/>
</p:input>
<p:input port="stylesheet">
<p:document href="../generator/oscal-inspector-fixup.xsl"/>
<!--<p:document href="../common/no-op.xsl"/>-->
</p:input>
</p:xslt>

<p:store href="current/oscal-catalog_inspector.xsl" indent="true" method="xml"
encoding="us-ascii"/>

</p:declare-step>
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@
</p:input>
</p:xslt>

</p:declare-step>
</p:declare-step>
Loading
Loading