hsaturn / espmock Goto Github PK
View Code? Open in Web Editor NEWMock for ESP8266 libraries
License: MIT License
Mock for ESP8266 libraries
License: MIT License
Moved from bxparks/AUnit#75
Hi Brian
My unit tests are broken due to WProgram.h missing (here)
This files has gone when I have acecpted your PR on EspMock.
I may be wrong as this is the first time I'm using EPOXY_CORE as I wanted my unit tests to pass since this modification.
Best regards
@hsaturn: Please take a look at the updated README.md if you haven't already seen it. And I updated https://github.com/bxparks/EpoxyDuino#LibrariesAndMocks subsection to reference this project.
I wanted to add a Usage section in this README.md with instructions on how to use EspMock, but when I looked at your code, I got confused. There is an Arduino.h
file under src/
, but that doesn't make sense, since it would cause multiple Arduino.h
to appear to the compiler. I think this file can be removed.
I think your intention was to make the EspMock library transparent, once it is included in the ARDUINO_LIBS
variable of the EpoxyDuino's Makefile
. I think most programs which are designed to work under both ESP32 and ESP8266 have this little bit of header file machinery:
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#else
#error Unsupported platform
#endif
#include <WiFiUdp.h>
...
When compiling such a program under EpoxyDuino, the preprocessing will fail, so I think this needs to be updated to something like this:
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#elif defined(EPOXY_DUINO)
#include <ESP8266WiFi.h>
#else
#error Unsupported platform
#endif
It is currently not possible to tell EpoxyDuino to "compile the ESP8266 flavor of EpoxyDuino", or "compile the ESP32 flavor of EpoxyDuino". In my mind, EpoxyDuino should be considered to be a separate, independent implementation of the Arduino API. When various networking libraries are added, I think they should be self-contained within the EpoxyDuino environment. Ideally, the names of these mock libraries would not contain "ESP8266" within them, because they are targeting the EpoxyDuino environment.
On the other hand, there are certain ESP8266 libraries that you are mocking out, specifically to make sure that your programs that you wrote for ESP8266 compile properly using a Linux environment. I'm not entirely sure how to organize these libraries so that it makes sense to us, and to potential users of EspMock.
[Edit: fix typos]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.