Skip to content

Use of FakeIt as a dependency with supporting fixes #45

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

Merged
merged 26 commits into from
Jun 3, 2023

Conversation

RobertByrnes
Copy link
Contributor

@RobertByrnes RobertByrnes commented May 17, 2023

@FabioBatSilva ok here goes again. This PR has edited the CMakeList.txt files to pull in FakeIt as a dependency - using latest currently 4.2.0.

In addition to this there are three supporting fixes:

A change from map to unordered_map in ArduinoFake which achieves the same result and avoids an ambiguous reference conflicting with the Arduino map function.

A change to the method setup and verification to use const char* instead of const char[]. This matches the actual method signature in the Arduino Print library for printing C-style strings (which are essentially const char*). Print class.

Use of a single pointer in test setup and assertions in the client class.

This would close #44

@nerdyscout
Copy link
Contributor

nerdyscout commented May 17, 2023

I am currently trying to include this into some project but it fails. Seems like /ArduinoFake/src/ArduinoFake.h includes fakeit.hpp but this is actually deleted by the PR. dont know yet what I do wrong, havn't figured out how the dependency should be pulled.

this is what I am working on
https://github.com/nerdyscout/Arduino_MCP3x6x_Library/tree/fakeit

did you verify the platformio build path as well or just cmake? I am using platformio where is no

download_repo(
    URL "https://github.com/eranpeer/FakeIt.git"
    TAG ${PROJECT_VERSION}
    CLONE_DIR ${REPO_DIR}
)

@RobertByrnes
Copy link
Contributor Author

Arh I missed that! Make brings it in for building with 'make' and running the tests with 'make test'.

I hadn't added the fake it repo to the platformio.ini!

I will be able to look at that tomorrow in the meantime maybe try it ... lib_deps=https://github .... fakeit url ...

@nerdyscout
Copy link
Contributor

thank you for the quick reply.
yes it solved the dependencies, but (atleast my) built system is still not able to find the fakeit.hpp. will check out some when later.

@RobertByrnes
Copy link
Contributor Author

No worries. I'll take another look tomorrow. I am curious to see what happens when the workflow runs now....

@RobertByrnes
Copy link
Contributor Author

@nerdyscout Have another go at this - the trick here was that FakeIt produces several fakeit.hpp files in subdirectories so dependency resolution was doomed. That is now sorted.

@FabioBatSilva this should now be there - as in, FakeIt being pulled in as a dependency handled within the make pipeline. This is currently set to 4.2.0 in the external/fakeit/CMakeLists.txt file and can be edited from there. There were 3 fixes for change to ArduinoFake to make it work but none of them are/were breaking

Copy link
Owner

@FabioBatSilva FabioBatSilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RobertByrnes 👍

Awesome work here,
Will tag this as a new major version

@FabioBatSilva FabioBatSilva merged commit e8f5f2f into FabioBatSilva:master Jun 3, 2023
@RobertByrnes
Copy link
Contributor Author

I don't feel it's complete until the FakeiIt version is no longer hard baked into the make file but this is a step 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade the fakeit lib?
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy