@@ -48,7 +48,7 @@ func TestPrototypesAdderBridgeExample(t *testing.T) {
48
48
commands := []types.Command {
49
49
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
50
50
types .BareCommand (func (ctx * types.Context ) error {
51
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
51
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
52
52
return _err
53
53
}),
54
54
& builder.ContainerFindIncludes {},
@@ -74,7 +74,7 @@ func TestPrototypesAdderSketchWithIfDef(t *testing.T) {
74
74
commands := []types.Command {
75
75
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
76
76
types .BareCommand (func (ctx * types.Context ) error {
77
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
77
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
78
78
return _err
79
79
}),
80
80
& builder.ContainerFindIncludes {},
@@ -100,7 +100,7 @@ func TestPrototypesAdderBaladuino(t *testing.T) {
100
100
commands := []types.Command {
101
101
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
102
102
types .BareCommand (func (ctx * types.Context ) error {
103
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
103
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
104
104
return _err
105
105
}),
106
106
& builder.ContainerFindIncludes {},
@@ -126,7 +126,7 @@ func TestPrototypesAdderCharWithEscapedDoubleQuote(t *testing.T) {
126
126
commands := []types.Command {
127
127
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
128
128
types .BareCommand (func (ctx * types.Context ) error {
129
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
129
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
130
130
return _err
131
131
}),
132
132
& builder.ContainerFindIncludes {},
@@ -152,7 +152,7 @@ func TestPrototypesAdderIncludeBetweenMultilineComment(t *testing.T) {
152
152
commands := []types.Command {
153
153
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
154
154
types .BareCommand (func (ctx * types.Context ) error {
155
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
155
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
156
156
return _err
157
157
}),
158
158
& builder.ContainerFindIncludes {},
@@ -178,7 +178,7 @@ func TestPrototypesAdderLineContinuations(t *testing.T) {
178
178
commands := []types.Command {
179
179
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
180
180
types .BareCommand (func (ctx * types.Context ) error {
181
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
181
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
182
182
return _err
183
183
}),
184
184
& builder.ContainerFindIncludes {},
@@ -204,7 +204,7 @@ func TestPrototypesAdderStringWithComment(t *testing.T) {
204
204
commands := []types.Command {
205
205
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
206
206
types .BareCommand (func (ctx * types.Context ) error {
207
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
207
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
208
208
return _err
209
209
}),
210
210
& builder.ContainerFindIncludes {},
@@ -230,7 +230,7 @@ func TestPrototypesAdderSketchWithStruct(t *testing.T) {
230
230
commands := []types.Command {
231
231
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
232
232
types .BareCommand (func (ctx * types.Context ) error {
233
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
233
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
234
234
return _err
235
235
}),
236
236
& builder.ContainerFindIncludes {},
@@ -264,7 +264,7 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) {
264
264
commands := []types.Command {
265
265
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
266
266
types .BareCommand (func (ctx * types.Context ) error {
267
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
267
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
268
268
return _err
269
269
}),
270
270
& builder.ContainerFindIncludes {},
@@ -296,7 +296,7 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
296
296
commands := []types.Command {
297
297
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
298
298
types .BareCommand (func (ctx * types.Context ) error {
299
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
299
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
300
300
return _err
301
301
}),
302
302
& builder.ContainerFindIncludes {},
@@ -305,11 +305,12 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
305
305
err := command .Run (ctx )
306
306
NoError (t , err )
307
307
}
308
+ mergedSketch := loadPreprocessedSketch (t , ctx )
308
309
NoError (t , builder .PreprocessSketchWithCtags (ctx ))
309
310
310
311
preprocessedSketch := loadPreprocessedSketch (t , ctx )
311
312
require .Contains (t , preprocessedSketch , "#include <Arduino.h>\n #line 1 " + quotedSketchLocation + "\n " )
312
- require .Equal (t , ctx . SketchSourceMerged , preprocessedSketch ) // No prototypes added
313
+ require .Equal (t , mergedSketch , preprocessedSketch ) // No prototypes added
313
314
}
314
315
315
316
func TestPrototypesAdderSketchNoFunctions (t * testing.T ) {
@@ -324,7 +325,7 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
324
325
commands := []types.Command {
325
326
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
326
327
types .BareCommand (func (ctx * types.Context ) error {
327
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
328
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
328
329
return _err
329
330
}),
330
331
& builder.ContainerFindIncludes {},
@@ -333,11 +334,12 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
333
334
err := command .Run (ctx )
334
335
NoError (t , err )
335
336
}
337
+ mergedSketch := loadPreprocessedSketch (t , ctx )
336
338
NoError (t , builder .PreprocessSketchWithCtags (ctx ))
337
339
338
340
preprocessedSketch := loadPreprocessedSketch (t , ctx )
339
341
require .Contains (t , preprocessedSketch , "#include <Arduino.h>\n #line 1 " + quotedSketchLocation + "\n " )
340
- require .Equal (t , ctx . SketchSourceMerged , preprocessedSketch ) // No prototypes added
342
+ require .Equal (t , mergedSketch , preprocessedSketch ) // No prototypes added
341
343
}
342
344
343
345
func TestPrototypesAdderSketchWithDefaultArgs (t * testing.T ) {
@@ -353,7 +355,7 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
353
355
commands := []types.Command {
354
356
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
355
357
types .BareCommand (func (ctx * types.Context ) error {
356
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
358
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
357
359
return _err
358
360
}),
359
361
& builder.ContainerFindIncludes {},
@@ -382,7 +384,7 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) {
382
384
commands := []types.Command {
383
385
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
384
386
types .BareCommand (func (ctx * types.Context ) error {
385
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
387
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
386
388
return _err
387
389
}),
388
390
& builder.ContainerFindIncludes {},
@@ -422,7 +424,7 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) {
422
424
commands := []types.Command {
423
425
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
424
426
types .BareCommand (func (ctx * types.Context ) error {
425
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
427
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
426
428
return _err
427
429
}),
428
430
& builder.ContainerFindIncludes {},
@@ -456,7 +458,7 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
456
458
commands := []types.Command {
457
459
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
458
460
types .BareCommand (func (ctx * types.Context ) error {
459
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
461
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
460
462
return _err
461
463
}),
462
464
& builder.ContainerFindIncludes {},
@@ -489,7 +491,7 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) {
489
491
commands := []types.Command {
490
492
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
491
493
types .BareCommand (func (ctx * types.Context ) error {
492
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
494
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
493
495
return _err
494
496
}),
495
497
& builder.ContainerFindIncludes {},
@@ -524,7 +526,7 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) {
524
526
commands := []types.Command {
525
527
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
526
528
types .BareCommand (func (ctx * types.Context ) error {
527
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
529
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
528
530
return _err
529
531
}),
530
532
& builder.ContainerFindIncludes {},
@@ -556,7 +558,7 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) {
556
558
commands := []types.Command {
557
559
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
558
560
types .BareCommand (func (ctx * types.Context ) error {
559
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
561
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
560
562
return _err
561
563
}),
562
564
& builder.ContainerFindIncludes {},
@@ -588,7 +590,7 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
588
590
commands := []types.Command {
589
591
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
590
592
types .BareCommand (func (ctx * types.Context ) error {
591
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
593
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
592
594
return _err
593
595
}),
594
596
& builder.ContainerFindIncludes {},
@@ -614,7 +616,7 @@ func TestPrototypesAdderSketchWithDosEol(t *testing.T) {
614
616
commands := []types.Command {
615
617
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
616
618
types .BareCommand (func (ctx * types.Context ) error {
617
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
619
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
618
620
return _err
619
621
}),
620
622
& builder.ContainerFindIncludes {},
@@ -640,7 +642,7 @@ func TestPrototypesAdderSketchWithSubstringFunctionMember(t *testing.T) {
640
642
commands := []types.Command {
641
643
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
642
644
types .BareCommand (func (ctx * types.Context ) error {
643
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
645
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
644
646
return _err
645
647
}),
646
648
& builder.ContainerFindIncludes {},
0 commit comments