@@ -46,11 +46,12 @@ void givenProject() throws IOException {
46
46
it .id ("dev.gradleplugins.gradle-plugin-testing-base" );
47
47
it .id ("java-gradle-plugin" );
48
48
});
49
- buildFile .append (val ("testSuiteUnderTest " , assign (call ("testSuiteFactory.create" , string ("foo" )))));
49
+ buildFile .append (val ("_testSuiteUnderTest_ " , assign (call ("testSuiteFactory.create" , string ("foo" )))));
50
50
}
51
51
52
52
@ Test
53
53
void hasMainSourceSetAsTestedSourceSetConvention () {
54
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
54
55
buildFile .append (groovyDsl (
55
56
"testSuiteUnderTest.testedSourceSet = null" ,
56
57
"tasks.register('verify') {" ,
@@ -65,6 +66,7 @@ void hasMainSourceSetAsTestedSourceSetConvention() {
65
66
66
67
@ Test
67
68
void usesDevelPluginSourceSetAsTestedSourceSetConvention () {
69
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
68
70
buildFile .append (groovyDsl (
69
71
"gradlePlugin.pluginSourceSet(sourceSets.create('anotherMain'))" ,
70
72
"testSuiteUnderTest.testedSourceSet = null" ,
@@ -80,6 +82,7 @@ void usesDevelPluginSourceSetAsTestedSourceSetConvention() {
80
82
81
83
@ Test
82
84
void disallowChangesToSourceSetProperty () {
85
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
83
86
buildFile .append (groovyDsl (
84
87
"afterEvaluate {" ,
85
88
" testSuiteUnderTest.sourceSet = null" , // expect failure
@@ -94,6 +97,7 @@ void disallowChangesToSourceSetProperty() {
94
97
95
98
@ Test
96
99
void disallowChangesToTestedSourceSetProperty () {
100
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
97
101
buildFile .append (groovyDsl (
98
102
"afterEvaluate {" ,
99
103
" testSuiteUnderTest.testedSourceSet = null" , // expect failure
@@ -108,6 +112,7 @@ void disallowChangesToTestedSourceSetProperty() {
108
112
109
113
@ Test
110
114
void disallowChangesToTestingStrategiesProperty () {
115
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
111
116
buildFile .append (groovyDsl (
112
117
"afterEvaluate {" ,
113
118
" testSuiteUnderTest.testingStrategies = null" , // expect failure
@@ -122,6 +127,7 @@ void disallowChangesToTestingStrategiesProperty() {
122
127
123
128
@ Test
124
129
void returnsTestTasksOnTaskViewElementQuery () {
130
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
125
131
buildFile .append (groovyDsl (
126
132
"testSuiteUnderTest.with {" ,
127
133
" testingStrategies = [strategies.coverageForGradleVersion('6.8'), strategies.coverageForGradleVersion('7.1')]" ,
@@ -139,6 +145,7 @@ void returnsTestTasksOnTaskViewElementQuery() {
139
145
140
146
@ Test
141
147
void includesPluginUnderTestMetadataConfigurationDependencies () {
148
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
142
149
buildFile .append (groovyDsl (
143
150
"testSuiteUnderTest.dependencies.pluginUnderTestMetadata files('my/own/dep.jar')" ,
144
151
"" ,
@@ -154,6 +161,7 @@ void includesPluginUnderTestMetadataConfigurationDependencies() {
154
161
155
162
@ Test
156
163
void addsPluginUnderTestMetadataAsRuntimeOnlyDependency () {
164
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
157
165
buildFile .append (groovyDsl (
158
166
"tasks.register('verify') {" ,
159
167
" doLast {" ,
@@ -169,6 +177,7 @@ void addsPluginUnderTestMetadataAsRuntimeOnlyDependency() {
169
177
170
178
@ Test
171
179
void doesNotIncludesSourceSetInDevelTestSourceSets () {
180
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
172
181
buildFile .append (groovyDsl (
173
182
"tasks.register('verify') {" ,
174
183
" doLast {" ,
@@ -182,6 +191,7 @@ void doesNotIncludesSourceSetInDevelTestSourceSets() {
182
191
183
192
@ Test
184
193
void createsDefaultSourceSetOnSourceSetPropertyQueryOfConvention () {
194
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
185
195
buildFile .append (groovyDsl (
186
196
"testSuiteUnderTest.sourceSet = null // reset value to convention" ,
187
197
"assert testSuiteUnderTest.sourceSet.get().name == 'foo'" ,
@@ -195,6 +205,7 @@ void createsDefaultSourceSetOnSourceSetPropertyQueryOfConvention() {
195
205
196
206
@ Test
197
207
void createsDefaultSourceSetWhenProjectConfigured () {
208
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
198
209
buildFile .append (groovyDsl (
199
210
"tasks.register('verify') {" ,
200
211
" doLast {" ,
@@ -209,6 +220,7 @@ void createsDefaultSourceSetWhenProjectConfigured() {
209
220
210
221
@ Test
211
222
void doesNotCreateDefaultSourceSetWhenSourceSetPropertyOverridden () {
223
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
212
224
buildFile .append (groovyDsl (
213
225
"testSuiteUnderTest.sourceSet = sourceSets.create('kiel')" ,
214
226
"tasks.register('verify') {" ,
@@ -225,6 +237,7 @@ void doesNotCreateDefaultSourceSetWhenSourceSetPropertyOverridden() {
225
237
226
238
@ Test
227
239
void doesNotCreateDefaultSourceSetOnTestSuiteCreation () {
240
+ buildFile .append (val ("testSuiteUnderTest" , assign (literal ("_testSuiteUnderTest_" ))));
228
241
buildFile .append (groovyDsl (
229
242
"assert sourceSets.findByName('foo') == null : 'not yet created until sourceSet property realized'" ,
230
243
"" ,
@@ -243,7 +256,7 @@ public GradleRunner runner() {
243
256
244
257
@ Override
245
258
public ExpressionBuilder <?> testSuiteDsl () {
246
- return literal ("testSuiteUnderTest " );
259
+ return literal ("_testSuiteUnderTest_ " );
247
260
}
248
261
249
262
@ Override
0 commit comments