mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-22 11:36:21 +00:00
Add test for fopen_packed()
This commit is contained in:
1 parent
b0e0247b21
commit
299075c930
6 files changed
+158
-20
No files matched your search
@@ -1,5 +1,5 @@
|
||||
PROG ?= example
|
||||
SOURCES ?= ../../mongoose.c main.c mjson.c fs.c
|
||||
SOURCES ?= ../../mongoose.c main.c mjson.c packed_fs.c
|
||||
CFLAGS ?= -I../.. $(EXTRA)
|
||||
FILES_TO_EMBED ?= $(wildcard web_root/*.js) $(wildcard web_root/*.css) $(wildcard web_root/*.html) $(wildcard web_root/images/*.png) $(wildcard images/*.jpg)
|
||||
|
||||
@@ -8,14 +8,14 @@ all: $(PROG)
|
||||
|
||||
$(PROG):
|
||||
$(CC) pack.c -o pack
|
||||
./pack $(FILES_TO_EMBED) > fs.c
|
||||
./pack $(FILES_TO_EMBED) > packed_fs.c
|
||||
$(CC) -W -Wall -Wextra -Os -g3 $(CFLAGS) -o $(PROG) $(SOURCES)
|
||||
|
||||
ROOT ?= $(realpath $(CURDIR)/../..)
|
||||
DOCKER ?= docker run -it --rm -e Tmp=. -e WINEDEBUG=-all -v $(ROOT):$(ROOT) -w $(CURDIR) mdashnet/vc98 wine
|
||||
windows:
|
||||
$(DOCKER) cl.exe /nologo $(CFLAGS) pack.c /Fepack.exe
|
||||
$(DOCKER) cmd /c 'pack.exe $(FILES_TO_EMBED) > fs.c'
|
||||
$(DOCKER) cmd /c 'pack.exe $(FILES_TO_EMBED) > packed_fs.c'
|
||||
$(DOCKER) cl.exe /nologo /O2 $(CFLAGS) $(SOURCES) ws2_32.lib /Fe$(PROG).exe
|
||||
$(DOCKER) $(PROG).exe
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ int main(int argc, char *argv[]) {
|
||||
printf(" // %.*s\n", j, ascii);
|
||||
j = 0;
|
||||
}
|
||||
ascii[j] = (ch >= ' ' && ch <= '~' && ch != '\\') ? ch : '.';
|
||||
ascii[j] = (char) ((ch >= ' ' && ch <= '~' && ch != '\\') ? ch : '.');
|
||||
printf(" %3u,", ch);
|
||||
}
|
||||
// Append zero byte at the end, to make text files appear in memory
|
||||
|
||||
Reference in new issue
Block a user