Skip to content

Commit 122d39a

Browse files
committed
Added test for arduino/Arduino#5186
Signed-off-by: Cristian Maglie <[email protected]>
1 parent bdf33ac commit 122d39a

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

Diff for: src/arduino.cc/builder/test/sketch13/sketch13.ino

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
This sketch tests if the sketch folder il fully copied into the tmp folder,
3+
so it allows to include files contained in subfolders.
4+
5+
See: https://github.com/arduino/Arduino/issues/5186
6+
*/
7+
8+
#include "tests/test123.h"
9+
10+
void setup() {
11+
Serial.begin(9600);
12+
Serial.print(testvar);
13+
}
14+
15+
void loop() {
16+
}

Diff for: src/arduino.cc/builder/test/sketch13/test/test123.h

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
int testvar = 100;

Diff for: src/arduino.cc/builder/test/try_build_of_problematic_sketch_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
package test
3232

3333
import (
34-
"arduino.cc/builder"
35-
"arduino.cc/builder/types"
3634
"os"
3735
"path/filepath"
3836
"testing"
37+
38+
"arduino.cc/builder"
39+
"arduino.cc/builder/types"
3940
)
4041

4142
func TestTryBuild001(t *testing.T) {
@@ -205,6 +206,10 @@ func TestTryBuild039(t *testing.T) {
205206
tryBuildWithContext(t, ctx, "sketch12", "sketch12.ino")
206207
}
207208

209+
func TestTryBuild040(t *testing.T) {
210+
tryBuild(t, "sketch13", "sketch13.ino")
211+
}
212+
208213
func makeDefaultContext(t *testing.T) *types.Context {
209214
DownloadCoresAndToolsAndLibraries(t)
210215

0 commit comments

Comments
 (0)