mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Ensure default libs are saved
This commit is contained in:
@ -20,6 +20,8 @@ PROJECT_CONFIG_TPL = """
|
|||||||
[env]
|
[env]
|
||||||
board = uno
|
board = uno
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
lib_deps =
|
||||||
|
SPI
|
||||||
|
|
||||||
[env:bare]
|
[env:bare]
|
||||||
|
|
||||||
@ -31,6 +33,7 @@ lib_deps =
|
|||||||
[env:debug]
|
[env:debug]
|
||||||
platform = platformio/atmelavr@^3.4.0
|
platform = platformio/atmelavr@^3.4.0
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
${env.lib_deps}
|
||||||
milesburton/DallasTemperature@^3.9.1
|
milesburton/DallasTemperature@^3.9.1
|
||||||
bblanchon/ArduinoJson
|
bblanchon/ArduinoJson
|
||||||
"""
|
"""
|
||||||
@ -52,12 +55,13 @@ def test_save_libraries(tmp_path):
|
|||||||
)
|
)
|
||||||
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
||||||
assert config.get("env:debug", "lib_deps") == [
|
assert config.get("env:debug", "lib_deps") == [
|
||||||
|
"SPI",
|
||||||
"bblanchon/ArduinoJson",
|
"bblanchon/ArduinoJson",
|
||||||
"milesburton/DallasTemperature@^3.9",
|
"milesburton/DallasTemperature@^3.9",
|
||||||
"adafruit/Adafruit GPS Library@^1.6.0",
|
"adafruit/Adafruit GPS Library@^1.6.0",
|
||||||
"https://github.com/nanopb/nanopb.git",
|
"https://github.com/nanopb/nanopb.git",
|
||||||
]
|
]
|
||||||
assert config.get("env:bare", "lib_deps") == []
|
assert config.get("env:bare", "lib_deps") == ["SPI"]
|
||||||
assert config.get("env:release", "lib_deps") == [
|
assert config.get("env:release", "lib_deps") == [
|
||||||
"milesburton/DallasTemperature@^3.8"
|
"milesburton/DallasTemperature@^3.8"
|
||||||
]
|
]
|
||||||
@ -66,6 +70,7 @@ def test_save_libraries(tmp_path):
|
|||||||
save_project_dependencies(str(project_dir), specs, scope="lib_deps", action="add")
|
save_project_dependencies(str(project_dir), specs, scope="lib_deps", action="add")
|
||||||
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
||||||
assert config.get("env:debug", "lib_deps") == [
|
assert config.get("env:debug", "lib_deps") == [
|
||||||
|
"SPI",
|
||||||
"bblanchon/ArduinoJson",
|
"bblanchon/ArduinoJson",
|
||||||
"milesburton/DallasTemperature@^3.9",
|
"milesburton/DallasTemperature@^3.9",
|
||||||
"adafruit/Adafruit GPS Library@^1.6.0",
|
"adafruit/Adafruit GPS Library@^1.6.0",
|
||||||
@ -114,7 +119,8 @@ def test_save_libraries(tmp_path):
|
|||||||
)
|
)
|
||||||
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
config = ProjectConfig.get_instance(str(project_dir / "platformio.ini"))
|
||||||
assert config.get("env:debug", "lib_deps") == [
|
assert config.get("env:debug", "lib_deps") == [
|
||||||
|
"SPI",
|
||||||
"bblanchon/ArduinoJson",
|
"bblanchon/ArduinoJson",
|
||||||
]
|
]
|
||||||
assert config.get("env:bare", "lib_deps") == []
|
assert config.get("env:bare", "lib_deps") == ["SPI"]
|
||||||
assert config.get("env:release", "lib_deps") == []
|
assert config.get("env:release", "lib_deps") == ["SPI"]
|
||||||
|
Reference in New Issue
Block a user