m-mcgowan / spark-flashee-eeprom

Eeprom emulation using external flash on Particle devices. Includes unit tests cross compiled to regular gcc, and on-device integration tests.
GNU Affero General Public License v3.0
33 stars 8 forks source link

Tests do not compile and fail on Linux #11

Open nolanhergert opened 9 years ago

nolanhergert commented 9 years ago

There are two issues.

1. gtest.h requires pthread support

Fix: Add pthread support flag to Makefile Specifically, I appended "-pthread" to the CXXFLAGS option (line 59) of firmware/test/nbproject/Makefile-Debug.mk. One should also add this to the release build appropriately.

2. Some tests fail

"dist/Debug/MinGW-Windows/test"
[==========] Running 145 tests from 15 test cases.
[----------] Global test environment set-up.
[----------] 9 tests from CircularBufferTest
[ RUN      ] CircularBufferTest.CannotReadWhenEmpty

    [       OK ] CircularBufferTest.CannotReadWhenEmpty (0 ms)
.
.
.

[----------] 6 tests from CreateFSTest
[ RUN      ] CreateFSTest.FilesystemIsPersisted
Created filesystem
Created file
asserted File exists
Created filesystem2
Created checkFileExists
[       OK ] CreateFSTest.FilesystemIsPersisted (1 ms)
[ RUN      ] CreateFSTest.FilesystemIsPersisted2
Segmentation fault (core dumped)
make: *** [test] Error 139
nolanhergert commented 9 years ago

For the first item, is it appropriate to add -pthread to both Makefile-Debug and Makefile-Release? I am just hoping it won't screw up things for other OS's as you Matt obviously didn't need it.

m-mcgowan commented 9 years ago

I'll try adding pthread when I'm working on this library next. I don't think it will have any affect on other platforms, where it's probably (hopefully!) just ignored. I've not yet tried flashee on OSX, which is now my day-to-day platform.