forked from platformio/platformio-core
Update multi-environment test for PIO test command
This commit is contained in:
@ -12,12 +12,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from os.path import join
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from platformio import util
|
from platformio import util
|
||||||
from platformio.commands.test.command import cli as cmd_test
|
from platformio.commands.test.command import cli as cmd_test
|
||||||
|
from platformio.compat import WINDOWS
|
||||||
|
|
||||||
|
|
||||||
def test_local_env(isolated_pio_core):
|
def test_local_env(isolated_pio_core):
|
||||||
@ -26,7 +28,7 @@ def test_local_env(isolated_pio_core):
|
|||||||
"platformio",
|
"platformio",
|
||||||
"test",
|
"test",
|
||||||
"-d",
|
"-d",
|
||||||
join("examples", "unit-testing", "calculator"),
|
os.path.join("examples", "unit-testing", "calculator"),
|
||||||
"-e",
|
"-e",
|
||||||
"native",
|
"native",
|
||||||
]
|
]
|
||||||
@ -51,24 +53,27 @@ board = teensy31
|
|||||||
[env:native]
|
[env:native]
|
||||||
platform = native
|
platform = native
|
||||||
|
|
||||||
[env:espressif32]
|
[env:espressif8266]
|
||||||
platform = espressif32
|
platform = espressif8266
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = esp32dev
|
board = nodemcuv2
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
project_dir.mkdir("test").join("test_main.cpp").write(
|
project_dir.mkdir("test").join("test_main.cpp").write(
|
||||||
"""
|
"""
|
||||||
|
#include <unity.h>
|
||||||
#ifdef ARDUINO
|
#ifdef ARDUINO
|
||||||
void setup() {}
|
void setup()
|
||||||
void loop() {}
|
|
||||||
#else
|
#else
|
||||||
int main() {
|
int main()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
UNITY_BEGIN();
|
UNITY_BEGIN();
|
||||||
UNITY_END();
|
UNITY_END();
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
void loop() {}
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user