tuxji opened a new pull request, #800: URL: https://github.com/apache/daffodil/pull/800
Add TDML implementation option to Daffodil's CLI test subcommand and extend Runner API with TDMLImplementation parameter (defined by dafext.xsd) to allow running the same TDML file with any specified TDMLImplementation without having to change the TDML file. Run runtime2 TDML and Scala tests with TDMLImplementation specified through Runner API, not tunable. Also fix some inconsistencies with fill bits overlooked by a previous pull request which extended runtime2 to read and write N-bit numbers. See more detailed changelog below. DAFFODIL-2697 Util.scala: Use standard Scala idioms for getting DAFFODIL_HOME environment variable and composing environment variables. Main.scala: Import TDMLImplementation (newly defined in dafext.xsd) to tell user which TDML implementations Daffodil supports. Add TDML implementation option to CLI test subcommand. Allow default TDML implementation to be overriden by setting TDML_IMPLEMENTATION environment variable as well as by passing implementation option. Pass TDML implementation to Runner for TDML file's tests. tdml.xsd: Update names of TDML implementations to match names of TDML implementations in dafext.xsd. Change runtime2 implementation name from "daffodil-runtime2" to "daffodilC" because a TDML implementation name must be a valid identifier in both XML and Scala and you can't embed a dash within a Scala identifier. dafext.xsd: Change tdmlImplementation tunable's type from xs:string to daf:TunableTDMLImplementation (we keep tunable because it's still useful for writing TDML tests that target only one specific implementation anyway). Add TunableTDMLImplementation simple type with enumerations listing every TDML implementation Daffodil supports, which also creates a TDMLImplementation enumerated type we can import into Scala files. Change all enumerated simple types to use standard xs:token idiom instead of xs:string. PropertyGenerator.scala: Add TunableTDMLImplementation to excludedTypes to generate it properly as an enumerated type. parsers.c: Rename parse_fill_bytes to parse_fill_bits and make it read exactly N fill bits (no more, no less). parsers.h: Rename parse_fill_bytes to parse_fill_bits and rename its first parameter to correct name end_bitPos0b (not end_bytePos0b). unparsers.c: Rename unparse_fill_bytes to unparse_fill_bits and make it write exactly N fill bits (no more, no less). unparsers.h: Rename unparse_fill_bytes to unparse_fill_bits and rename its first parameter to correct name end_bitPos0b (not end_bytePos0b). CodeGenerator.scala: Use standard Scala idiom for getting CC and PATH environment variables. CodeGeneratorState.scala: Rename calls of (un)parse_fill_bytes to (un)parse_fill_bits in generated C code. ex_nums.tdml: Make comments show how to run CLI test subcommand with different TDML implementations. Update tdmlImplementation configs to use correct TDML implementation names. Add one-implementation-only error tests to demonstrate how runtime1 and runtime2 handle non-fixed values in elements with fixed attributes slightly differently depending on validation levels. nested.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. RunnerFactory.scala: Import TDMLImplementation to know which TDML implementations Daffodil supports. Extend Runner API with useTDMLImplementation parameter in first apply method, additional two-argument apply method, and base constructor to allow Scala/Java code to specify TDML implementation when constructing a Runner (only nif they choose to). Make defaultImplementationsDefaultDefault contain all TDML implementations Daffodil supports so TDML tests can remove defaultImplementations attribute unless they really need to be specific to one or two TDML implementations. TDMLRunner.scala: Import TDMLImplementation to know which TDML implementations Daffodil supports. Extend DFDLTestSuite constructor with useTDMLImplementation parameter to allow Runner API to pass TDML implementation. Modify tdmlDFDLProcessorFactory method to get TDML implementation from either parent.useTDMLImplementation or tunableObj.tdmlImplementation and match on TDMLImplementation enumerations instead of literal strings. Runtime2TDMLDFDLProcessor.scala: Don't set implementationName to "daffodil-runtime2" literal string, set it to TDMLImplementation.DaffodilC.toString to get the correct name defined in dafext.xsd instead. TestRunnerFactory.java: Pass TDMLImplementation argument to Runner constructor in test case. ISRM_green_to_orange_60000.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. ISRM_orange_to_green_60002.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. MPU_green_to_orange_60004.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. MPU_orange_to_green_60006.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. collisions.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. egress_xdcc_bw.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. ingress_xdcc_bw.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. orion.tdml: Replace tdmlImplementation configs with comments showing how to run CLI test subcommand with different TDML implementations. TestCollisions.scala: Pass TDMLImplementation.DaffodilC to Runner. TestEgressXdccBw.scala: Pass TDMLImplementation.DaffodilC to Runner. TestExNums.scala: Pass TDMLImplementation.Daffodil and TDMLImplementation.DaffodilC to two Runners to run both runtime1 and runtime2 tests side by side. TestIngressXdccBw.scala: Pass TDMLImplementation.DaffodilC to Runner. TestIsrmGreenToOrange60000.scala: Pass TDMLImplementation.DaffodilC to Runner. TestIsrmOrangeToGreen60002.scala: Pass TDMLImplementation.DaffodilC to Runner. TestMpuGreenToOrange60004.scala: Pass TDMLImplementation.DaffodilC to Runner. TestMpuOrangeToGreen60006.scala: Pass TDMLImplementation.DaffodilC to Runner. TestNested.scala: Pass TDMLImplementation.DaffodilC to Runner. TestOrion.scala: Pass TDMLImplementation.DaffodilC to Runner. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
