9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f290085ada3f7ae930a9cdc1242bbb757cfb88e2
parent 82a782caae33d0420624e7b76f23c02eb10d2043
Author: Dimitris Papastamos <dimitris.papastamos@arm.com>
Date:   Tue, 30 Oct 2018 14:47:29 +0000

[test] Fix test1 after recent changes

We now have a separate dispatcher table for the rom and ram firmware.
This test needs to be adjusted to test all combinations for RMU
commands for both the rom and ram firmware dispatcher.

Change-Id: I9bf747115ae1790877f8dbfd383cacf1266b8f0f
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>

Diffstat:
Mtest/test1/Makefile | 17+++++++++++------
Mtest/test1/test.c | 7+++++--
Mtest/test1/test.sh | 13++++++++++---
3 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/test/test1/Makefile b/test/test1/Makefile @@ -70,16 +70,21 @@ LIBOBJ = hdl_RMU_System_InterfaceVersion.o \ hdl_RMU_Granule_ImportInit.o \ hdl_RMU_Granule_Import.o \ -OBJS = $(ARCHDIR)/crt-$(SYS).o $(SRCDIR)/romfw/builtin.o test.o -LIBS = -lhdl -lc -LIBDEP = libhdl.a $(LIBDIR)/libc.a +ROMOBJS = $(ARCHDIR)/crt-$(SYS).o $(SRCDIR)/romfw/builtin.o test.o +RAMOBJS = $(ARCHDIR)/crt-$(SYS).o $(SRCDIR)/ramfw/builtin.o test.o +LIBS = -lhdl -lc +LIBDEP = libhdl.a $(LIBDIR)/libc.a -TARGET = run +TARGET = romfw ramfw all: $(TARGET) +run: $(TARGET) -$(TARGET): $(OBJS) $(LIBDEP) - $(LD) -L. $(RCODE_LDFLAGS) $(OBJS) $(LIBS) -o $@ +romfw: $(ROMOBJS) $(LIBDEP) + $(LD) -L. $(RCODE_LDFLAGS) $(ROMOBJS) $(LIBS) -o $@ + +ramfw: $(RAMOBJS) $(LIBDEP) + $(LD) -L. $(RCODE_LDFLAGS) $(RAMOBJS) $(LIBS) -o $@ libhdl.a: $(LIBOBJ) $(AR) $(ARFLAGS) $@ $? diff --git a/test/test1/test.c b/test/test1/test.c @@ -1,9 +1,12 @@ #include <assert.h> +#include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <rcode.h> +jmp_buf env; + int main(int argc, char *argv[]) { @@ -18,7 +21,7 @@ main(int argc, char *argv[]) cmd.func = j; bss->cmd = &cmd; dbg("%u\t%u\t", i, j); - if (!setjmp(cmd.recover)) + if (!setjmp(env)) rmc(&cmd); } } @@ -41,5 +44,5 @@ dopanic(void) void swtch(struct trapframe *fp) { - panic("swtch() not implemented"); + longjmp(env, 1); } diff --git a/test/test1/test.sh b/test/test1/test.sh @@ -6,11 +6,14 @@ tmp1=tmp1.$$ tmp2=tmp2.$$ trap 'r=$?;rm -f $tmp1 $tmp2;exit $r' EXIT HUP INT QUIT TERM -$EMUCMD ./run | grep -v 'bad RMC' | sed 's/hdl_//' > $tmp1 -sed 's/\./_/g' < $SCRIPTDIR/rmu.cmd > $tmp2 +tst() { +$EMUCMD $cmd | grep -v 'bad RMC' | sed 's/hdl_//' > $tmp1 +awk -v type=$1 '$0 ~ type {print $1 "\t" $2 "\t" $3}' < $SCRIPTDIR/rmu.cmd | +sed -e 's/\./_/g' > $tmp2 + diff -u $tmp1 $tmp2 -$EMUCMD ./run | awk ' +$EMUCMD $cmd | awk ' /[0-9]+ [0-9]+/ {rmc[$1, $2] = 1} END { for (i = 0; i < 256; i++) { @@ -22,3 +25,7 @@ END { } } }' +} + +cmd=./romfw tst rom +cmd=./ramfw tst ram