1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Sketch emulation on host (#5342)

* WIP compile examples on host with 'make examples'

* WIP bufferize tcp input

* WIP Makefile

* WIP network to rework, tcp/udp to factorize, udp addresses broken

* minor changes to the core

* WIP basic udp working

* WIP mdns

* WIP mcast receiving, not sending

* WIP mdns OK

* beta version

* SSL + doc

* update travis host test command

* licenses

* typo

* doc: arduino builder is not around: declare functions before calling them

* fix with latest SSL PR, compile in 32 bits mode

* fix make clean

* make -m32 optional

* 32bits compiler ability tester

* WIP

* WIP (fix 1 vtable error, still another one to hunt with using spiffs)

* example astyle

* fix os_printf_plus

* load / save mock spiffs

* fix style

* fix using spiffs/mock

* don't mess ram

* update doc

* remove leftover

* optimization -Os except for CI, rename ARCH32 to FORCE32

* revert useless cast (not even compiled)

* remove unused function

* use proper type for pointer arithmetics

* makefile: sketch object and cpp file moved to bin/ directories
easier to clean, and IDE don't like them

* changes for review

* make use of %zd

* less verbose makefile by default (option)

* update readme
This commit is contained in:
david gauchard
2018-11-20 21:51:45 +01:00
committed by Develo
parent b504881be4
commit 74ca42f829
51 changed files with 3760 additions and 96 deletions

View File

@ -50,25 +50,25 @@ static std::set<String> listDir (const char* path)
TEST_CASE("FS can begin","[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
}
TEST_CASE("FS can't begin with zero size","[fs]")
{
SPIFFS_MOCK_DECLARE(0, 8, 512);
SPIFFS_MOCK_DECLARE(0, 8, 512, false);
REQUIRE_FALSE(SPIFFS.begin());
}
TEST_CASE("Before begin is called, open will fail","[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE_FALSE(SPIFFS.open("/foo", "w"));
}
TEST_CASE("FS can create file","[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
createFile("/test", "");
REQUIRE(SPIFFS.exists("/test"));
@ -76,7 +76,7 @@ TEST_CASE("FS can create file","[fs]")
TEST_CASE("Files can be written and appended to","[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
{
File f = SPIFFS.open("config1.txt", "w");
@ -100,7 +100,7 @@ TEST_CASE("Files can be written and appended to","[fs]")
TEST_CASE("Files persist after reset", "[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
createFile("config1.txt", "file 1");
@ -112,7 +112,7 @@ TEST_CASE("Files persist after reset", "[fs]")
TEST_CASE("Filesystem is empty after format", "[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.format());
REQUIRE(SPIFFS.begin());
createFile("/1", "first");
@ -128,7 +128,7 @@ TEST_CASE("Filesystem is empty after format", "[fs]")
TEST_CASE("Dir lists all files", "[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
createFile("/empty", "");
createFile("/not_empty", "some text");
@ -146,7 +146,7 @@ TEST_CASE("Dir lists all files", "[fs]")
TEST_CASE("File names which are too long are rejected", "[fs]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
const char* emptyName = "";
const char* longName_31 = "/234567890123456789012345678901";
@ -164,7 +164,7 @@ TEST_CASE("File names which are too long are rejected", "[fs]")
TEST_CASE("#1685 Duplicate files", "[fs][bugreport]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
createFile("/config", "some text");
createFile("/data", "");
@ -175,7 +175,7 @@ TEST_CASE("#1685 Duplicate files", "[fs][bugreport]")
TEST_CASE("#1819 Can list all files with openDir(\"\")", "[fs][bugreport]")
{
SPIFFS_MOCK_DECLARE(64, 8, 512);
SPIFFS_MOCK_DECLARE(64, 8, 512, false);
REQUIRE(SPIFFS.begin());
createFile("/file1", "some text");
createFile("/file2", "other text");