Skip to content

Commit

Permalink
Test added for reading BuildProperties from ./platform.sketch.txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
phd committed Jul 23, 2018
1 parent da617a7 commit 27ab6bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/sketch_with_platform_sketch_txt/platform.sketch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
compiler.c.extra_flags = -DSKETCH_DEFINED_VALUE=1
compiler.cpp.extra_flags = -DSKETCH_DEFINED_VALUE=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef SKETCH_DEFINED_VALUE
#error SKETCH_DEFINED_VALUE was not defined in ./platform.sketch.txt
#endif

void setup() {}
void loop() {}
9 changes: 7 additions & 2 deletions test/try_build_of_problematic_sketch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
package test

import (
"github.com/arduino/arduino-builder"
"github.com/arduino/arduino-builder/types"
"os"
"path/filepath"
"testing"

"github.com/arduino/arduino-builder"
"github.com/arduino/arduino-builder/types"
)

func TestTryBuild001(t *testing.T) {
Expand Down Expand Up @@ -217,6 +218,10 @@ func TestTryBuild042(t *testing.T) {
tryBuild(t, "sketch_with_fake_function_pointer", "sketch_with_fake_function_pointer.ino")
}

func TestTryBuild043(t *testing.T) {
tryBuild(t, "sketch_with_platform_sketch_txt", "sketch_with_platform_sketch_txt.ino")
}

func makeDefaultContext(t *testing.T) *types.Context {
DownloadCoresAndToolsAndLibraries(t)

Expand Down

0 comments on commit 27ab6bc

Please sign in to comment.