1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

allow reading test environment from python mocks

This allows requesting environment variable values set in the C++ test
code, from python mock code. Use case is cross-checking test
results against values expected by the host side part of the test.
This commit is contained in:
Ivan Grokhotkov
2018-04-10 21:19:53 +08:00
committed by Ivan Grokhotkov
parent 8bd26f2ded
commit 1acaa8b8f6
6 changed files with 81 additions and 7 deletions

View File

@ -49,3 +49,12 @@ TEST_CASE("this test also runs successfully", "[bluesmoke]")
{
}
TEST_CASE("environment variables can be set and read from python", "[bluesmoke]")
{
const char* res = getenv("VAR_FROM_PYTHON");
REQUIRE(res != NULL);
CHECK(strcmp(res, "42") == 0);
setenv("VAR_FROM_TEST", "24", 1);
}