From e8ea3358c1b48d3094a25a27f84b85dcea637db0 Mon Sep 17 00:00:00 2001 From: Matthew James Briggs Date: Sat, 14 Nov 2020 15:59:58 -0800 Subject: [PATCH 1/3] testgen: stop copying exile tests (#65) Move existing exile test files to the input_data directory and stop copying them during test generation. This commit has some failing tests because the tests generated by xtest still exist. The tests generate by testgen do not yet have a serialization assertion when an output.xml file is present (#69). Once those assertions are generated, then the failing tests will be fully replicated by testgen and can be deleted (along with the xtest crate). --- .../{exile_e_file.rs => exile_ezfile.rs} | 4 +- exile/tests/generated/mod.rs | 2 +- ...ile_angle_in_attribute_value.metadata.json | 0 .../exile_angle_in_attribute_value.xml | 0 .../input_data/exile_cd_catalog.metadata.json | 0 .../input_data/exile_cd_catalog.output.xml | 0 ...le_disabled.comment_before_declaration.xml | 0 ...ile_disabled.difficult_nodes.metadata.json | 0 .../exile_disabled.difficult_nodes.xml | 0 .../tests/input_data/exile_disabled.note.xml | 0 .../input_data/exile_disabled.note_error.xml | 0 ...exile_disabled.pi_stray_text.metadata.json | 0 .../exile_disabled.pi_stray_text.xml | 0 .../exile_disabled.plant_catalog.xml | 0 .../exile_disabled.simple_food_menu.xml | 0 .../exile_doctypes_comments_pis.metadata.json | 0 .../input_data/exile_escapes.metadata.json | 0 .../tests/input_data/exile_escapes.output.xml | 0 .../input_data/exile_ezfile.metadata.json | 0 .../tests/input_data/exile_ezfile.output.xml | 0 .../{exile_e_file.xml => exile_ezfile.xml} | 0 .../tests/input_data/exile_pi.metadata.json | 0 .../exile_simple_musicxml.metadata.json | 0 .../exile_simple_musicxml.output.xml | 0 .../exile_single_quotes.metadata.json | 0 .../exile_unescaped_angle.metadata.json | 0 .../input_data/exile_unescaped_angle.xml | 0 testgen/entrypoint.sh | 3 +- .../xmltestgen/.idea/saveactions_settings.xml | 1 - testgen/xmltestgen/pom.xml | 5 + .../matthewjamesbriggs/xmltestgen/App.java | 2 +- .../xmltestgen/ConfTest.java | 58 ++--- .../xmltestgen/ConfTestGenerator.java | 50 ++++- .../xmltestgen/ConfTestParser.java | 58 ++--- .../xmltestgen/ExileConstants.java | 123 ++++++++++ .../xmltestgen/ExileFiles.java | 61 +++++ .../com/matthewjamesbriggs/xmltestgen/F.java | 4 - .../xmltestgen/ProgramOptions.java | 40 ++-- .../com/matthewjamesbriggs/xmltestgen/S.java | 47 ++++ .../xmltestgen/TestGenException.java | 10 + .../xmltestgen/ExileConstantsTest.java | 50 +++++ .../matthewjamesbriggs/xmltestgen/STest.java | 23 ++ xtest/data/cd_catalog.xml | 211 ------------------ xtest/data/doctypes-comments-pis.xml | 21 -- xtest/data/escapes.xml | 9 - xtest/data/ezfile.xml | 5 - xtest/data/pi.xml | 8 - xtest/data/simple_musicxml.xml | 11 - xtest/data/single_quotes.xml | 2 - 49 files changed, 417 insertions(+), 391 deletions(-) rename exile/tests/generated/{exile_e_file.rs => exile_ezfile.rs} (96%) rename xtest/data/angle-in-attribute-value.metadata.json => exile/tests/input_data/exile_angle_in_attribute_value.metadata.json (100%) rename xtest/data/angle-in-attribute-value.xml => exile/tests/input_data/exile_angle_in_attribute_value.xml (100%) rename xtest/data/cd_catalog.metadata.json => exile/tests/input_data/exile_cd_catalog.metadata.json (100%) rename xtest/data/cd_catalog.expected.xml => exile/tests/input_data/exile_cd_catalog.output.xml (100%) rename xtest/data/disabled.comment-before-declaration.xml => exile/tests/input_data/exile_disabled.comment_before_declaration.xml (100%) rename xtest/data/disabled.difficult-nodes.metadata.json => exile/tests/input_data/exile_disabled.difficult_nodes.metadata.json (100%) rename xtest/data/disabled.difficult-nodes.xml => exile/tests/input_data/exile_disabled.difficult_nodes.xml (100%) rename xtest/data/disabled.note.xml => exile/tests/input_data/exile_disabled.note.xml (100%) rename xtest/data/disabled.note_error.xml => exile/tests/input_data/exile_disabled.note_error.xml (100%) rename xtest/data/disabled.pi-stray-text.metadata.json => exile/tests/input_data/exile_disabled.pi_stray_text.metadata.json (100%) rename xtest/data/disabled.pi-stray-text.xml => exile/tests/input_data/exile_disabled.pi_stray_text.xml (100%) rename xtest/data/disabled.plant_catalog.xml => exile/tests/input_data/exile_disabled.plant_catalog.xml (100%) rename xtest/data/disabled.simple_food_menu.xml => exile/tests/input_data/exile_disabled.simple_food_menu.xml (100%) rename xtest/data/doctypes-comments-pis.metadata.json => exile/tests/input_data/exile_doctypes_comments_pis.metadata.json (100%) rename xtest/data/escapes.metadata.json => exile/tests/input_data/exile_escapes.metadata.json (100%) rename xtest/data/escapes.expected.xml => exile/tests/input_data/exile_escapes.output.xml (100%) rename xtest/data/ezfile.metadata.json => exile/tests/input_data/exile_ezfile.metadata.json (100%) rename xtest/data/ezfile.expected.xml => exile/tests/input_data/exile_ezfile.output.xml (100%) rename exile/tests/input_data/{exile_e_file.xml => exile_ezfile.xml} (100%) rename xtest/data/pi.metadata.json => exile/tests/input_data/exile_pi.metadata.json (100%) rename xtest/data/simple_musicxml.metadata.json => exile/tests/input_data/exile_simple_musicxml.metadata.json (100%) rename xtest/data/simple_musicxml.expected.xml => exile/tests/input_data/exile_simple_musicxml.output.xml (100%) rename xtest/data/single_quotes.metadata.json => exile/tests/input_data/exile_single_quotes.metadata.json (100%) rename xtest/data/unescaped-angle.metadata.json => exile/tests/input_data/exile_unescaped_angle.metadata.json (100%) rename xtest/data/unescaped-angle.xml => exile/tests/input_data/exile_unescaped_angle.xml (100%) create mode 100644 testgen/xmltestgen/src/main/java/com/matthewjamesbriggs/xmltestgen/ExileConstants.java create mode 100644 testgen/xmltestgen/src/main/java/com/matthewjamesbriggs/xmltestgen/ExileFiles.java create mode 100644 testgen/xmltestgen/src/main/java/com/matthewjamesbriggs/xmltestgen/S.java create mode 100644 testgen/xmltestgen/src/test/java/com/matthewjamesbriggs/xmltestgen/ExileConstantsTest.java create mode 100644 testgen/xmltestgen/src/test/java/com/matthewjamesbriggs/xmltestgen/STest.java delete mode 100644 xtest/data/cd_catalog.xml delete mode 100644 xtest/data/doctypes-comments-pis.xml delete mode 100644 xtest/data/escapes.xml delete mode 100644 xtest/data/ezfile.xml delete mode 100644 xtest/data/pi.xml delete mode 100644 xtest/data/simple_musicxml.xml delete mode 100644 xtest/data/single_quotes.xml diff --git a/exile/tests/generated/exile_e_file.rs b/exile/tests/generated/exile_ezfile.rs similarity index 96% rename from exile/tests/generated/exile_e_file.rs rename to exile/tests/generated/exile_ezfile.rs index f71c61e..af876a6 100644 --- a/exile/tests/generated/exile_e_file.rs +++ b/exile/tests/generated/exile_ezfile.rs @@ -8,7 +8,7 @@ use xdoc::Version; const MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); const INPUT_DATA: &str = "input_data"; -const FILENAME: &str = "exile_e_file.xml"; +const FILENAME: &str = "exile_ezfile.xml"; fn path() -> PathBuf { let p = PathBuf::from(MANIFEST_DIR) @@ -20,7 +20,7 @@ fn path() -> PathBuf { } #[test] -fn e_file() { +fn ezfile() { let path = path(); let loaded = exile::load(&path).unwrap(); let expected = expected(); diff --git a/exile/tests/generated/mod.rs b/exile/tests/generated/mod.rs index 354aacd..a186a11 100644 --- a/exile/tests/generated/mod.rs +++ b/exile/tests/generated/mod.rs @@ -2,8 +2,8 @@ mod exile_cd_catalog; mod exile_doctypes_comments_pis; -mod exile_e_file; mod exile_escapes; +mod exile_ezfile; mod exile_pi; mod exile_simple_musicxml; mod exile_single_quotes; diff --git a/xtest/data/angle-in-attribute-value.metadata.json b/exile/tests/input_data/exile_angle_in_attribute_value.metadata.json similarity index 100% rename from xtest/data/angle-in-attribute-value.metadata.json rename to exile/tests/input_data/exile_angle_in_attribute_value.metadata.json diff --git a/xtest/data/angle-in-attribute-value.xml b/exile/tests/input_data/exile_angle_in_attribute_value.xml similarity index 100% rename from xtest/data/angle-in-attribute-value.xml rename to exile/tests/input_data/exile_angle_in_attribute_value.xml diff --git a/xtest/data/cd_catalog.metadata.json b/exile/tests/input_data/exile_cd_catalog.metadata.json similarity index 100% rename from xtest/data/cd_catalog.metadata.json rename to exile/tests/input_data/exile_cd_catalog.metadata.json diff --git a/xtest/data/cd_catalog.expected.xml b/exile/tests/input_data/exile_cd_catalog.output.xml similarity index 100% rename from xtest/data/cd_catalog.expected.xml rename to exile/tests/input_data/exile_cd_catalog.output.xml diff --git a/xtest/data/disabled.comment-before-declaration.xml b/exile/tests/input_data/exile_disabled.comment_before_declaration.xml similarity index 100% rename from xtest/data/disabled.comment-before-declaration.xml rename to exile/tests/input_data/exile_disabled.comment_before_declaration.xml diff --git a/xtest/data/disabled.difficult-nodes.metadata.json b/exile/tests/input_data/exile_disabled.difficult_nodes.metadata.json similarity index 100% rename from xtest/data/disabled.difficult-nodes.metadata.json rename to exile/tests/input_data/exile_disabled.difficult_nodes.metadata.json diff --git a/xtest/data/disabled.difficult-nodes.xml b/exile/tests/input_data/exile_disabled.difficult_nodes.xml similarity index 100% rename from xtest/data/disabled.difficult-nodes.xml rename to exile/tests/input_data/exile_disabled.difficult_nodes.xml diff --git a/xtest/data/disabled.note.xml b/exile/tests/input_data/exile_disabled.note.xml similarity index 100% rename from xtest/data/disabled.note.xml rename to exile/tests/input_data/exile_disabled.note.xml diff --git a/xtest/data/disabled.note_error.xml b/exile/tests/input_data/exile_disabled.note_error.xml similarity index 100% rename from xtest/data/disabled.note_error.xml rename to exile/tests/input_data/exile_disabled.note_error.xml diff --git a/xtest/data/disabled.pi-stray-text.metadata.json b/exile/tests/input_data/exile_disabled.pi_stray_text.metadata.json similarity index 100% rename from xtest/data/disabled.pi-stray-text.metadata.json rename to exile/tests/input_data/exile_disabled.pi_stray_text.metadata.json diff --git a/xtest/data/disabled.pi-stray-text.xml b/exile/tests/input_data/exile_disabled.pi_stray_text.xml similarity index 100% rename from xtest/data/disabled.pi-stray-text.xml rename to exile/tests/input_data/exile_disabled.pi_stray_text.xml diff --git a/xtest/data/disabled.plant_catalog.xml b/exile/tests/input_data/exile_disabled.plant_catalog.xml similarity index 100% rename from xtest/data/disabled.plant_catalog.xml rename to exile/tests/input_data/exile_disabled.plant_catalog.xml diff --git a/xtest/data/disabled.simple_food_menu.xml b/exile/tests/input_data/exile_disabled.simple_food_menu.xml similarity index 100% rename from xtest/data/disabled.simple_food_menu.xml rename to exile/tests/input_data/exile_disabled.simple_food_menu.xml diff --git a/xtest/data/doctypes-comments-pis.metadata.json b/exile/tests/input_data/exile_doctypes_comments_pis.metadata.json similarity index 100% rename from xtest/data/doctypes-comments-pis.metadata.json rename to exile/tests/input_data/exile_doctypes_comments_pis.metadata.json diff --git a/xtest/data/escapes.metadata.json b/exile/tests/input_data/exile_escapes.metadata.json similarity index 100% rename from xtest/data/escapes.metadata.json rename to exile/tests/input_data/exile_escapes.metadata.json diff --git a/xtest/data/escapes.expected.xml b/exile/tests/input_data/exile_escapes.output.xml similarity index 100% rename from xtest/data/escapes.expected.xml rename to exile/tests/input_data/exile_escapes.output.xml diff --git a/xtest/data/ezfile.metadata.json b/exile/tests/input_data/exile_ezfile.metadata.json similarity index 100% rename from xtest/data/ezfile.metadata.json rename to exile/tests/input_data/exile_ezfile.metadata.json diff --git a/xtest/data/ezfile.expected.xml b/exile/tests/input_data/exile_ezfile.output.xml similarity index 100% rename from xtest/data/ezfile.expected.xml rename to exile/tests/input_data/exile_ezfile.output.xml diff --git a/exile/tests/input_data/exile_e_file.xml b/exile/tests/input_data/exile_ezfile.xml similarity index 100% rename from exile/tests/input_data/exile_e_file.xml rename to exile/tests/input_data/exile_ezfile.xml diff --git a/xtest/data/pi.metadata.json b/exile/tests/input_data/exile_pi.metadata.json similarity index 100% rename from xtest/data/pi.metadata.json rename to exile/tests/input_data/exile_pi.metadata.json diff --git a/xtest/data/simple_musicxml.metadata.json b/exile/tests/input_data/exile_simple_musicxml.metadata.json similarity index 100% rename from xtest/data/simple_musicxml.metadata.json rename to exile/tests/input_data/exile_simple_musicxml.metadata.json diff --git a/xtest/data/simple_musicxml.expected.xml b/exile/tests/input_data/exile_simple_musicxml.output.xml similarity index 100% rename from xtest/data/simple_musicxml.expected.xml rename to exile/tests/input_data/exile_simple_musicxml.output.xml diff --git a/xtest/data/single_quotes.metadata.json b/exile/tests/input_data/exile_single_quotes.metadata.json similarity index 100% rename from xtest/data/single_quotes.metadata.json rename to exile/tests/input_data/exile_single_quotes.metadata.json diff --git a/xtest/data/unescaped-angle.metadata.json b/exile/tests/input_data/exile_unescaped_angle.metadata.json similarity index 100% rename from xtest/data/unescaped-angle.metadata.json rename to exile/tests/input_data/exile_unescaped_angle.metadata.json diff --git a/xtest/data/unescaped-angle.xml b/exile/tests/input_data/exile_unescaped_angle.xml similarity index 100% rename from xtest/data/unescaped-angle.xml rename to exile/tests/input_data/exile_unescaped_angle.xml diff --git a/testgen/entrypoint.sh b/testgen/entrypoint.sh index 0661359..67abc5e 100755 --- a/testgen/entrypoint.sh +++ b/testgen/entrypoint.sh @@ -18,9 +18,8 @@ d="--custom-schema /fake" e="--xml-outdir /workspace/exile/tests" f="--schema-outdir /fake" g="--rust-root /workspace" -h="--exile-tests /workspace/xtest/data" # TODO - this will move # use maven to execute the program mvn exec:java \ -Dexec.mainClass="com.matthewjamesbriggs.xmltestgen.App" \ - -Dexec.args="${a} ${b} ${c} ${d} ${e} ${f} ${g} ${h}" + -Dexec.args="${a} ${b} ${c} ${d} ${e} ${f} ${g}" diff --git a/testgen/xmltestgen/.idea/saveactions_settings.xml b/testgen/xmltestgen/.idea/saveactions_settings.xml index 9de5690..241b920 100644 --- a/testgen/xmltestgen/.idea/saveactions_settings.xml +++ b/testgen/xmltestgen/.idea/saveactions_settings.xml @@ -24,7 +24,6 @@