-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract external libraries #67
base: master
Are you sure you want to change the base?
Extract external libraries #67
Conversation
I found that there is an inconsistency between clearing data for Strings and other data types. I've added a test for each, so we can see the difference. Although I'll leave it with you guys to determine which one is actually correct :) I think it'd be nice to be able to have some of the core functionality under test, which would help spot small details like this. One thing that make this a bit interesting is that we have to compile our tests against a development board, as we require We could then use the current unit test setup to run tests specifically for What do you guys think? |
Hi, Thanks for the PR. I am not keen on splitting out separate header files. I dont see it bringing anything to the party. The tests however are very interesting. I think they will make an great start to a full test suite. I would also like to explore the possibility of switching the json lib. Would you be open to removing the ConfigManager changes, and make this PR about the test suite? |
Heya, soz, I'm just getting back into things. Sure, I could revert the header extraction, although I do think there's utility in splitting up the files as it makes it easier to test them individually. As well as it's easier to work on the main piece of the library. As it's pretty standard to have headers in their individual files, so I adopted it here also. To be fair, if I didn't split the definitions out, I'm not sure that little bug would have jumped out at me 😆 I also think that our test files will start getting a little crazy if we have just one file for all class definitions, stepping away more from the standardised way of writing tests, 1 test file per class, and coming up with a alternative to get around our want to keep all definitions and implementation in one file 🤔 🤷♂ I think it's appropriate to start to move the definitions for a number of reasons.
I'll let you have a mull over it, I'll be away for a few more days but I should be around again, after the 16th. |
All fair points. My problem starts when you start shifting things that should be in |
I'm certainly with you in regards to DebugPrint. I was thinking about moving it to the include directory but I’m not sure about that either. It is a helper macro and it’s only really needs to be accessed within this library 🤔🤷♂️ I get where you’re coming from, although, if we think of it as being needed only by the ConfigManager class and not directly by users. It could be argued it’s a private library. http://docs.platformio.org/en/latest/projectconf/section_platformio.html#lib-dir I could fully be missing something though, my C/C++ isn’t as strong as my knowledge of other languages :) |
I would argue that the So to give any credence to splitting the into multiple files, they must all be in Granted, all of this is likely opinionated. |
@nrwiersma valid point, and apologies for being slow on this. Hopefully I'll make some changes in the coming days :) |
@baphled so .. forgetting about this PR, I started to go down some similar paths with the files .. and then did unroll them as it seemed to over complicate it a bunch. I wish I was able to remember this PR when I started :) .. still working through this? |
@nrwiersma ah, that’s no problem. I was planning on finishing this off then got hit by a load of dates to platformio.
I’m curious as to what these complications looked like, but I’m cool for you to drop this if you think it’s not going to improve the Lib :)
…Sent from my iPhone
On 2 Aug 2020, at 22:38, cgmckeever ***@***.***> wrote:
@baphled so .. forgetting about this PR, I started to go down some similar paths with the files .. and then did unroll them as it seemed to over complicate it a bunch. I wish I was able to remember this PR when I started :) .. still working through this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@cgmcrkeeper awesome, much appreciated.
That’s another thing I’ve wanted to address 😁
…Sent from my iPhone
On 6 Aug 2020, at 16:52, cgmckeever ***@***.***> wrote:
@baphled I think some of this discussion has made its way over to here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This PR addresses the fact that there are a few classes tucked away inside
ConfigManager.h
.It moves
BaseParameter
, and it's associated classes, into their own header file. As well as moving the debugging definitions into its own file.We also introduce a few unit tests to help drive some of the changes.
At present these tests require a ESP8266 and ESP32 board to run the tests against. This is due to the requirement of the Arduino library which
ArduinoJson
relies upon.This could be changed to running the tests natively, once
ArduinoJson
is replaced with a JSON library that is not reliant onArduino.h
header file, allowing us to integrate unit testing into our TravisCI build.We could still use the current setup, so that we can test
ConfigManager
against real boards, so this seems like a sane step to make to get the library under test.