Skip to content
Snippets Groups Projects

Resolve "Create guides for contributing"

Merged René Schöne requested to merge 21-create-guides-for-contributing into master
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
+ 5
5
@@ -8,22 +8,22 @@ Once done (and new tests are written to ensure, a bug is really fixed, and the f
A test usually defines a grammar, optionally some attributes and a Test class.
It then normally runs RelAST followed by JastAdd.
To create a new test, the following four ingredients are needed:
To create a new test, the following four ingredients are involved:
## Specification
Here, the grammar and attributes to be compiled are contained.
Use `src/test/jastadd/$YourTestName` as directory to put your files into.
All generated `*.ast`, `*.jrag` and `ResolverStubs.jrag` are already ignored by the main `.gitignore`.
All generated `*.ast`, `*.jadd` and `ResolverStubs.jrag` are already ignored by the main `.gitignore`.
## Generated files
## Generated Java files
Usually, all files are generated into a separate directory in `src/test/java-gen/`.
This location can be [configured](#build-configuration).
## Build configuration
Currently, test setup is configured within the `build.gradle` using a specialized Gradle task `RelastTest`.
Currently, the test setup is configured within `build.gradle` using a specialized Gradle task `RelastTest`.
An example configuration might look like:
```groovy
@@ -71,7 +71,7 @@ Furthermore, empty lines, lines starting with `//` and the order of the error me
## Output diff
Currently, there is one test to test whether the output of RelAST is a valid input for RelAST and produces the same output again.
To achieve this, there two Gradle tasks. The first produces the usual `.ast` and `.jadd` files, whereas the second task takes the `.ast` as input.
To achieve this, there are two Gradle tasks. The first produces the usual `.ast` and `.jadd` files, whereas the second task takes the `.ast` as input.
The test then ensures, that both output grammars are identical.
# Publishing
Loading