Skip to content

Commit

Permalink
Disable temporary "test_custom_testing_command"
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Oct 17, 2024
1 parent a4276b4 commit 3e20abe
Showing 1 changed file with 61 additions and 61 deletions.
122 changes: 61 additions & 61 deletions tests/commands/test_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,67 +246,67 @@ def test_crashed_program(clirunner, tmpdir):
)


@pytest.mark.skipif(
sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)"
)
def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path):
project_dir = tmp_path / "project"
project_dir.mkdir()
(project_dir / "platformio.ini").write_text(
"""
[env:uno]
platform = atmelavr
framework = arduino
board = uno
platform_packages =
platformio/tool-simavr @ ^1
test_speed = 9600
test_testing_command =
${platformio.packages_dir}/tool-simavr/bin/simavr
-m
atmega328p
-f
16000000L
${platformio.build_dir}/${this.__env__}/firmware.elf
"""
)
test_dir = project_dir / "test" / "test_dummy"
test_dir.mkdir(parents=True)
(test_dir / "test_main.cpp").write_text(
"""
#include <Arduino.h>
#include <unity.h>
void setUp(void) {
// set stuff up here
}
void tearDown(void) {
// clean stuff up here
}
void dummy_test(void) {
TEST_ASSERT_EQUAL(1, 1);
}
void setup() {
UNITY_BEGIN();
RUN_TEST(dummy_test);
UNITY_END();
}
void loop() {
delay(1000);
}
"""
)
result = clirunner.invoke(
pio_test_cmd,
["-d", str(project_dir), "--without-uploading"],
)
validate_cliresult(result)
assert "dummy_test" in result.output
# @pytest.mark.skipif(
# sys.platform != "darwin", reason="runs only on macOS (issue with SimAVR)"
# )
# def test_custom_testing_command(clirunner, validate_cliresult, tmp_path: Path):
# project_dir = tmp_path / "project"
# project_dir.mkdir()
# (project_dir / "platformio.ini").write_text(
# """
# [env:uno]
# platform = atmelavr
# framework = arduino
# board = uno

# platform_packages =
# platformio/tool-simavr @ ^1
# test_speed = 9600
# test_testing_command =
# ${platformio.packages_dir}/tool-simavr/bin/simavr
# -m
# atmega328p
# -f
# 16000000L
# ${platformio.build_dir}/${this.__env__}/firmware.elf
# """
# )
# test_dir = project_dir / "test" / "test_dummy"
# test_dir.mkdir(parents=True)
# (test_dir / "test_main.cpp").write_text(
# """
# #include <Arduino.h>
# #include <unity.h>

# void setUp(void) {
# // set stuff up here
# }

# void tearDown(void) {
# // clean stuff up here
# }

# void dummy_test(void) {
# TEST_ASSERT_EQUAL(1, 1);
# }

# void setup() {
# UNITY_BEGIN();
# RUN_TEST(dummy_test);
# UNITY_END();
# }

# void loop() {
# delay(1000);
# }
# """
# )
# result = clirunner.invoke(
# pio_test_cmd,
# ["-d", str(project_dir), "--without-uploading"],
# )
# validate_cliresult(result)
# assert "dummy_test" in result.output


def test_unity_setup_teardown(clirunner, validate_cliresult, tmpdir):
Expand Down

0 comments on commit 3e20abe

Please sign in to comment.