File tree Expand file tree Collapse file tree
memory-bucket-optimizer/optimizer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,13 @@ debug: all
3535 $(CC ) -o $@ $< $(CFLAGS ) $(LIBS )
3636
3737clean :
38- rm -f $(TARGETS )
38+ rm -f $(TARGETS ) size.log debug.log
3939
40- check : SHELL := /bin/bash
41- check : .SHELLFLAGS := -eo pipefail -c
40+ # Redirect then grep (no pipe) so a nonzero exit fails the recipe on its own and
41+ # it works under BSD make too, where SHELLFLAGS pipefail is unavailable.
4242check : size-calculation debug-callback-example
43- ./size-calculation | grep -q ' Checking out bucket 4 size of 25...ok'
44- ./debug-callback-example | grep -q ' bucket size used was'
43+ ./size-calculation > size.log
44+ grep -q ' Checking out bucket 4 size of 25...ok' size.log
45+ ./debug-callback-example > debug.log
46+ grep -q ' bucket size used was' debug.log
4547 @echo " PASS: staticmemory checks"
Original file line number Diff line number Diff line change @@ -29,14 +29,12 @@ memory_bucket_optimizer: memory_bucket_optimizer.c
2929 $(CC ) $(CFLAGS ) -o memory_bucket_optimizer memory_bucket_optimizer.c $(LDFLAGS )
3030
3131clean :
32- rm -f memory_bucket_optimizer
32+ rm -f memory_bucket_optimizer mem.log
3333
3434.PHONY : all clean check
3535
36- check : SHELL := /bin/bash
37- check : .SHELLFLAGS := -eo pipefail -c
3836check : memory_bucket_optimizer
3937 $(MAKE ) -C ../.. > /dev/null
4038 ../../debug-callback-example > mem.log 2>&1
41- ./memory_bucket_optimizer mem.log | grep -q ' Optimization Summary: '
39+ ./memory_bucket_optimizer mem.log
4240 @echo " PASS: staticmemory-bucket-optimizer checks"
You can’t perform that action at this time.
0 commit comments