Commit 5cbb0c91 authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

tests: Introduce a basic testing framework



All tests should go into the new "tests" subdirectory. The idea is
that the separate Makefile in that directory will get invoked via
a top-level "make check".

The tests/Makefile should then take care of running all available
tests, returning an appropriate exit status. Future tests may be
functional, examine code metrics (coverage analysis), or both.

For a start, I'd simply like to check that sunxi-fexc is able to
properly compile all the .fex files from linux-sunxi/sunxi-boards.

(Note: This currently FAILS and will probably require adjustments
to both sunxi-tools and the .fex repository. To work around this,
for now I'm applying patches to fix sunxi-boards.)
Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent dc1b5889
...@@ -58,6 +58,7 @@ PREFIX ?= /usr/local ...@@ -58,6 +58,7 @@ PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin BINDIR ?= $(PREFIX)/bin
.PHONY: all clean tools target-tools install install-tools install-target-tools .PHONY: all clean tools target-tools install install-tools install-target-tools
.PHONY: check
tools: $(TOOLS) $(FEXC_LINKS) tools: $(TOOLS) $(FEXC_LINKS)
target-tools: $(TARGET_TOOLS) target-tools: $(TARGET_TOOLS)
...@@ -94,6 +95,7 @@ install-misc: $(MISC_TOOLS) ...@@ -94,6 +95,7 @@ install-misc: $(MISC_TOOLS)
clean: clean:
make -C tests/ clean
@rm -vf $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) $(MISC_TOOLS) @rm -vf $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) $(MISC_TOOLS)
@rm -vf version.h *.o *.elf *.sunxi *.bin *.nm *.orig @rm -vf version.h *.o *.elf *.sunxi *.bin *.nm *.orig
...@@ -186,3 +188,6 @@ version.h: ...@@ -186,3 +188,6 @@ version.h:
@for x in $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) version.h '*.o' '*.swp'; do \ @for x in $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) version.h '*.o' '*.swp'; do \
echo "$$x"; \ echo "$$x"; \
done | sort -V > $@ done | sort -V > $@
check: $(FEXC_LINKS)
make -C tests/
#
# tests/Makefile
#
BOARDS_URL := https://github.com/linux-sunxi/sunxi-boards/archive/master.zip
BOARDS_DIR := sunxi-boards
check: check_all_fex
check_all_fex: $(BOARDS_DIR)/README
./test_all_fex.sh $(BOARDS_DIR)
# Retrieve and extract sunxi-boards archive (containing all .fex)
$(BOARDS_DIR).zip:
curl -fLsS -o $@ $(BOARDS_URL)
$(BOARDS_DIR)/README: $(BOARDS_DIR).zip
@echo Extracting $< ...
unzip -q $<
mv sunxi-boards-master $(BOARDS_DIR)
touch -r $(BOARDS_DIR) $<
cat patches/*.patch | patch -p1
clean:
rm -rf $(BOARDS_DIR).zip $(BOARDS_DIR)
#!/bin/bash
echo $0 $*
FEX2BIN=../fex2bin
BIN2FEX=../bin2fex
FEX=$1
BIN=${FEX/%.fex/.bin}
REVERSE=${FEX/%.fex/.new}
${FEX2BIN} ${FEX} ${BIN}
See https://github.com/linux-sunxi/sunxi-boards/issues/51
--- orig/sunxi-boards/sys_config/a33/a-star_kv49l.fex
+++ new/sunxi-boards/sys_config/a33/a-star_kv49l.fex
@@ -830,25 +830,25 @@
[Vdevice]
Vdevice_used = 0
-Vdevice_0 = port:P@00<0><0><0><0>
-Vdevice_1 = port:P@00<0><0><0><0>
+;Vdevice_0 = port:P@00<0><0><0><0>
+;Vdevice_1 = port:P@00<0><0><0><0>
[s_uart0]
s_uart_used = 0
-s_uart_tx = port:P@00<0><0><0><0>
-s_uart_rx = port:P@00<0><0><0><0>
+;s_uart_tx = port:P@00<0><0><0><0>
+;s_uart_rx = port:P@00<0><0><0><0>
[s_rsb0]
s_rsb_used = 0
-s_rsb_sck = port:P@00<0><0><0><0>
-s_rsb_sda = port:P@00<0><0><0><0>
+;s_rsb_sck = port:P@00<0><0><0><0>
+;s_rsb_sda = port:P@00<0><0><0><0>
[s_jtag0]
s_jtag_used = 0
-s_jtag_tms = port:P@00<0><0><0><0>
-s_jtag_tck = port:P@00<0><0><0><0>
-s_jtag_tdo = port:P@00<0><0><0><0>
-s_jtag_tdi = port:P@00<0><0><0><0>
+;s_jtag_tms = port:P@00<0><0><0><0>
+;s_jtag_tck = port:P@00<0><0><0><0>
+;s_jtag_tdo = port:P@00<0><0><0><0>
+;s_jtag_tdi = port:P@00<0><0><0><0>
[s_powchk]
s_powchk_used = 0
@@ -875,9 +875,9 @@
[leds_para]
leds_used = 0
-;red_led = port:P@00<0><0><0><0>
-;red_led_active_low = 0
-;green_led_active_low = 0
-;blue_led =
-;blue_led_active_low = 0
+;red_led = port:P@00<0><0><0><0>
+;red_led_active_low = 0
+;green_led_active_low = 0
+;blue_led =
+;blue_led_active_low = 0
#!/bin/sh
FEXFILES=fexfiles.lst
find $1 -name '*.fex' > ${FEXFILES}
while read fex; do
./fextest.sh ${fex} || exit
done <${FEXFILES}
rm -f ${FEXFILES}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment