Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
44981a2
Migrate TestCompileWithLibrary from test_compile_part_4.py to compile…
MatteoPologruto Sep 30, 2022
c6ea437
Migrate TestCompileWithLibraryPriority from test_compile_part_4.py to…
MatteoPologruto Sep 30, 2022
560baa3
Migrate TestRecompileWithDifferentLibrary from test_compile_part_4.py…
MatteoPologruto Sep 30, 2022
266723e
Migrate TestCompileWithConflictingLibrariesInclude from test_compile_…
MatteoPologruto Sep 30, 2022
28d1020
Migrate TestCompileWithInvalidBuildOptionJson from test_compile_part_…
MatteoPologruto Sep 30, 2022
e072c98
Migrate TestCompileWithEsp32BundledLibraries from test_compile_part_4…
MatteoPologruto Sep 30, 2022
9ca8a7b
Migrate TestCompileWithEsp8266BundledLibraries from test_compile_part…
MatteoPologruto Sep 30, 2022
116bfd9
Migrate TestGenerateCompileCommandsJsonResilience from test_compile_p…
MatteoPologruto Sep 30, 2022
53fb571
Migrate TestCompileSketchWithTppFileInclude from test_compile_part_4.…
MatteoPologruto Sep 30, 2022
bfacc80
Migrate TestCompileSketchWithIppFileInclude from test_compile_part_4.…
MatteoPologruto Sep 30, 2022
34b9f78
Migrate TestCompileWithoutUploadAndFqbn from test_compile_part_4.py t…
MatteoPologruto Sep 30, 2022
2b2f491
Migrate TestCompileNonInstalledPlatformWithWrongPackagerAndArch from …
MatteoPologruto Sep 30, 2022
79961f1
Migrate TestCompileWithKnownPlatformNotInstalled from test_compile_pa…
MatteoPologruto Sep 30, 2022
0e32825
Migrate TestCompileManuallyInstalledPlatformUsingBoardsLocalTxt from …
MatteoPologruto Oct 5, 2022
9cc05ac
Migrate TestCompileWithRelativeBuildPath from test_compile_part_4.py …
MatteoPologruto Oct 5, 2022
d145c30
Migrate TestCompileWithFakeSecureBootCore to compile_part_4_test.go a…
MatteoPologruto Oct 6, 2022
517a54e
Rearrange compile tests to share the same environment
MatteoPologruto Oct 14, 2022
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
Migrate TestGenerateCompileCommandsJsonResilience from test_compile_p…
…art_4.py to compile_part_4_test.go
  • Loading branch information
MatteoPologruto committed Nov 10, 2022
commit 116bfd91833d264154615e26a1bd59a8ab45b03f
24 changes: 24 additions & 0 deletions internal/integrationtest/compile/compile_part_4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,27 @@ func TestCompileWithEsp8266BundledLibraries(t *testing.T) {
}
require.NotContains(t, string(stdout), expectedOutput[0]+"\n"+expectedOutput[1]+"\n"+expectedOutput[2]+"\n")
}

func TestGenerateCompileCommandsJsonResilience(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

_, _, err := cli.Run("update")
require.NoError(t, err)

// check it didn't fail with esp32@2.0.1 that has a prebuild hook that must run:
// https://github.com/arduino/arduino-cli/issues/1547
url := "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
_, _, err = cli.Run("core", "update-index", "--additional-urls="+url)
require.NoError(t, err)
_, _, err = cli.Run("core", "install", "esp32:esp32@2.0.1", "--additional-urls="+url)
require.NoError(t, err)
sketchPath := cli.CopySketch("sketch_simple")
_, _, err = cli.Run("compile", "-b", "esp32:esp32:featheresp32", "--only-compilation-database", sketchPath.String())
require.NoError(t, err)

// check it didn't fail on a sketch with a missing include
sketchPath = cli.CopySketch("sketch_with_missing_include")
_, _, err = cli.Run("compile", "-b", "esp32:esp32:featheresp32", "--only-compilation-database", sketchPath.String())
require.NoError(t, err)
}
16 changes: 0 additions & 16 deletions test/test_compile_part_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ def test_compile_manually_installed_platform_using_boards_local_txt(run_command,
assert run_command(["compile", "--clean", "-b", fqbn, sketch_path])


def test_generate_compile_commands_json_resilience(run_command, data_dir, copy_sketch):
assert run_command(["update"])

# check it didn't fail with esp32@2.0.1 that has a prebuild hook that must run:
# https://github.com/arduino/arduino-cli/issues/1547
url = "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
assert run_command(["core", "update-index", f"--additional-urls={url}"])
assert run_command(["core", "install", "esp32:esp32@2.0.1", f"--additional-urls={url}"])
sketch_path = copy_sketch("sketch_simple")
assert run_command(["compile", "-b", "esp32:esp32:featheresp32", "--only-compilation-database", sketch_path])

# check it didn't fail on a sketch with a missing include
sketch_path = copy_sketch("sketch_with_missing_include")
assert run_command(["compile", "-b", "esp32:esp32:featheresp32", "--only-compilation-database", sketch_path])


def test_compile_sketch_with_tpp_file_include(run_command, copy_sketch):
assert run_command(["update"])

Expand Down