mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 08:42:40 +01:00 
			
		
		
		
	Moved -Werror flag to CI only
The most useful part of -Werror is preventing code from being merged that has warnings. However it is annoying for users who may have different compilers with different warnings. Limiting -Werror to CI only covers the main concern about warnings without limiting users.
This commit is contained in:
		
							
								
								
									
										13
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								.travis.yml
									
									
									
									
									
								
							| @@ -1,20 +1,23 @@ | |||||||
|  | env: | ||||||
|  |     - CFLAGS=-Werror | ||||||
|  |  | ||||||
| script: | script: | ||||||
|     # make sure example can at least compile |     # make sure example can at least compile | ||||||
|     - sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c && |     - sed -n '/``` c/,/```/{/```/d; p;}' README.md > test.c && | ||||||
|       CFLAGS=' |       make all size CFLAGS+=" | ||||||
|         -Duser_provided_block_device_read=NULL |         -Duser_provided_block_device_read=NULL | ||||||
|         -Duser_provided_block_device_prog=NULL |         -Duser_provided_block_device_prog=NULL | ||||||
|         -Duser_provided_block_device_erase=NULL |         -Duser_provided_block_device_erase=NULL | ||||||
|         -Duser_provided_block_device_sync=NULL |         -Duser_provided_block_device_sync=NULL | ||||||
|         -include stdio.h -Werror' make all size |         -include stdio.h" | ||||||
|  |  | ||||||
|     # run tests |     # run tests | ||||||
|     - make test QUIET=1 |     - make test QUIET=1 | ||||||
|  |  | ||||||
|     # run tests with a few different configurations |     # run tests with a few different configurations | ||||||
|     - CFLAGS="-DLFS_READ_SIZE=1   -DLFS_PROG_SIZE=1"       make test QUIET=1 |     - make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1      -DLFS_PROG_SIZE=1" | ||||||
|     - CFLAGS="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"     make test QUIET=1 |     - make test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512    -DLFS_PROG_SIZE=512" | ||||||
|     - CFLAGS="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048" make test QUIET=1 |     - make test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048" | ||||||
|  |  | ||||||
|     # self-host with littlefs-fuse for fuzz test |     # self-host with littlefs-fuse for fuzz test | ||||||
|     - make -C littlefs-fuse |     - make -C littlefs-fuse | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile
									
									
									
									
									
								
							| @@ -14,15 +14,15 @@ TEST := $(patsubst tests/%.sh,%,$(wildcard tests/test_*)) | |||||||
| SHELL = /bin/bash -o pipefail | SHELL = /bin/bash -o pipefail | ||||||
|  |  | ||||||
| ifdef DEBUG | ifdef DEBUG | ||||||
| CFLAGS += -O0 -g3 | override CFLAGS += -O0 -g3 | ||||||
| else | else | ||||||
| CFLAGS += -Os | override CFLAGS += -Os | ||||||
| endif | endif | ||||||
| ifdef WORD | ifdef WORD | ||||||
| CFLAGS += -m$(WORD) | override CFLAGS += -m$(WORD) | ||||||
| endif | endif | ||||||
| CFLAGS += -I. | override CFLAGS += -I. | ||||||
| CFLAGS += -std=c99 -Wall -pedantic | override CFLAGS += -std=c99 -Wall -pedantic | ||||||
|  |  | ||||||
|  |  | ||||||
| all: $(TARGET) | all: $(TARGET) | ||||||
|   | |||||||
| @@ -33,8 +33,7 @@ def generate(test): | |||||||
|         pass |         pass | ||||||
|  |  | ||||||
| def compile(): | def compile(): | ||||||
|     os.environ['CFLAGS'] = os.environ.get('CFLAGS', '') + ' -Werror' |     subprocess.check_call(['make', '--no-print-directory', '-s']) | ||||||
|     subprocess.check_call(['make', '--no-print-directory', '-s'], env=os.environ) |  | ||||||
|  |  | ||||||
| def execute(): | def execute(): | ||||||
|     subprocess.check_call(["./lfs"]) |     subprocess.check_call(["./lfs"]) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user