Skip to content

littlefs: Update to version 1.3 #6179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ env:
--data @- << DATA\n{
"state": "$0",
"description": "$1",
"context": "travis-ci/$NAME/$(python --version)",
"context": "travis-ci/$NAME",
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
}\nDATA'

@@ -145,17 +145,20 @@ matrix:
- sudo chmod a+rw /dev/loop0
- dd if=/dev/zero bs=512 count=2048 of=DISK
- losetup /dev/loop0 DISK
- CFLAGS="-Werror -Wno-format"
script:
# Check that example compiles
- export CFLAGS="-Werror -Wno-format"
- sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
- python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
# Run local littlefs tests
- CFLAGS="-Wno-format" make -C$LITTLEFS/littlefs test QUIET=1
- make -C$LITTLEFS/littlefs test QUIET=1
# Run local littlefs tests with set of variations
- CFLAGS="-Wno-format -DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048" make -C$LITTLEFS/littlefs test QUIET=1
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64"
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
- make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
- make -C$LITTLEFS/littlefs clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
# Self-hosting littlefs fuzz test with littlefs-fuse
- make -Clittlefs_fuse
- littlefs_fuse/lfs --format /dev/loop0
@@ -164,7 +167,30 @@ matrix:
- mkdir MOUNT/littlefs
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
- ls MOUNT/littlefs
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs QUIET=1
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs test_files QUIET=1
# Compile and find the code size with smallest configuration
- cd $TRAVIS_BUILD_DIR/$LITTLEFS/littlefs
- make clean size
CC='arm-none-eabi-gcc -mthumb'
OBJ="$(ls lfs*.o | tr '\n' ' ')"
CFLAGS+="-DLFS_NO{ASSERT,DEBUG,WARN,ERROR}"
| tee sizes
after_success:
# update status if we succeeded, compare with master if possible
- |
CURR=$(tail -n1 sizes | awk '{print $1}')
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
| capture(\"code size is (?<size>[0-9]+)\").size" \
|| echo 0)

STATUSM="Passed, code size is ${CURR}B"
if [ "$PREV" -ne 0 ]
then
STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
fi
- bash -c "$STATUS" success "$STATUSM"

- &mbed-2
env: NAME=mbed2-NXP
7 changes: 3 additions & 4 deletions features/filesystem/littlefs/TESTS/filesystem/dirs/main.cpp
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
#include "unity.h"
#include "utest.h"
#include <stdlib.h>
#include <errno.h>

using namespace utest::v1;

@@ -354,7 +353,7 @@ void test_directory_remove()
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = fs.remove("potato");
TEST_ASSERT_EQUAL(-EINVAL, res);
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
res = fs.remove("potato/sweet");
TEST_ASSERT_EQUAL(0, res);
res = fs.remove("potato/baked");
@@ -536,7 +535,7 @@ void test_directory_rename()
res = fs.mkdir("warmpotato/mushy", 0777);
TEST_ASSERT_EQUAL(0, res);
res = fs.rename("hotpotato", "warmpotato");
TEST_ASSERT_EQUAL(-EINVAL, res);
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
res = fs.remove("warmpotato/mushy");
TEST_ASSERT_EQUAL(0, res);
res = fs.rename("hotpotato", "warmpotato");
@@ -600,7 +599,7 @@ void test_directory_rename()
res = fs.rename("warmpotato/fried", "coldpotato/fried");
TEST_ASSERT_EQUAL(0, res);
res = fs.remove("coldpotato");
TEST_ASSERT_EQUAL(-EINVAL, res);
TEST_ASSERT_EQUAL(-ENOTEMPTY, res);
res = fs.remove("warmpotato");
TEST_ASSERT_EQUAL(0, res);
res = fs.unmount();
Original file line number Diff line number Diff line change
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <errno.h>
#include "mbed.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
#include <stdlib.h>
#include <errno.h>

using namespace utest::v1;

@@ -354,7 +354,7 @@ void test_directory_remove()
res = fs.mount(&bd);
TEST_ASSERT_EQUAL(0, res);
res = remove("/fs/" "potato");
TEST_ASSERT_EQUAL(EINVAL, errno);
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
res = remove("/fs/" "potato/sweet");
TEST_ASSERT_EQUAL(0, res);
res = remove("/fs/" "potato/baked");
@@ -536,7 +536,7 @@ void test_directory_rename()
res = mkdir("/fs/" "warmpotato/mushy", 0777);
TEST_ASSERT_EQUAL(0, res);
res = rename("/fs/" "hotpotato", "/fs/" "warmpotato");
TEST_ASSERT_EQUAL(EINVAL, errno);
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
res = remove("/fs/" "warmpotato/mushy");
TEST_ASSERT_EQUAL(0, res);
res = rename("/fs/" "hotpotato", "/fs/" "warmpotato");
@@ -600,7 +600,7 @@ void test_directory_rename()
res = rename("/fs/" "warmpotato/fried", "/fs/" "coldpotato/fried");
TEST_ASSERT_EQUAL(0, res);
res = remove("/fs/" "coldpotato");
TEST_ASSERT_EQUAL(EINVAL, errno);
TEST_ASSERT_EQUAL(ENOTEMPTY, errno);
res = remove("/fs/" "warmpotato");
TEST_ASSERT_EQUAL(0, res);
res = fs.unmount();
9 changes: 9 additions & 0 deletions features/filesystem/littlefs/littlefs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Compilation output
*.o
*.d
*.a

# Testing things
blocks/
lfs
test.c
Loading