PlatformIO Community

"custom" test transport error


#1

Hello,

I am trying to use the custom test transport for unit testing on a board.
I am trying to work with the processor on the b96b_f446ve board.

This is how my files look

Platformio.ini

[env:b96b_f446ve]
platform = ststm32
board = b96b_f446ve
framework = mbed
upload_protocol = stlink-v2
test_transport = custom

unittest_transport.h

#ifndef UNITTEST_TRANSPORT_H
#define UNITTEST_TRANSPORT_H
void unittest_uart_begin();
void unittest_uart_putchar(char c);
void unittest_uart_flush();
void unittest_uart_end();
#endif

unittest_transport.c

#include "unittest_transport.h"
#include "mbed.h"
Serial testport(PC_10, PA_1);
void unittest_uart_begin()
  {
    testport.baud(9600);
  }
void unittest_uart_putchar(char c)
  {
    testport.putc(c);
  }
void unittest_uart_flush()
  {
  }
void unittest_uart_end()
  {
    // testport.close();
  }

My test files are empty at the moment, but I figured that atleast it should compile fine and fail at the uploading stage.
However I get an error at the compiling stage for the tests.
Here is the screenshot


Anything I am doing wrong?? I went through the example given with the STM2cube and the nucleo_F401RE board and modelled my code after it.

Any help is greatly appreciated.
@ivankravets @valeros
Thank you guys for this wonderful addition. Platformio keeps getting better and better


#2

You are going to use mbed which is CPP based framework. Please rename to unittest_transport.c

Thank you guys for this wonderful addition. Platformio keeps getting better and better

Thank you for a feedback! Happy coding with PlatformIO!


#3

Do you mean unittest_transport.cpp ??
I tried and the result remains the same. Same error


#4

Ah… It seems that we have an error. I’ve just fixed it. Could you upgrade PIO Core to develop?

pip install -U https://github.com/platformio/platformio-core/archive/develop.zip


#5

Thank you @ivankravets
It compiles just fine now! :slight_smile:
Always a wonderful experience on the forums here.