Skip to content

Commit ae3881b

Browse files
committed
fix golden files accordingly to changes to the sketch merger
1 parent 3d95ff4 commit ae3881b

14 files changed

+12
-25
lines changed

Diff for: legacy/builder/test/prototypes_adder_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestPrototypesAdderBridgeExample(t *testing.T) {
8383
NoError(t, err)
8484
}
8585

86-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
86+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
8787
require.Equal(t, "#line 33 "+quotedSketchLocation+"\nvoid setup();\n#line 46 "+quotedSketchLocation+"\nvoid loop();\n#line 62 "+quotedSketchLocation+"\nvoid process(BridgeClient client);\n#line 82 "+quotedSketchLocation+"\nvoid digitalCommand(BridgeClient client);\n#line 109 "+quotedSketchLocation+"\nvoid analogCommand(BridgeClient client);\n#line 149 "+quotedSketchLocation+"\nvoid modeCommand(BridgeClient client);\n#line 33 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
8888
}
8989

@@ -411,7 +411,7 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) {
411411
NoError(t, err)
412412
}
413413

414-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
414+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
415415
require.Equal(t, "#line 13 "+quotedSketchLocation+"\nvoid setup();\n#line 17 "+quotedSketchLocation+"\nvoid loop();\n#line 13 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
416416

417417
preprocessed := LoadAndInterpolate(t, filepath.Join("sketch_with_config", "sketch_with_config.preprocessed.txt"), ctx)
@@ -457,7 +457,7 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
457457
NoError(t, err)
458458
}
459459

460-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
460+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
461461
require.Equal(t, "", ctx.PrototypesSection)
462462
}
463463

@@ -500,7 +500,7 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
500500
NoError(t, err)
501501
}
502502

503-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
503+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
504504
require.Equal(t, "", ctx.PrototypesSection)
505505
}
506506

@@ -543,7 +543,7 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
543543
NoError(t, err)
544544
}
545545

546-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
546+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
547547
require.Equal(t, "#line 4 "+quotedSketchLocation+"\nvoid setup();\n#line 7 "+quotedSketchLocation+"\nvoid loop();\n#line 1 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
548548
}
549549

@@ -586,7 +586,7 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) {
586586
NoError(t, err)
587587
}
588588

589-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
589+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
590590

591591
expected := "#line 1 " + quotedSketchLocation + "\nvoid setup();\n#line 2 " + quotedSketchLocation + "\nvoid loop();\n#line 4 " + quotedSketchLocation + "\nshort unsigned int testInt();\n#line 8 " + quotedSketchLocation + "\nstatic int8_t testInline();\n#line 12 " + quotedSketchLocation + "\n__attribute__((always_inline)) uint8_t testAttribute();\n#line 1 " + quotedSketchLocation + "\n"
592592
obtained := ctx.PrototypesSection
@@ -640,7 +640,7 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) {
640640
NoError(t, err)
641641
}
642642

643-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
643+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
644644
require.Equal(t, "#line 1 "+quotedSketchLocation+"\nvoid setup();\n#line 3 "+quotedSketchLocation+"\nvoid loop();\n#line 15 "+quotedSketchLocation+"\nint8_t adalight();\n#line 1 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
645645
}
646646

@@ -683,7 +683,7 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
683683
NoError(t, err)
684684
}
685685

686-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
686+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
687687
require.Equal(t, "#line 5 "+quotedSketchLocation+"\nvoid ciao();\n#line 10 "+quotedSketchLocation+"\nvoid setup();\n#line 15 "+quotedSketchLocation+"\nvoid loop();\n#line 5 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
688688
}
689689

@@ -725,7 +725,7 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) {
725725
NoError(t, err)
726726
}
727727

728-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
728+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
729729
expected := "#line 6 " + quotedSketchLocation + "\nvoid setup();\n#line 10 " + quotedSketchLocation + "\nvoid loop();\n#line 12 " + quotedSketchLocation + "\ntypename Foo<char>::Bar func();\n#line 6 " + quotedSketchLocation + "\n"
730730
obtained := ctx.PrototypesSection
731731
// ctags based preprocessing ignores line with typename
@@ -774,7 +774,7 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) {
774774
NoError(t, err)
775775
}
776776

777-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
777+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
778778
require.Equal(t, "#line 5 "+quotedSketchLocation+"\nvoid elseBranch();\n#line 9 "+quotedSketchLocation+"\nvoid f1();\n#line 10 "+quotedSketchLocation+"\nvoid f2();\n#line 12 "+quotedSketchLocation+"\nvoid setup();\n#line 14 "+quotedSketchLocation+"\nvoid loop();\n#line 5 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
779779

780780
expectedSource := LoadAndInterpolate(t, filepath.Join("sketch_with_ifdef", "sketch.preprocessed.txt"), ctx)
@@ -820,7 +820,7 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) {
820820
NoError(t, err)
821821
}
822822

823-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
823+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
824824
require.Equal(t, "#line 2 "+quotedSketchLocation+"\nvoid ifBranch();\n#line 9 "+quotedSketchLocation+"\nvoid f1();\n#line 10 "+quotedSketchLocation+"\nvoid f2();\n#line 12 "+quotedSketchLocation+"\nvoid setup();\n#line 14 "+quotedSketchLocation+"\nvoid loop();\n#line 2 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
825825

826826
expectedSource := LoadAndInterpolate(t, filepath.Join("sketch_with_ifdef", "sketch.preprocessed.SAM.txt"), ctx)
@@ -866,7 +866,7 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
866866
NoError(t, err)
867867
}
868868

869-
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
869+
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
870870
require.Equal(t, "#line 1 "+quotedSketchLocation+"\nvoid setup();\n#line 2 "+quotedSketchLocation+"\nvoid loop();\n#line 4 "+quotedSketchLocation+"\nconst __FlashStringHelper* test();\n#line 6 "+quotedSketchLocation+"\nconst int test3();\n#line 8 "+quotedSketchLocation+"\nvolatile __FlashStringHelper* test2();\n#line 10 "+quotedSketchLocation+"\nvolatile int test4();\n#line 1 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
871871
}
872872

Diff for: legacy/builder/test/sketch1/merged_sketch.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
void setup() {
54

65
}

Diff for: legacy/builder/test/sketch2/SketchWithIfDef.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#define DEBUG 1
54
#define DISABLED 0
65

Diff for: legacy/builder/test/sketch2/SketchWithIfDef.resolved.directives.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#define DEBUG 1
54
#define DISABLED 0
65

Diff for: legacy/builder/test/sketch3/Baladuino.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
/*
54
* The code is released under the GNU General Public License.
65
* Developed by Kristian Lauszus, TKJ Electronics 2013

Diff for: legacy/builder/test/sketch4/CharWithEscapedDoubleQuote.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#include <SoftwareSerial.h> // required to send and receive AT commands from the GPRS Shield
54
#include <Wire.h> // required for I2C communication with the RTC
65

Diff for: legacy/builder/test/sketch5/IncludeBetweenMultilineComment.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#include <CapacitiveSensor.h>
54
/*
65
#include <WiFi.h>

Diff for: legacy/builder/test/sketch6/LineContinuations.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
const char *foo = "\
54
hello \
65
world\n";

Diff for: legacy/builder/test/sketch7/StringWithComment.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
33
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
4-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
54
void setup();
65
#line 10 {{QuoteCppString .sketch.MainFile.Name}}
76
void loop();

Diff for: legacy/builder/test/sketch8/SketchWithStruct.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
/* START CODE */
54

65
struct A_NEW_TYPE {

Diff for: legacy/builder/test/sketch_with_config/sketch_with_config.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#include "config.h"
54

65
#ifdef DEBUG

Diff for: legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.SAM.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#if __SAM3X8E__
54
#line 2 {{QuoteCppString .sketch.MainFile.Name}}
65
void ifBranch();

Diff for: legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <Arduino.h>
22
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
3-
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
43
#if __SAM3X8E__
54
void ifBranch() {
65
}

Diff for: legacy/builder/types/context.go

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ type Context struct {
8686
CTagsOutput string
8787
CTagsTargetFile *paths.Path
8888
CTagsOfPreprocessedSource []*CTag
89-
IncludeSection string
9089
LineOffset int
9190
PrototypesSection string
9291
PrototypesLineWhereToInsert int

0 commit comments

Comments
 (0)