forked from platformio/platformio-core
Fix INO to CPP converting when 2-tokens type is used
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
VERSION = (3, 0, "0b2")
|
||||
VERSION = (3, 0, "0b3")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -31,8 +31,8 @@ from platformio import util
|
||||
class InoToCPPConverter(object):
|
||||
|
||||
PROTOTYPE_RE = re.compile(r"""^(
|
||||
([a-z_\d]+\*?){1,2} # return type
|
||||
(\s+[a-z_\d]+\s*) # name of prototype
|
||||
([a-z_\d]+\*?\s+){1,2} # return type
|
||||
([a-z_\d]+\s*) # name of prototype
|
||||
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
||||
)\s*\{ # must end with {
|
||||
""", re.X | re.M | re.I)
|
||||
|
@ -32,7 +32,6 @@ def validate_cliresult():
|
||||
def decorator(result):
|
||||
assert result.exit_code == 0
|
||||
assert not result.exception
|
||||
assert "error" not in result.output.lower()
|
||||
|
||||
return decorator
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
void barFunc () { // my comment
|
||||
|
||||
unsigned int barFunc () // my comment
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -9,5 +9,5 @@ void loop() {
|
||||
}
|
||||
|
||||
char* fooFunc() {
|
||||
return buf;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ from os.path import dirname, getsize, isdir, isfile, join, normpath
|
||||
import pytest
|
||||
|
||||
from platformio import util
|
||||
from platformio.commands.run import cli as cmd_run
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
@ -35,12 +34,16 @@ def pytest_generate_tests(metafunc):
|
||||
metafunc.parametrize("pioproject_dir", project_dirs)
|
||||
|
||||
|
||||
def test_run(clirunner, validate_cliresult, pioproject_dir):
|
||||
@pytest.mark.examples
|
||||
def test_run(pioproject_dir):
|
||||
if isdir(join(pioproject_dir, ".pioenvs")):
|
||||
util.rmtree_(join(pioproject_dir, ".pioenvs"))
|
||||
|
||||
result = clirunner.invoke(cmd_run, ["-d", pioproject_dir])
|
||||
validate_cliresult(result)
|
||||
result = util.exec_command(
|
||||
["platformio", "--force", "run", "--project-dir", pioproject_dir]
|
||||
)
|
||||
if result['returncode'] != 0:
|
||||
pytest.fail(result)
|
||||
|
||||
# check .elf file
|
||||
pioenvs_dir = join(pioproject_dir, ".pioenvs")
|
||||
|
Reference in New Issue
Block a user