Skip to content

Commit 49af84a

Browse files
committed
lab-1: Improve automatic test in Makefile
Test the fibonacci function for input = 1 to 100.
1 parent 38fd546 commit 49af84a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lab-1/Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ clean:
2424
rm -f $(objects) fibseq
2525

2626
QEMU_CMD = qemu-arm -L /usr/arm-linux-gnueabihf ./fibseq &
27-
CMD = yes 9 | $(call QEMU_CMD) && sleep 1
2827
qemu: fibseq
29-
@yes 5 | $(call QEMU_CMD)
30-
@sleep 1
31-
@yes 6 | $(call QEMU_CMD)
32-
@sleep 1
33-
@yes 7 | $(call QEMU_CMD)
34-
@sleep 1
28+
@test=1 ; while [ $$test -le 100 ] ; do \
29+
yes $$test | $(call QEMU_CMD) \
30+
sleep 1; \
31+
test=`expr $$test + 1`; \
32+
done
33+

0 commit comments

Comments
 (0)