From 47db7a737060045f837408ae69736cc58dd4449c Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sun, 16 Jul 2017 12:42:17 -0500 Subject: [PATCH] Added sanity check for compiling example --- .travis.yml | 10 ++++++++++ README.md | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0936b29..00f5665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,14 @@ script: + # make sure example can at least compile + - sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c && + CFLAGS=' + -Duser_provided_block_device_read=NULL + -Duser_provided_block_device_prog=NULL + -Duser_provided_block_device_erase=NULL + -Duser_provided_block_device_sync=NULL + -include stdio.h -Werror' make + + # run tests - CFLAGS="-DLFS_READ_SIZE=16 -DLFS_PROG_SIZE=16" make test - CFLAGS="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make test - CFLAGS="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make test diff --git a/README.md b/README.md index 0ae1cc6..e9e63b3 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ int main(void) { // update boot count boot_count += 1; - printf("boot_count: %ld\n", boot_count); lfs_file_rewind(&lfs, &file); lfs_file_write(&lfs, &file, &boot_count, sizeof(boot_count)); @@ -86,6 +85,9 @@ int main(void) { // release any resources we were using lfs_unmount(&lfs); + + // print the boot count + printf("boot_count: %d\n", boot_count); } ```