Skip to content

Commit 27ab6bc

Browse files
committed
Test added for reading BuildProperties from ./platform.sketch.txt file
1 parent da617a7 commit 27ab6bc

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
compiler.c.extra_flags = -DSKETCH_DEFINED_VALUE=1
2+
compiler.cpp.extra_flags = -DSKETCH_DEFINED_VALUE=2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef SKETCH_DEFINED_VALUE
2+
#error SKETCH_DEFINED_VALUE was not defined in ./platform.sketch.txt
3+
#endif
4+
5+
void setup() {}
6+
void loop() {}

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-
"github.com/arduino/arduino-builder"
35-
"github.com/arduino/arduino-builder/types"
3634
"os"
3735
"path/filepath"
3836
"testing"
37+
38+
"github.com/arduino/arduino-builder"
39+
"github.com/arduino/arduino-builder/types"
3940
)
4041

4142
func TestTryBuild001(t *testing.T) {
@@ -217,6 +218,10 @@ func TestTryBuild042(t *testing.T) {
217218
tryBuild(t, "sketch_with_fake_function_pointer", "sketch_with_fake_function_pointer.ino")
218219
}
219220

221+
func TestTryBuild043(t *testing.T) {
222+
tryBuild(t, "sketch_with_platform_sketch_txt", "sketch_with_platform_sketch_txt.ino")
223+
}
224+
220225
func makeDefaultContext(t *testing.T) *types.Context {
221226
DownloadCoresAndToolsAndLibraries(t)
222227

0 commit comments

Comments
 (0)