Skip to content

Commit 47db7a7

Browse files
committed
Added sanity check for compiling example
1 parent 476915f commit 47db7a7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
script:
2+
# make sure example can at least compile
3+
- sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c &&
4+
CFLAGS='
5+
-Duser_provided_block_device_read=NULL
6+
-Duser_provided_block_device_prog=NULL
7+
-Duser_provided_block_device_erase=NULL
8+
-Duser_provided_block_device_sync=NULL
9+
-include stdio.h -Werror' make
10+
11+
# run tests
212
- CFLAGS="-DLFS_READ_SIZE=16 -DLFS_PROG_SIZE=16" make test
313
- CFLAGS="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make test
414
- CFLAGS="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make test

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ int main(void) {
7777

7878
// update boot count
7979
boot_count += 1;
80-
printf("boot_count: %ld\n", boot_count);
8180
lfs_file_rewind(&lfs, &file);
8281
lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count));
8382

@@ -86,6 +85,9 @@ int main(void) {
8685

8786
// release any resources we were using
8887
lfs_unmount(&lfs);
88+
89+
// print the boot count
90+
printf("boot_count: %d\n", boot_count);
8991
}
9092
```
9193

0 commit comments

Comments
 (0)