forked from platformio/platformio-core
Fixed an issue when configuration file options partly ignored when `--project-conf` // Resolve #3034 (#3055)
* Fixed an issue when configuration file options partly ignored when using custom ``--project-conf`` // Resolve #3034 * Py2 compatible makedirs * Fix circle dependency * Fix broken import in test examples * Fix history * Remove YAPF markers * PyLint fix * Fix invalid project conf path * Move PIO Core to the root on Windows, issue with long CPPPATHs * Respect global PLATFORMIO_BUILD_CACHE_DIR env var * Fix Appveyor paths * Minor changes
This commit is contained in:
@@ -164,7 +164,7 @@ def test_check_filter_sources(clirunner, check_dir):
|
||||
assert style == EXPECTED_STYLE
|
||||
|
||||
|
||||
def test_check_failed_if_no_source_files(clirunner, tmpdir):
|
||||
def test_check_no_source_files(clirunner, tmpdir):
|
||||
tmpdir.join("platformio.ini").write(DEFAULT_CONFIG)
|
||||
tmpdir.mkdir("src")
|
||||
|
||||
@@ -178,7 +178,7 @@ def test_check_failed_if_no_source_files(clirunner, tmpdir):
|
||||
assert style == 0
|
||||
|
||||
|
||||
def test_check_failed_if_bad_flag_passed(clirunner, check_dir):
|
||||
def test_check_bad_flag_passed(clirunner, check_dir):
|
||||
result = clirunner.invoke(
|
||||
cmd_check, ["--project-dir", str(check_dir), '"--flags=--UNKNOWN"']
|
||||
)
|
||||
|
||||
@@ -22,7 +22,6 @@ import pytest
|
||||
from platformio import util
|
||||
from platformio.managers.platform import PlatformFactory, PlatformManager
|
||||
from platformio.project.config import ProjectConfig
|
||||
from platformio.project.helpers import get_project_build_dir
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
@@ -71,11 +70,12 @@ def pytest_generate_tests(metafunc):
|
||||
@pytest.mark.examples
|
||||
def test_run(pioproject_dir):
|
||||
with util.cd(pioproject_dir):
|
||||
build_dir = get_project_build_dir()
|
||||
config = ProjectConfig()
|
||||
build_dir = config.get_optional_dir("build")
|
||||
if isdir(build_dir):
|
||||
util.rmtree_(build_dir)
|
||||
|
||||
env_names = ProjectConfig(join(pioproject_dir, "platformio.ini")).envs()
|
||||
env_names = config.envs()
|
||||
result = util.exec_command(
|
||||
["platformio", "run", "-e", random.choice(env_names)]
|
||||
)
|
||||
|
||||
@@ -112,6 +112,15 @@ def test_warnings(config):
|
||||
config.validate(["non-existing-env"])
|
||||
|
||||
|
||||
def test_defaults(config):
|
||||
assert config.get_optional_dir("core") == os.path.join(
|
||||
os.path.expanduser("~"), ".platformio"
|
||||
)
|
||||
assert config.get_optional_dir("build_cache") == os.environ.get(
|
||||
"PLATFORMIO_BUILD_CACHE_DIR"
|
||||
)
|
||||
|
||||
|
||||
def test_sections(config):
|
||||
with pytest.raises(ConfigParser.NoSectionError):
|
||||
config.getraw("unknown_section", "unknown_option")
|
||||
|
||||
Reference in New Issue
Block a user