Skip to content

Commit 01e4dfe

Browse files
committed
Add test to ensure the generator is up to date
1 parent ea4b5bf commit 01e4dfe

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

src/BaselineOfMoosePy/BaselineOfMoosePy.class.st

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@ BaselineOfMoosePy >> baseline: spec [
1010

1111
<baseline>
1212
spec for: #common do: [
13-
self
14-
gitBridge: spec;
15-
treeSitterFamixIntegration: spec.
13+
self
14+
gitBridge: spec;
15+
treeSitterFamixIntegration: spec.
1616

17-
spec
18-
package: 'Famix-Python-Entities';
19-
package: 'Famix-Python-Generator';
20-
package: 'Famix-Python-Importer' with: [ spec requires: #( 'Famix-Python-Entities' 'TreeSitterFamixIntegration') ];
21-
package: 'Famix-Python-Importer-Tests' with: [ spec requires: #( 'Famix-Python-Importer' 'GitBridge' ) ].
17+
spec
18+
package: 'Famix-Python-Entities';
19+
package: 'Famix-Python-Generator';
20+
package: 'Famix-Python-Tests' with: [ spec requires: #( 'Famix-Python-Entities' 'Famix-Python-Generator' ) ];
21+
package: 'Famix-Python-Importer' with: [ spec requires: #( 'Famix-Python-Entities' 'TreeSitterFamixIntegration' ) ];
22+
package: 'Famix-Python-Importer-Tests' with: [ spec requires: #( 'Famix-Python-Importer' 'GitBridge' ) ].
2223

23-
spec
24-
group: 'Core' with: #( 'Famix-Python-Entities' 'Famix-Python-Importer' 'Famix-Python-Importer-Tests' );
25-
group: 'Generator' with: #( 'Core' 'Famix-Python-Generator' ) ].
24+
spec
25+
group: 'Core' with: #( 'Famix-Python-Entities' 'Famix-Python-Importer' 'Famix-Python-Importer-Tests' 'Famix-Python-Tests' );
26+
group: 'Generator' with: #( 'Core' 'Famix-Python-Generator' ) ].
2627

2728
spec for: #NeedsFamix do: [
28-
spec baseline: 'Famix' with: [ spec repository: 'github://moosetechnology/Famix:development/src' ].
29-
spec
30-
package: 'Famix-Python-Entities' with: [ spec requires: #( Famix ) ];
31-
package: 'Famix-Python-Generator' with: [ spec requires: #( Famix ) ] ]
29+
spec baseline: 'Famix' with: [ spec repository: 'github://moosetechnology/Famix:development/src' ].
30+
spec
31+
package: 'Famix-Python-Entities' with: [ spec requires: #( Famix ) ];
32+
package: 'Famix-Python-Generator' with: [ spec requires: #( Famix ) ] ]
3233
]
3334

3435
{ #category : 'accessing' }
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Class {
2+
#name : 'FamixPythonTest',
3+
#superclass : 'TestCase',
4+
#category : 'Famix-Python-Tests',
5+
#package : 'Famix-Python-Tests'
6+
}
7+
8+
{ #category : 'tests' }
9+
FamixPythonTest >> testPythonGeneratorIsUpToDate [
10+
11+
| changes |
12+
changes := FamixPythonGenerator new changesToApply.
13+
self assert: changes isEmpty description: [
14+
'The generator ' , FamixPythonGenerator asString
15+
, ' is not in sync with its meta-model. Please, regenerate your MMs with `FamixMetamodelGenerator generateAllMetamodels`. List of changes: '
16+
, changes printString ]
17+
]

src/Famix-Python-Tests/package.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package { #name : 'Famix-Python-Tests' }

0 commit comments

Comments
 (0)