I'm new to C++, and am developing for Arduino with PlatformIO & VS Code on MacOS 11.6.5.
Following the PlatformIO docs I have set up a simple test like this:
#include <unity.h>
#include <iostream>
void test_something()
{
std::cout << "Test running..." << std::endl;
TEST_ASSERT_TRUE(true);
}
int main(int argc, char **argv)
{
UNITY_BEGIN();
RUN_TEST(test_something);
UNITY_END();
}
When I run platformio test --environment local
I see the test results in the terminal, but not the output of std::cout
.
(I found an example of printing to cout from tests when not using PlatformIO, and the PlatformIO repo has lots of test examples, but none of these seem to involve cout.)
Also VS Code IntelliSense complains 'cannot open source file "iostream"', but I'm guessing this is unrelated as PlatformIO seems to have no problems compiling it.
Any pointers appreciated!