Skip to content

Problems creating unit test firmware using Arduino CMake  #42

@peterquiel

Description

@peterquiel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions