Skip to content

Commit ac9766e

Browse files
committed
Added self-hosting fuzz test using littlefs-fuse
1 parent 9db1a86 commit ac9766e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,33 @@ script:
1616
- CFLAGS="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make test
1717
- CFLAGS="-DLFS_BLOCK_COUNT=1023" make test
1818
- CFLAGS="-DLFS_LOOKAHEAD=2047" make test
19+
20+
# self-host with littlefs-fuse for fuzz test
21+
- make -C littlefs-fuse
22+
23+
- littlefs-fuse/lfs --format /dev/loop0
24+
- littlefs-fuse/lfs /dev/loop0 mount
25+
26+
- ls mount
27+
- mkdir mount/littlefs
28+
- cp -r $(git ls-tree --name-only HEAD) mount/littlefs
29+
- cd mount/littlefs
30+
- ls
31+
- make -B test_dirs
32+
33+
before_install:
34+
- fusermount -V
35+
- gcc --version
36+
37+
install:
38+
- sudo apt-get install libfuse-dev
39+
- git clone --depth 1 https://github.com/geky/littlefs-fuse
40+
41+
before_script:
42+
- rm -rf littlefs-fuse/littlefs/*
43+
- cp -r $(git ls-tree --name-only HEAD) littlefs-fuse/littlefs
44+
45+
- mkdir mount
46+
- sudo chmod a+rw /dev/loop0
47+
- dd if=/dev/zero bs=512 count=2048 of=disk
48+
- losetup /dev/loop0 disk

tests/template.fmt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ void test_assert(const char *file, unsigned line,
2727
}}
2828

2929
if (v != e) {{
30-
printf("\033[31m%s:%u: assert %s failed, expected %jd\033[0m\n",
31-
file, line, s, e);
30+
fprintf(stderr, "\033[31m%s:%u: assert %s failed with %jd, "
31+
"expected %jd\033[0m\n", file, line, s, v, e);
3232
exit(-2);
3333
}}
3434
}}

0 commit comments

Comments
 (0)