Generate Drivers for Validation of Individual Modules with Bash Script

From RuleML Wiki
Jump to: navigation, search


--WikiSysop (talk) 11:25, 30 October 2015 (ADT)

1 Issue Description

In order to test the individual RNC modules for "stand-alone validity" it is necessary to create a driver that includes just the module and the intialization scripts that provide the initial definitions for global patterns that are not defined in that module. Currently this is done manually, and is subject to error if such a driver is forgotten or constructed incorrectly. The construction could be automated in a bash script by iterating through the directories that contain modules, and creating a driver file for each one. Following testing, these drivers would be deleted so they would be guaranteed to be up-to-date when tested, and would not be committed to the repository.

2 Options

2.1 Option 0

Status quo - no change.

2.2 Option 1

  1. Create a new bash script (batch_module2indep_valid.sh) that removes all files from the indep_valid directory, and then executes a for loop, similar to the existing for loop that runs over the modules in indep_valid. This for loop will instead run over the rnc files in the relaxng/modules directory. For each rnc file in the relaxng/modules directory, create a file of the same name in the indep_valid directory. Add the necessary two lines of text to that file, according to the name of the module (one "echo" command for each line).
  2. Test this script by calling it manually. There should be no change in the contents of the indep_valid directory.
  3. Add a call of this bash script to the build procedure (build_myng2rnc.sh), and test in the context of the entire build.

2.3 Option 2

Second possible change.

3 Discussion

3.1 Recommended Option

3.2 Accepted Option

Option 1

3.3 Related Issues

4 Resolution

4.1 Relax NG Modules

4.2 Relax NG Drivers

4.3 MYNG Engine

4.4 MYNG GUI

4.5 XSDs

4.6 Unit Tests

4.7 XSLTs

4.8 Bash Scripts

The file 'init_expansion_module.rnc' differs from others in the way the file only needs to include itself and not anything else. A conditional was placed to ensure that the include statement isn't made twice because of the way the 'do' loop was constructed

5 References