Skip to content

Commit 940c0f1

Browse files
committed
fix using spiffs/mock
1 parent 747f3b3 commit 940c0f1

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

cores/esp8266/spiffs_api.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ bool isSpiffsFilenameValid(const char* name)
109109
}
110110

111111
// these symbols should be defined in the linker script for each flash layout
112+
#ifndef CORE_MOCK
112113
#ifdef ARDUINO
113114
extern "C" uint32_t _SPIFFS_start;
114115
extern "C" uint32_t _SPIFFS_end;
@@ -131,6 +132,7 @@ FS SPIFFS = FS(FSImplPtr(new SPIFFSImpl(
131132
SPIFFS_PHYS_PAGE,
132133
SPIFFS_PHYS_BLOCK,
133134
SPIFFS_MAX_OPEN_FILES)));
134-
#endif
135+
#endif // ARDUINO
136+
#endif // !CORE_MOCK
135137

136138
#endif

tests/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function build_docs()
134134
function run_host_tests()
135135
{
136136
pushd host
137-
make CI
137+
make ARCH32=0 CI
138138
make clean-objects
139139
popd
140140
}

tests/host/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ CORE_CPP_FILES := $(addprefix $(CORE_PATH)/,\
3838
WString.cpp \
3939
Print.cpp \
4040
FS.cpp \
41+
spiffs_api.cpp \
4142
pgmspace.cpp \
4243
MD5Builder.cpp \
4344
)
44-
# spiffs_api.cpp \
4545

4646
CORE_C_FILES := $(addprefix $(CORE_PATH)/,\
4747
core_esp8266_noniso.c \
@@ -58,6 +58,7 @@ MOCK_CPP_FILES_COMMON := $(addprefix common/,\
5858
spiffs_mock.cpp \
5959
WMath.cpp \
6060
HardwareSerial.cpp \
61+
MockTools.cpp \
6162
)
6263

6364
MOCK_CPP_FILES := $(MOCK_CPP_FILES_COMMON) $(addprefix common/,\
@@ -77,12 +78,12 @@ MOCK_C_FILES := $(addprefix common/,\
7778
INC_PATHS := $(addprefix -I,\
7879
common \
7980
$(CORE_PATH) \
80-
$(shell echo ../../libraries/*/src) \
81-
$(shell echo ../../libraries/*) \
82-
../../tools/sdk/include \
8381
)
8482

8583
INC_PATHS += $(addprefix -I,\
84+
$(shell echo ../../libraries/*/src) \
85+
$(shell echo ../../libraries/*) \
86+
../../tools/sdk/include \
8687
../../tools/sdk/lwip2/include \
8788
)
8889

@@ -133,7 +134,7 @@ clean: clean-objects clean-coverage # clean everything
133134
rm -rf $(BINDIR)
134135

135136
clean-objects:
136-
rm -rf $(C_OBJECTS) $(CPP_OBJECTS_CORE) $(CPP_OBJECTS_CORE_EMU)
137+
rm -rf $(C_OBJECTS) $(CPP_OBJECTS_CORE) $(CPP_OBJECTS_CORE_EMU) $(CPP_OBJECTS_TESTS)
137138

138139
clean-coverage:
139140
rm -rf $(COVERAGE_FILES) $(LCOV_DIRECTORY) *.gcov
@@ -217,7 +218,6 @@ MOCK_ARDUINO_LIBS := \
217218
common/MockWiFiServer.cpp \
218219
common/MockUDPSocket.cpp \
219220
common/ArduinoWire.cpp \
220-
common/MockTools.cpp \
221221
common/MockEsp.cpp \
222222
common/MockEEPROM.cpp \
223223
common/MockSPI.cpp \

tests/host/common/ArduinoMain.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646

4747
#include <map>
4848

49+
#if 0
50+
#include "../common/spiffs_mock.h"
51+
#include <spiffs/spiffs.h>
52+
SPIFFS_MOCK_DECLARE(/*size_kb*/1024, /(blovk_kb*/8, /*page_b*/512);
53+
#endif
54+
4955
std::map<int,UdpContext*> udps;
5056

5157
void register_udp (int sock, UdpContext* udp)

tests/host/common/WMath.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
extern "C" {
2727
#include <stdlib.h>
28+
#include <stdint.h>
2829
}
2930

3031
void randomSeed(unsigned long seed) {

0 commit comments

Comments
 (0)