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

Porting legacy tests to new integration-test infra (part 4...) #2315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
cmaglie merged 19 commits into master from refactor_legacy_test_part4
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
40f0110
ported SketchThatIncludesArduinoH from legacy into integration test
alessio-perugini Sep 13, 2023
380bd2b
ported SketchWithStaticAsserts from legacy into integration test
alessio-perugini Sep 13, 2023
010ec16
ported SketchWithEnumClass from legacy into integration test
alessio-perugini Sep 13, 2023
2213a52
ported SketchWithExternC from legacy into integration test
alessio-perugini Sep 13, 2023
90cbaa3
ported testBuilderSketchWithMultilinePrototypes from legacy into inte...
alessio-perugini Sep 13, 2023
7126d9b
ported SketchWithExternCMultiline from legacy into integration test
alessio-perugini Sep 13, 2023
257f146
ported SketchWithMultilineTemplate from legacy into integration test
alessio-perugini Sep 13, 2023
c9c8e3c
ported SketchWithFakeFunctionPointer from legacy into integration test
alessio-perugini Sep 13, 2023
6f6822f
fix wrong templating
alessio-perugini Sep 13, 2023
09d6e20
ported SketchWithMinMaxDefinitions from legacy into integration test
alessio-perugini Sep 13, 2023
da31148
ported SketchWithFastledsLibrary from legacy into integration test
alessio-perugini Sep 13, 2023
66394be
ported sketch with merged sketch and bootloader from legacy into inte...
alessio-perugini Sep 13, 2023
3be02a5
temporary disable legacy test, before porting them to the new infra
alessio-perugini Sep 13, 2023
74de390
update .gitignore
alessio-perugini Sep 14, 2023
7e99332
ported CheckBuildOptionsFile from legacy into integration test
alessio-perugini Sep 14, 2023
6e358dc
ported SketchClassFunction from legacy into integration test
alessio-perugini Sep 14, 2023
26c9c95
ported SketchThatChecksIfSPIHasTransactionsAndIncludesMissingEthernet...
alessio-perugini Sep 14, 2023
0bf2756
remove legacy builder test folder
alessio-perugini Sep 14, 2023
1a6d693
remove unsued fields from context
alessio-perugini Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ported SketchWithStaticAsserts from legacy into integration test
  • Loading branch information
alessio-perugini authored and cmaglie committed Sep 15, 2023
commit 380bd2b7155dda6eebab7c85a0c9585fef84dffc
18 changes: 17 additions & 1 deletion internal/integrationtest/compile_4/compile_test.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ func TestCompileOfProblematicSketches(t *testing.T) {
{"SketchThatChecksIfSPIHasTransactions", tryBuildAvrLeonardo},
{"SketchWithDependendLibraries", tryBuildAvrLeonardo},
{"SketchWithFunctionPointer", tryBuildAvrLeonardo},
{"SketchThatIncludesArduinoH", testBuilderSketchThatIncludesArduinoH},
{"USBHostExample", testBuilderUSBHostExample},
{"SketchWithConflictingLibraries", testBuilderSketchWithConflictingLibraries},
{"SketchLibraryProvidesAllIncludes", testBuilderSketchLibraryProvidesAllIncludes},
{"UserHardware", testBuilderWithUserHardware},
{"SketchThatIncludesArduinoH", testBuilderSketchThatIncludesArduinoH},
{"SketchWithStaticAsserts", testBuilderSketchWithStaticAsserts},
}.Run(t, env, cli)
}

Expand Down Expand Up @@ -629,6 +630,21 @@ func testBuilderSketchThatIncludesArduinoH(t *testing.T, env *integrationtest.En
})
}

func testBuilderSketchWithStaticAsserts(t *testing.T, env *integrationtest.Environment, cli *integrationtest.ArduinoCLI) {
t.Run("Build", func(t *testing.T) {
// Build
_, err := tryBuild(t, env, cli, "arduino:avr:leonardo")
require.NoError(t, err)
})

t.Run("Preprocess", func(t *testing.T) {
// Preprocess
sketchPath, preprocessedSketch, err := tryPreprocess(t, env, cli, "arduino:avr:leonardo")
require.NoError(t, err)
comparePreprocessGoldenFile(t, sketchPath, preprocessedSketch)
})
}

type builderOutput struct {
CompilerOut string `json:"compiler_out"`
CompilerErr string `json:"compiler_err"`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include <Arduino.h>
#line 1 {{QuoteCppString .sketchMainFile}}
// https://github.com/arduino/arduino-builder/issues/68

const int a = 10;
const int b = 20;

static_assert(a < b, "bar");

#line 8 {{QuoteCppString .sketchMainFile}}
void setup();
#line 12 {{QuoteCppString .sketchMainFile}}
void loop();
#line 15 {{QuoteCppString .sketchMainFile}}
void test();
#line 8 {{QuoteCppString .sketchMainFile}}
void setup() {
test();
}

void loop() {
}

void test() {
}

4 changes: 0 additions & 4 deletions legacy/builder/test/try_build_of_problematic_sketch_test.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import (

// TODO add them in the compile_4

func TestTryBuild034(t *testing.T) {
tryBuild(t, paths.New("sketch_with_static_asserts", "sketch_with_static_asserts.ino"))
}

func TestTryBuild035(t *testing.T) {
tryBuild(t, paths.New("sketch_with_enum_class", "sketch_with_enum_class.ino"))
}
Expand Down

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