• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / Famix-UnitTest / 15830084211

23 Jun 2025 04:43PM UTC coverage: 25.0% (-1.5%) from 26.54%
15830084211

push

github

Gabriel-Darbord
Patch to create the ModestSuite
`ModestSuite` is the test suite containing all generated test classes
This was hardcoded in the test generator, plus allows for taking failed exports into account

0 of 7 new or added lines in 1 file covered. (0.0%)

224 existing lines in 7 files now uncovered.

615 of 2460 relevant lines covered (25.0%)

0.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.74
/src/Famix-UnitTest-Exporter/FamixUTModelMapping.class.st
1
Class {
2
        #name : 'FamixUTModelMapping',
3
        #superclass : 'FamixUTMapping',
4
        #category : 'Famix-UnitTest-Exporter-Mapping',
5
        #package : 'Famix-UnitTest-Exporter',
6
        #tag : 'Mapping'
7
}
8

9
{ #category : 'adding' }
10
FamixUTModelMapping >> addClass: aFamixUTCase [
1✔
11

1✔
12
        ^ self mapping
1✔
13
                  at: aFamixUTCase name
1✔
14
                  put: (FamixUTClassMapping on: aFamixUTCase)
1✔
15
]
1✔
16

17
{ #category : 'accessing' }
18
FamixUTModelMapping >> atClass: aFamixUTCase [
×
19

×
20
        ^ self classNamed: aFamixUTCase name
×
21
]
×
22

23
{ #category : 'accessing' }
24
FamixUTModelMapping >> atMethod: aFamixUTMethod [
×
25

×
26
        ^ (self atClass: aFamixUTMethod case) methodNamed:
×
27
                  aFamixUTMethod name
×
28
]
×
29

30
{ #category : 'accessing' }
31
FamixUTModelMapping >> classNamed: className [
×
32

×
33
        ^ self mapping at: className
×
34
]
×
35

36
{ #category : 'accessing' }
37
FamixUTModelMapping >> classes [
×
38

×
39
        ^ self mapping
×
40
]
×
41

42
{ #category : 'accessing' }
43
FamixUTModelMapping >> classesDo: aBlock [
×
44

×
45
        self mapping valuesDo: aBlock
×
46
]
×
47

48
{ #category : 'accessing' }
UNCOV
49
FamixUTModelMapping >> log [
×
UNCOV
50

×
UNCOV
51
        | classCount methodCount helperCount dict |
×
UNCOV
52
        TinyCurrentLogger value hasLoggers ifFalse: [ ^ self ].
×
UNCOV
53
        classCount := mapping size.
×
UNCOV
54
        methodCount := helperCount := 0.
×
UNCOV
55
        dict := Dictionary new: classCount.
×
UNCOV
56

×
UNCOV
57
        self classesDo: [ :classMapping |
×
UNCOV
58
                methodCount := methodCount + classMapping mapping size.
×
UNCOV
59
                classMapping methodsDo: [ :methodMapping |
×
UNCOV
60
                        helperCount := helperCount + methodMapping helpers size.
×
UNCOV
61
                        (dict
×
UNCOV
62
                                 at: classMapping model fullyQualifiedName
×
UNCOV
63
                                 at: methodMapping model testedMethod mooseName
×
UNCOV
64
                                 ifAbsentPut: [ Dictionary new ])
×
UNCOV
65
                                at: methodMapping model fullyQualifiedName
×
UNCOV
66
                                put: (methodMapping helpers values collect: [ :helper |
×
UNCOV
67
                                                 helper fullyQualifiedName ]) ] ].
×
UNCOV
68

×
UNCOV
69
        (String streamContents: [ :s |
×
UNCOV
70
                 s << 'Generated tests include '.
×
UNCOV
71
                 classCount printOn: s.
×
UNCOV
72
                 s << ' test class'.
×
UNCOV
73
                 classCount = 1 ifFalse: [ s << 'es' ].
×
UNCOV
74
                 s << ', '.
×
UNCOV
75
                 methodCount printOn: s.
×
UNCOV
76
                 s << ' test method'.
×
UNCOV
77
                 methodCount = 1 ifFalse: [ s nextPut: $s ].
×
UNCOV
78
                 s << ', '.
×
UNCOV
79
                 helperCount printOn: s.
×
UNCOV
80
                 s << ' helper'.
×
UNCOV
81
                 helperCount = 1 ifFalse: [ s nextPut: $s ].
×
UNCOV
82
                 s << '.' ]) record.
×
UNCOV
83

×
UNCOV
84
        (String streamContents: [ :s | "Test classes and covered classes should be 1:1"
×
UNCOV
85
                 | covered |
×
UNCOV
86
                 s << 'Generated tests cover '.
×
UNCOV
87
                 covered := self classes groupedBy: [ :classMapping |
×
UNCOV
88
                                    classMapping model testedClass ].
×
UNCOV
89
                 covered size printOn: s.
×
UNCOV
90
                 s << ' class'.
×
UNCOV
91
                 covered size = 1 ifFalse: [ s << 'es' ].
×
UNCOV
92
                 s << ' and '.
×
UNCOV
93
                 covered := (self classes flatCollect: [ :classMapping |
×
UNCOV
94
                                     classMapping methods ]) groupedBy: [ :methodMapping |
×
UNCOV
95
                                    methodMapping model testedMethod ].
×
UNCOV
96
                 covered size printOn: s.
×
UNCOV
97
                 s << ' method'.
×
UNCOV
98
                 covered size = 1 ifFalse: [ s nextPut: $s ].
×
UNCOV
99
                 s nextPut: $. ]) record.
×
UNCOV
100

×
UNCOV
101
        'Printing generated test structure in JSON, as testClass -> testedMethod -> testMethod -> helpers:'
×
UNCOV
102
                record.
×
UNCOV
103
        (STON toJsonString: dict) record
×
UNCOV
104
]
×
105

106
{ #category : 'removing' }
107
FamixUTModelMapping >> removeClass: aFamixUTCase [
1✔
108

1✔
109
        ^ self removeClassNamed: aFamixUTCase name
1✔
110
]
1✔
111

112
{ #category : 'removing' }
UNCOV
113
FamixUTModelMapping >> removeClassMapping: classMapping [
×
UNCOV
114

×
UNCOV
115
        ^ self removeClass: classMapping model
×
UNCOV
116
]
×
117

118
{ #category : 'removing' }
119
FamixUTModelMapping >> removeClassNamed: className [
1✔
120

1✔
121
        ^ self mapping removeKey: className
1✔
122
]
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc