Commit ae3881b5 authored by Massimiliano Pippi's avatar Massimiliano Pippi

fix golden files accordingly to changes to the sketch merger

parent 3d95ff4a
......@@ -83,7 +83,7 @@ func TestPrototypesAdderBridgeExample(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
}
......@@ -411,7 +411,7 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
require.Equal(t, "#line 13 "+quotedSketchLocation+"\nvoid setup();\n#line 17 "+quotedSketchLocation+"\nvoid loop();\n#line 13 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
preprocessed := LoadAndInterpolate(t, filepath.Join("sketch_with_config", "sketch_with_config.preprocessed.txt"), ctx)
......@@ -457,7 +457,7 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
require.Equal(t, "", ctx.PrototypesSection)
}
......@@ -500,7 +500,7 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
require.Equal(t, "", ctx.PrototypesSection)
}
......@@ -543,7 +543,7 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
require.Equal(t, "#line 4 "+quotedSketchLocation+"\nvoid setup();\n#line 7 "+quotedSketchLocation+"\nvoid loop();\n#line 1 "+quotedSketchLocation+"\n", ctx.PrototypesSection)
}
......@@ -586,7 +586,7 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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"
obtained := ctx.PrototypesSection
......@@ -640,7 +640,7 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
}
......@@ -683,7 +683,7 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
}
......@@ -725,7 +725,7 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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"
obtained := ctx.PrototypesSection
// ctags based preprocessing ignores line with typename
......@@ -774,7 +774,7 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
expectedSource := LoadAndInterpolate(t, filepath.Join("sketch_with_ifdef", "sketch.preprocessed.txt"), ctx)
......@@ -820,7 +820,7 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
expectedSource := LoadAndInterpolate(t, filepath.Join("sketch_with_ifdef", "sketch.preprocessed.SAM.txt"), ctx)
......@@ -866,7 +866,7 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
NoError(t, err)
}
require.Equal(t, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n", ctx.IncludeSection)
require.Contains(t, ctx.Source, "#include <Arduino.h>\n#line 1 "+quotedSketchLocation+"\n")
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)
}
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
void setup() {
}
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#define DEBUG 1
#define DISABLED 0
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#define DEBUG 1
#define DISABLED 0
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
/*
* The code is released under the GNU General Public License.
* Developed by Kristian Lauszus, TKJ Electronics 2013
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#include <SoftwareSerial.h> // required to send and receive AT commands from the GPRS Shield
#include <Wire.h> // required for I2C communication with the RTC
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#include <CapacitiveSensor.h>
/*
#include <WiFi.h>
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
const char *foo = "\
hello \
world\n";
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
void setup();
#line 10 {{QuoteCppString .sketch.MainFile.Name}}
void loop();
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
/* START CODE */
struct A_NEW_TYPE {
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#include "config.h"
#ifdef DEBUG
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#if __SAM3X8E__
#line 2 {{QuoteCppString .sketch.MainFile.Name}}
void ifBranch();
......
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#if __SAM3X8E__
void ifBranch() {
}
......
......@@ -86,7 +86,6 @@ type Context struct {
CTagsOutput string
CTagsTargetFile *paths.Path
CTagsOfPreprocessedSource []*CTag
IncludeSection string
LineOffset int
PrototypesSection string
PrototypesLineWhereToInsert int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment