Testing improvements

Add a new `test' rule that tests all three combinations (128, 192 and
256).  This required the re-ordering of ifdef's in test.c, similar to
that in aes.[ch].  test.elf now exits with the number of tests which
failed, so the test rule in Makefile will notify properly.

Remove the unused variables `buf' and `buf2'.

Also, add a .gitignore file.
This commit is contained in:
Kevin Layer
2018-07-26 09:58:44 -07:00
parent 4b97e75fb9
commit 7f211fb4f4
3 changed files with 119 additions and 115 deletions

View File

@@ -5,6 +5,12 @@ CC = gcc
LD = gcc
CFLAGS = -Wall -Os -c
LDFLAGS = -Wall -Os -Wl,-Map,test.map
ifdef AES192
CFLAGS += -DAES192=1
endif
ifdef AES256
CFLAGS += -DAES256=1
endif
OBJCOPYFLAFS = -j .text -O ihex
OBJCOPY = objcopy
@@ -24,11 +30,11 @@ test.hex : test.elf
$(OBJCOPY) ${OBJCOPYFLAFS} $< $@
test.o : test.c aes.h aes.o
echo [CC] $@
echo [CC] $@ $(CFLAGS)
$(CC) $(CFLAGS) -o $@ $<
aes.o : aes.c aes.h
echo [CC] $@
echo [CC] $@ $(CFLAGS)
$(CC) $(CFLAGS) -o $@ $<
test.elf : aes.o test.o
@@ -39,5 +45,10 @@ test.elf : aes.o test.o
clean:
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
test:
make clean && make && ./test.elf
make clean && make AES192=1 && ./test.elf
make clean && make AES256=1 && ./test.elf
lint:
$(call SPLINT)