@@ -57,7 +57,7 @@ func TestPrototypesAdderBridgeExample(t *testing.T) {
57
57
commands := []types.Command {
58
58
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
59
59
types .BareCommand (func (ctx * types.Context ) error {
60
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
60
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
61
61
return _err
62
62
}),
63
63
& builder.ContainerFindIncludes {},
@@ -93,7 +93,7 @@ func TestPrototypesAdderSketchWithIfDef(t *testing.T) {
93
93
commands := []types.Command {
94
94
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
95
95
types .BareCommand (func (ctx * types.Context ) error {
96
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
96
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
97
97
return _err
98
98
}),
99
99
& builder.ContainerFindIncludes {},
@@ -129,7 +129,7 @@ func TestPrototypesAdderBaladuino(t *testing.T) {
129
129
commands := []types.Command {
130
130
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
131
131
types .BareCommand (func (ctx * types.Context ) error {
132
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
132
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
133
133
return _err
134
134
}),
135
135
& builder.ContainerFindIncludes {},
@@ -165,7 +165,7 @@ func TestPrototypesAdderCharWithEscapedDoubleQuote(t *testing.T) {
165
165
commands := []types.Command {
166
166
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
167
167
types .BareCommand (func (ctx * types.Context ) error {
168
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
168
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
169
169
return _err
170
170
}),
171
171
& builder.ContainerFindIncludes {},
@@ -201,7 +201,7 @@ func TestPrototypesAdderIncludeBetweenMultilineComment(t *testing.T) {
201
201
commands := []types.Command {
202
202
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
203
203
types .BareCommand (func (ctx * types.Context ) error {
204
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
204
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
205
205
return _err
206
206
}),
207
207
& builder.ContainerFindIncludes {},
@@ -237,7 +237,7 @@ func TestPrototypesAdderLineContinuations(t *testing.T) {
237
237
commands := []types.Command {
238
238
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
239
239
types .BareCommand (func (ctx * types.Context ) error {
240
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
240
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
241
241
return _err
242
242
}),
243
243
& builder.ContainerFindIncludes {},
@@ -273,7 +273,7 @@ func TestPrototypesAdderStringWithComment(t *testing.T) {
273
273
commands := []types.Command {
274
274
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
275
275
types .BareCommand (func (ctx * types.Context ) error {
276
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
276
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
277
277
return _err
278
278
}),
279
279
& builder.ContainerFindIncludes {},
@@ -309,7 +309,7 @@ func TestPrototypesAdderSketchWithStruct(t *testing.T) {
309
309
commands := []types.Command {
310
310
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
311
311
types .BareCommand (func (ctx * types.Context ) error {
312
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
312
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
313
313
return _err
314
314
}),
315
315
& builder.ContainerFindIncludes {},
@@ -353,7 +353,7 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) {
353
353
commands := []types.Command {
354
354
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
355
355
types .BareCommand (func (ctx * types.Context ) error {
356
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
356
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
357
357
return _err
358
358
}),
359
359
& builder.ContainerFindIncludes {},
@@ -395,7 +395,7 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
395
395
commands := []types.Command {
396
396
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
397
397
types .BareCommand (func (ctx * types.Context ) error {
398
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
398
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
399
399
return _err
400
400
}),
401
401
& builder.ContainerFindIncludes {},
@@ -405,11 +405,12 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
405
405
err := command .Run (ctx )
406
406
NoError (t , err )
407
407
}
408
+ mergedSketch := loadPreprocessedSketch (t , ctx )
408
409
NoError (t , builder .PreprocessSketchWithCtags (ctx ))
409
410
410
411
preprocessedSketch := loadPreprocessedSketch (t , ctx )
411
412
require .Contains (t , preprocessedSketch , "#include <Arduino.h>\n #line 1 " + quotedSketchLocation + "\n " )
412
- require .Equal (t , ctx . SketchSourceMerged , preprocessedSketch ) // No prototypes added
413
+ require .Equal (t , mergedSketch , preprocessedSketch ) // No prototypes added
413
414
}
414
415
415
416
func TestPrototypesAdderSketchNoFunctions (t * testing.T ) {
@@ -434,7 +435,7 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
434
435
commands := []types.Command {
435
436
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
436
437
types .BareCommand (func (ctx * types.Context ) error {
437
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
438
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
438
439
return _err
439
440
}),
440
441
& builder.ContainerFindIncludes {},
@@ -444,11 +445,12 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
444
445
err := command .Run (ctx )
445
446
NoError (t , err )
446
447
}
448
+ mergedSketch := loadPreprocessedSketch (t , ctx )
447
449
NoError (t , builder .PreprocessSketchWithCtags (ctx ))
448
450
449
451
preprocessedSketch := loadPreprocessedSketch (t , ctx )
450
452
require .Contains (t , preprocessedSketch , "#include <Arduino.h>\n #line 1 " + quotedSketchLocation + "\n " )
451
- require .Equal (t , ctx . SketchSourceMerged , preprocessedSketch ) // No prototypes added
453
+ require .Equal (t , mergedSketch , preprocessedSketch ) // No prototypes added
452
454
}
453
455
454
456
func TestPrototypesAdderSketchWithDefaultArgs (t * testing.T ) {
@@ -473,7 +475,7 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
473
475
commands := []types.Command {
474
476
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
475
477
types .BareCommand (func (ctx * types.Context ) error {
476
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
478
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
477
479
return _err
478
480
}),
479
481
& builder.ContainerFindIncludes {},
@@ -512,7 +514,7 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) {
512
514
commands := []types.Command {
513
515
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
514
516
types .BareCommand (func (ctx * types.Context ) error {
515
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
517
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
516
518
return _err
517
519
}),
518
520
& builder.ContainerFindIncludes {},
@@ -562,7 +564,7 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) {
562
564
commands := []types.Command {
563
565
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
564
566
types .BareCommand (func (ctx * types.Context ) error {
565
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
567
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
566
568
return _err
567
569
}),
568
570
& builder.ContainerFindIncludes {},
@@ -601,7 +603,7 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
601
603
commands := []types.Command {
602
604
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
603
605
types .BareCommand (func (ctx * types.Context ) error {
604
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
606
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
605
607
return _err
606
608
}),
607
609
& builder.ContainerFindIncludes {},
@@ -639,7 +641,7 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) {
639
641
commands := []types.Command {
640
642
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
641
643
types .BareCommand (func (ctx * types.Context ) error {
642
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
644
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
643
645
return _err
644
646
}),
645
647
& builder.ContainerFindIncludes {},
@@ -684,7 +686,7 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) {
684
686
commands := []types.Command {
685
687
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
686
688
types .BareCommand (func (ctx * types.Context ) error {
687
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
689
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
688
690
return _err
689
691
}),
690
692
& builder.ContainerFindIncludes {},
@@ -726,7 +728,7 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) {
726
728
commands := []types.Command {
727
729
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
728
730
types .BareCommand (func (ctx * types.Context ) error {
729
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
731
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
730
732
return _err
731
733
}),
732
734
& builder.ContainerFindIncludes {},
@@ -768,7 +770,7 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
768
770
commands := []types.Command {
769
771
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
770
772
types .BareCommand (func (ctx * types.Context ) error {
771
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
773
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
772
774
return _err
773
775
}),
774
776
& builder.ContainerFindIncludes {},
@@ -804,7 +806,7 @@ func TestPrototypesAdderSketchWithDosEol(t *testing.T) {
804
806
commands := []types.Command {
805
807
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
806
808
types .BareCommand (func (ctx * types.Context ) error {
807
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
809
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
808
810
return _err
809
811
}),
810
812
& builder.ContainerFindIncludes {},
@@ -839,7 +841,7 @@ func TestPrototypesAdderSketchWithSubstringFunctionMember(t *testing.T) {
839
841
commands := []types.Command {
840
842
& builder.ContainerSetupHardwareToolsLibsSketchAndProps {},
841
843
types .BareCommand (func (ctx * types.Context ) error {
842
- ctx .LineOffset , ctx . SketchSourceMerged , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
844
+ ctx .LineOffset , _err = bldr .PrepareSketchBuildPath (ctx .Sketch , ctx .SourceOverride , ctx .SketchBuildPath )
843
845
return _err
844
846
}),
845
847
& builder.ContainerFindIncludes {},
0 commit comments