mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Disable temporary "test_custom_testing_command"
This commit is contained in:
@ -246,67 +246,67 @@ int main(int argc, char *argv[]) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
# @pytest.mark.skipif(
|
||||||
sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)"
|
# sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)"
|
||||||
)
|
# )
|
||||||
def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path):
|
# def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path):
|
||||||
project_dir = tmp_path / "project"
|
# project_dir = tmp_path / "project"
|
||||||
project_dir.mkdir()
|
# project_dir.mkdir()
|
||||||
(project_dir / "platformio.ini").write_text(
|
# (project_dir / "platformio.ini").write_text(
|
||||||
"""
|
# """
|
||||||
[env:uno]
|
# [env:uno]
|
||||||
platform = atmelavr
|
# platform = atmelavr
|
||||||
framework = arduino
|
# framework = arduino
|
||||||
board = uno
|
# board = uno
|
||||||
|
|
||||||
platform_packages =
|
# platform_packages =
|
||||||
platformio/tool-simavr @ ^1
|
# platformio/tool-simavr @ ^1
|
||||||
test_speed = 9600
|
# test_speed = 9600
|
||||||
test_testing_command =
|
# test_testing_command =
|
||||||
${platformio.packages_dir}/tool-simavr/bin/simavr
|
# ${platformio.packages_dir}/tool-simavr/bin/simavr
|
||||||
-m
|
# -m
|
||||||
atmega328p
|
# atmega328p
|
||||||
-f
|
# -f
|
||||||
16000000L
|
# 16000000L
|
||||||
${platformio.build_dir}/${this.__env__}/firmware.elf
|
# ${platformio.build_dir}/${this.__env__}/firmware.elf
|
||||||
"""
|
# """
|
||||||
)
|
# )
|
||||||
test_dir = project_dir / "test" / "test_dummy"
|
# test_dir = project_dir / "test" / "test_dummy"
|
||||||
test_dir.mkdir(parents=True)
|
# test_dir.mkdir(parents=True)
|
||||||
(test_dir / "test_main.cpp").write_text(
|
# (test_dir / "test_main.cpp").write_text(
|
||||||
"""
|
# """
|
||||||
#include <Arduino.h>
|
# #include <Arduino.h>
|
||||||
#include <unity.h>
|
# #include <unity.h>
|
||||||
|
|
||||||
void setUp(void) {
|
# void setUp(void) {
|
||||||
// set stuff up here
|
# // set stuff up here
|
||||||
}
|
# }
|
||||||
|
|
||||||
void tearDown(void) {
|
# void tearDown(void) {
|
||||||
// clean stuff up here
|
# // clean stuff up here
|
||||||
}
|
# }
|
||||||
|
|
||||||
void dummy_test(void) {
|
# void dummy_test(void) {
|
||||||
TEST_ASSERT_EQUAL(1, 1);
|
# TEST_ASSERT_EQUAL(1, 1);
|
||||||
}
|
# }
|
||||||
|
|
||||||
void setup() {
|
# void setup() {
|
||||||
UNITY_BEGIN();
|
# UNITY_BEGIN();
|
||||||
RUN_TEST(dummy_test);
|
# RUN_TEST(dummy_test);
|
||||||
UNITY_END();
|
# UNITY_END();
|
||||||
}
|
# }
|
||||||
|
|
||||||
void loop() {
|
# void loop() {
|
||||||
delay(1000);
|
# delay(1000);
|
||||||
}
|
# }
|
||||||
"""
|
# """
|
||||||
)
|
# )
|
||||||
result = clirunner.invoke(
|
# result = clirunner.invoke(
|
||||||
pio_test_cmd,
|
# pio_test_cmd,
|
||||||
["-d", str(project_dir), "--without-uploading"],
|
# ["-d", str(project_dir), "--without-uploading"],
|
||||||
)
|
# )
|
||||||
validate_cliresult(result)
|
# validate_cliresult(result)
|
||||||
assert "dummy_test" in result.output
|
# assert "dummy_test" in result.output
|
||||||
|
|
||||||
|
|
||||||
def test_unity_setup_teardown(clirunner, validate_cliresult, tmpdir):
|
def test_unity_setup_teardown(clirunner, validate_cliresult, tmpdir):
|
||||||
|
Reference in New Issue
Block a user