mmurdoch/arduinounit

Problems creating unit test firmware using Arduino CMake

peterquiel opened this issue · 0 comments

When I try to compile a project created with arduino cmake than I get compile errors.
The UnitTest.ino is realy simple and contains the first example.

In file included from /home/pedda/projects/arduino/UnitTest/UnitTest.ino:1:0:
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:110: error: two or more data types in declaration of ‘test_ok_instance’
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:8:7: note: in expansion of macro ‘test’
//=== START Forward: /home/pedda/projects/arduino/UnitTest/UnitTest.ino
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:165: error: declaration of ‘virtual void test_ok::once()’ outside of class is not definition [-fpermissive]
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:8:7: note: in expansion of macro ‘test’
//=== START Forward: /home/pedda/projects/arduino/UnitTest/UnitTest.ino
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:27: error: redefinition of ‘struct test_ok’
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:9:7: note: in expansion of macro ‘test’
void test(ok) ;
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:27: error: previous definition of ‘struct test_ok’
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:8:7: note: in expansion of macro ‘test’
//=== START Forward: /home/pedda/projects/arduino/UnitTest/UnitTest.ino
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:110: error: two or more data types in declaration of ‘test_ok_instance’
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:9:7: note: in expansion of macro ‘test’
void test(ok) ;
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:165: error: declaration of ‘virtual void test_ok::once()’ outside of class is not definition [-fpermissive]
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()
^
/home/pedda/projects/arduino/UnitTest/UnitTest_UnitTest.ino.cpp:9:7: note: in expansion of macro ‘test’
void test(ok) ;
^
/home/pedda/local/arduino/libraries/ArduinoUnit/ArduinoUnit.h:591:110: error: two or more data types in declaration of ‘test_bad_instance’
#define test(name) struct test_ ## name : TestOnce { test_ ## name() : TestOnce(F(#name)) {}; void once(); } test_ ## name ## instance; void test ## name :: once()

aso.