Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
motion-grammar-example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
motion-grammar-example
Commits
5dbfe76b
Commit
5dbfe76b
authored
Feb 27, 2022
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
move diagram generation to test
parent
9ba558f7
No related branches found
No related tags found
No related merge requests found
Pipeline
#12785
failed
Feb 27, 2022
Stage: build
Stage: test
Stage: ragdoc
Stage: publish
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+4
-2
4 additions, 2 deletions
.gitlab-ci.yml
build.gradle
+10
-0
10 additions, 0 deletions
build.gradle
src/test/java/de/tudresden/inf/st/mg/ParserTest.java
+45
-0
45 additions, 0 deletions
src/test/java/de/tudresden/inf/st/mg/ParserTest.java
with
59 additions
and
2 deletions
.gitlab-ci.yml
+
4
−
2
View file @
5dbfe76b
...
...
@@ -16,7 +16,8 @@ build:
-
"
./gradlew
assemble"
artifacts
:
paths
:
-
"
src/gen"
-
"
src/gen/java"
-
"
src/gen/jastadd"
test
:
image
:
openjdk:11
...
...
@@ -28,6 +29,8 @@ test:
artifacts
:
reports
:
junit
:
"
*/build/test-results/test/TEST-*.xml"
paths
:
-
"
src/gen/resources"
ragdoc_build
:
image
:
...
...
@@ -68,7 +71,6 @@ pages:
stage
:
publish
needs
:
-
ragdoc_view
-
build
-
test
before_script
:
-
pip install -r pages/requirements.txt
...
...
This diff is collapsed.
Click to expand it.
build.gradle
+
10
−
0
View file @
5dbfe76b
...
...
@@ -34,6 +34,16 @@ dependencies {
jastadd2
"org.jastadd:jastadd:2.3.5"
implementation
group:
'de.tudresden.inf.st'
,
name:
'dumpAstWithPlantuml'
,
version:
'0.3.6-54'
grammar2uml
group:
'de.tudresden.inf.st'
,
name:
'grammar2uml'
,
version:
'0.2.1'
testImplementation
'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation
'org.assertj:assertj-core:3.22.0'
testRuntimeOnly
'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test
{
testLogging
{
showStandardStreams
=
true
}
useJUnitPlatform
()
}
// Default run configuration
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/tudresden/inf/st/mg/ParserTest.java
0 → 100644
+
45
−
0
View file @
5dbfe76b
package
de.tudresden.inf.st.mg
;
import
de.tudresden.inf.st.mg.common.MotionGrammarParser
;
import
de.tudresden.inf.st.mg.jastadd.model.T1
;
import
de.tudresden.inf.st.mg.jastadd.model.World
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.Test
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.Comparator
;
import
java.util.Random
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
ParserTest
{
public
static
final
Path
AST_DIAGRAM_DIR
=
Path
.
of
(
"src"
,
"gen"
,
"resources"
,
"diagrams"
,
"parsing"
);
@BeforeAll
static
void
prepareOutputPath
()
throws
IOException
{
Files
.
walk
(
AST_DIAGRAM_DIR
)
.
sorted
(
Comparator
.
reverseOrder
())
.
map
(
Path:
:
toFile
)
.
forEach
(
File:
:
delete
);
Files
.
createDirectories
(
AST_DIAGRAM_DIR
);
}
@Test
void
runParser
()
throws
MotionGrammarParser
.
ParseException
{
// for some reason, the best random seed value here is 1 and not 0???
World
world
=
World
.
initialWorld
(
new
Random
(
1
));
WorldParser
parser
=
new
WorldParser
(
world
);
var
result
=
parser
.
parseT
();
assertThat
(
result
).
isNotNull
().
isInstanceOf
(
T1
.
class
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment