Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c4d27be

Browse files
committed
Added integration test
1 parent 22362e3 commit c4d27be

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2022 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package compile_test
17+
18+
import (
19+
"testing"
20+
21+
"github.com/arduino/arduino-cli/internal/integrationtest"
22+
"github.com/arduino/go-paths-helper"
23+
"github.com/stretchr/testify/require"
24+
)
25+
26+
func TestCompileSketchWithCxxOrCc(t *testing.T) {
27+
// See: https://github.com/arduino/arduino-cli/issues/1149
28+
29+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
30+
defer env.CleanUp()
31+
32+
// Run update-index with our test index
33+
_, _, err := cli.Run("core", "install", "arduino:avr@1.8.5")
34+
require.NoError(t, err)
35+
36+
// Prepare sketchbook and sketch
37+
sketch, err := paths.New("testdata", "sketch_with_cxx_cc").Abs()
38+
require.NoError(t, err)
39+
40+
_, _, err = cli.Run("compile", "-v", "-b", "arduino:avr:uno", sketch.String())
41+
require.NoError(t, err)
42+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
void func_in_cc();
2+
void func_in_cxx();
3+
4+
void setup() {
5+
func_in_cc();
6+
func_in_cxx();
7+
}
8+
9+
void loop() {
10+
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
void func_in_cc() {
2+
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
void func_in_cxx() {
2+
3+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /