Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
ae3881b5
Commit
ae3881b5
authored
Jul 08, 2019
by
Massimiliano Pippi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix golden files accordingly to changes to the sketch merger
parent
3d95ff4a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
12 additions
and
25 deletions
+12
-25
legacy/builder/test/prototypes_adder_test.go
legacy/builder/test/prototypes_adder_test.go
+12
-12
legacy/builder/test/sketch1/merged_sketch.txt
legacy/builder/test/sketch1/merged_sketch.txt
+0
-1
legacy/builder/test/sketch2/SketchWithIfDef.preprocessed.txt
legacy/builder/test/sketch2/SketchWithIfDef.preprocessed.txt
+0
-1
legacy/builder/test/sketch2/SketchWithIfDef.resolved.directives.txt
...lder/test/sketch2/SketchWithIfDef.resolved.directives.txt
+0
-1
legacy/builder/test/sketch3/Baladuino.preprocessed.txt
legacy/builder/test/sketch3/Baladuino.preprocessed.txt
+0
-1
legacy/builder/test/sketch4/CharWithEscapedDoubleQuote.preprocessed.txt
.../test/sketch4/CharWithEscapedDoubleQuote.preprocessed.txt
+0
-1
legacy/builder/test/sketch5/IncludeBetweenMultilineComment.preprocessed.txt
...t/sketch5/IncludeBetweenMultilineComment.preprocessed.txt
+0
-1
legacy/builder/test/sketch6/LineContinuations.preprocessed.txt
...y/builder/test/sketch6/LineContinuations.preprocessed.txt
+0
-1
legacy/builder/test/sketch7/StringWithComment.preprocessed.txt
...y/builder/test/sketch7/StringWithComment.preprocessed.txt
+0
-1
legacy/builder/test/sketch8/SketchWithStruct.preprocessed.txt
...cy/builder/test/sketch8/SketchWithStruct.preprocessed.txt
+0
-1
legacy/builder/test/sketch_with_config/sketch_with_config.preprocessed.txt
...st/sketch_with_config/sketch_with_config.preprocessed.txt
+0
-1
legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.SAM.txt
...uilder/test/sketch_with_ifdef/sketch.preprocessed.SAM.txt
+0
-1
legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.txt
...cy/builder/test/sketch_with_ifdef/sketch.preprocessed.txt
+0
-1
legacy/builder/types/context.go
legacy/builder/types/context.go
+0
-1
No files found.
legacy/builder/test/prototypes_adder_test.go
View file @
ae3881b5
...
...
@@ -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
+
"
\n
void setup();
\n
#line 46 "
+
quotedSketchLocation
+
"
\n
void loop();
\n
#line 62 "
+
quotedSketchLocation
+
"
\n
void process(BridgeClient client);
\n
#line 82 "
+
quotedSketchLocation
+
"
\n
void digitalCommand(BridgeClient client);
\n
#line 109 "
+
quotedSketchLocation
+
"
\n
void analogCommand(BridgeClient client);
\n
#line 149 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void setup();
\n
#line 17 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void setup();
\n
#line 7 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void setup();
\n
#line 2 "
+
quotedSketchLocation
+
"
\n
void loop();
\n
#line 4 "
+
quotedSketchLocation
+
"
\n
short unsigned int testInt();
\n
#line 8 "
+
quotedSketchLocation
+
"
\n
static 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
+
"
\n
void setup();
\n
#line 3 "
+
quotedSketchLocation
+
"
\n
void loop();
\n
#line 15 "
+
quotedSketchLocation
+
"
\n
int8_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
+
"
\n
void ciao();
\n
#line 10 "
+
quotedSketchLocation
+
"
\n
void setup();
\n
#line 15 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void setup();
\n
#line 10 "
+
quotedSketchLocation
+
"
\n
void loop();
\n
#line 12 "
+
quotedSketchLocation
+
"
\n
typename 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
+
"
\n
void elseBranch();
\n
#line 9 "
+
quotedSketchLocation
+
"
\n
void f1();
\n
#line 10 "
+
quotedSketchLocation
+
"
\n
void f2();
\n
#line 12 "
+
quotedSketchLocation
+
"
\n
void setup();
\n
#line 14 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void ifBranch();
\n
#line 9 "
+
quotedSketchLocation
+
"
\n
void f1();
\n
#line 10 "
+
quotedSketchLocation
+
"
\n
void f2();
\n
#line 12 "
+
quotedSketchLocation
+
"
\n
void setup();
\n
#line 14 "
+
quotedSketchLocation
+
"
\n
void 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
+
"
\n
void setup();
\n
#line 2 "
+
quotedSketchLocation
+
"
\n
void loop();
\n
#line 4 "
+
quotedSketchLocation
+
"
\n
const __FlashStringHelper* test();
\n
#line 6 "
+
quotedSketchLocation
+
"
\n
const int test3();
\n
#line 8 "
+
quotedSketchLocation
+
"
\n
volatile __FlashStringHelper* test2();
\n
#line 10 "
+
quotedSketchLocation
+
"
\n
volatile int test4();
\n
#line 1 "
+
quotedSketchLocation
+
"
\n
"
,
ctx
.
PrototypesSection
)
}
...
...
legacy/builder/test/sketch1/merged_sketch.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
void setup() {
}
...
...
legacy/builder/test/sketch2/SketchWithIfDef.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#define DEBUG 1
#define DISABLED 0
...
...
legacy/builder/test/sketch2/SketchWithIfDef.resolved.directives.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#define DEBUG 1
#define DISABLED 0
...
...
legacy/builder/test/sketch3/Baladuino.preprocessed.txt
View file @
ae3881b5
#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
...
...
legacy/builder/test/sketch4/CharWithEscapedDoubleQuote.preprocessed.txt
View file @
ae3881b5
#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
...
...
legacy/builder/test/sketch5/IncludeBetweenMultilineComment.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#include <CapacitiveSensor.h>
/*
#include <WiFi.h>
...
...
legacy/builder/test/sketch6/LineContinuations.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
const char *foo = "\
hello \
world\n";
...
...
legacy/builder/test/sketch7/StringWithComment.preprocessed.txt
View file @
ae3881b5
#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();
...
...
legacy/builder/test/sketch8/SketchWithStruct.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
/* START CODE */
struct A_NEW_TYPE {
...
...
legacy/builder/test/sketch_with_config/sketch_with_config.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#include "config.h"
#ifdef DEBUG
...
...
legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.SAM.txt
View file @
ae3881b5
#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();
...
...
legacy/builder/test/sketch_with_ifdef/sketch.preprocessed.txt
View file @
ae3881b5
#include <Arduino.h>
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#line 1 {{QuoteCppString .sketch.MainFile.Name}}
#if __SAM3X8E__
void ifBranch() {
}
...
...
legacy/builder/types/context.go
View file @
ae3881b5
...
...
@@ -86,7 +86,6 @@ type Context struct {
CTagsOutput
string
CTagsTargetFile
*
paths
.
Path
CTagsOfPreprocessedSource
[]
*
CTag
IncludeSection
string
LineOffset
int
PrototypesSection
string
PrototypesLineWhereToInsert
int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment