From: j8takagi Date: Mon, 4 Apr 2011 14:03:39 +0000 (+0900) Subject: テストの整理 X-Git-Tag: v0.1p34~1 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4027d87a62ceedf7c387cc078506f14ac9d958e3;p=YACASL2.git テストの整理 --- diff --git a/as/err/err_201.casl b/as/err/err_201.casl index 00f0bcb..55ce20e 100644 --- a/as/err/err_201.casl +++ b/as/err/err_201.casl @@ -1,4 +1,4 @@ -;;; casl2 -M8 err_201.casl +;;; casl2 -M8 err_201.casl MAIN START JUMP #FFFF FIN RET diff --git a/as/err/err_202.casl b/as/err/err_202.casl index af6d57e..a28df2c 100644 --- a/as/err/err_202.casl +++ b/as/err/err_202.casl @@ -1,5 +1,8 @@ -;;; casl2 -M8 err_202.casl +;;; casl2 -M32 err_202.casl MAIN START - POP GR1 + RPUSH + LD GR0,A + RPOP RET +A DC 7 END diff --git a/as/err/err_203.casl b/as/err/err_203.casl index 10d97d2..163af27 100644 --- a/as/err/err_203.casl +++ b/as/err/err_203.casl @@ -1,8 +1,5 @@ -;;; casl2 -M32 err_203.casl +;;; casl2 -M8 err_203.casl MAIN START - RPUSH - LD GR0,A - RPOP + POP GR1 RET -A DC 7 END diff --git a/test/system/casl2/err_201/0.txt b/test/system/casl2/err_201/0.txt new file mode 100644 index 0000000..30deaa3 --- /dev/null +++ b/test/system/casl2/err_201/0.txt @@ -0,0 +1,6 @@ +;;; casl2 -M8 err_201.casl +MAIN START + JUMP #FFFF +FIN RET + END +Execute error - 201: PR:#FFFF: Program Register (PR) - memory overflow diff --git a/test/system/casl2/err_204/Makefile b/test/system/casl2/err_201/Makefile similarity index 100% rename from test/system/casl2/err_204/Makefile rename to test/system/casl2/err_201/Makefile diff --git a/test/system/casl2/err_201/cmd b/test/system/casl2/err_201/cmd new file mode 100755 index 0000000..54a894d --- /dev/null +++ b/test/system/casl2/err_201/cmd @@ -0,0 +1,3 @@ +YACASL2DIR=../../../.. +cat $YACASL2DIR/as/err/err_201.casl +$YACASL2DIR/casl2 -M8 $YACASL2DIR/as/err/err_201.casl diff --git a/test/system/casl2/err_202/0.txt b/test/system/casl2/err_202/0.txt index 34ff38c..5948cf1 100644 --- a/test/system/casl2/err_202/0.txt +++ b/test/system/casl2/err_202/0.txt @@ -1,10 +1,9 @@ -;;; casl2 -M32 err_202.casl /dev/null && ../../../../comet2 -td a.comet +make a.o >/dev/null +../../../../comet2 -td a.o diff --git a/test/system/comet2/direct/create_a.c b/test/system/comet2/direct/create_a.c index f6ca333..b8fa5b7 100644 --- a/test/system/comet2/direct/create_a.c +++ b/test/system/comet2/direct/create_a.c @@ -10,7 +10,7 @@ int main() { FILE *fp; const WORD w[] = {0x1010, 0x0005, 0x2210, 0x0006, 0x8100, 0x0003, 0x0001}; - const char *f = "a.comet"; + const char *f = "a.o"; if((fp = fopen(f, "w")) == NULL) { perror(f); diff --git a/test/system/comet2/err_201/cmd b/test/system/comet2/err_201/cmd index 83d9bdf..61f1c82 100755 --- a/test/system/comet2/err_201/cmd +++ b/test/system/comet2/err_201/cmd @@ -1,3 +1,4 @@ -../../../../casl2 -O ../../../../as/err/err_201.casl -../../../../comet2 -M8 a.o +YACASL2DIR=../../../.. +$YACASL2DIR/casl2 -O $YACASL2DIR/as/err/err_201.casl +$YACASL2DIR/comet2 -M8 a.o rm -f a.o diff --git a/test/system/comet2/err_202/cmd b/test/system/comet2/err_202/cmd index 3cad991..2483303 100755 --- a/test/system/comet2/err_202/cmd +++ b/test/system/comet2/err_202/cmd @@ -1,3 +1,4 @@ -../../../../casl2 -O ../../../../as/err/err_202.casl -../../../../comet2 -M32 a.o +YACASL2DIR=../../../.. +$YACASL2DIR/casl2 -O $YACASL2DIR/as/err/err_202.casl +$YACASL2DIR/comet2 -M32 a.o rm -f a.o diff --git a/test/system/comet2/err_204/0.txt b/test/system/comet2/err_204/0.txt index dcaf9a2..f28a196 100644 --- a/test/system/comet2/err_204/0.txt +++ b/test/system/comet2/err_204/0.txt @@ -1 +1 @@ -Execute error - 210: PR:#0002: not command code of COMET II +Execute error - 204: PR:#0002: OP in word #1 - not command code diff --git a/test/system/comet2/err_204/Makefile b/test/system/comet2/err_204/Makefile index 894b127..362c066 100644 --- a/test/system/comet2/err_204/Makefile +++ b/test/system/comet2/err_204/Makefile @@ -5,15 +5,15 @@ CC := gcc CFLAGS := -Wall INCLUDEDIR := ../../../../include -.INTERMEDIATE: create_a a.comet +.INTERMEDIATE: create_a a.o -a.comet: create_a +a.o: create_a ./$^ create_a: create_a.c $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ -$(CMD_FILE): a.comet +$(CMD_FILE): a.o clean: clean0 diff --git a/test/system/comet2/err_204/cmd b/test/system/comet2/err_204/cmd index 3d423e8..960a2a6 100755 --- a/test/system/comet2/err_204/cmd +++ b/test/system/comet2/err_204/cmd @@ -1 +1,2 @@ -make a.comet >/dev/null && ../../../../comet2 a.comet +make a.o >/dev/null +../../../../comet2 a.o diff --git a/test/system/comet2/err_204/create_a.c b/test/system/comet2/err_204/create_a.c index 619d795..9ed8d03 100644 --- a/test/system/comet2/err_204/create_a.c +++ b/test/system/comet2/err_204/create_a.c @@ -10,7 +10,7 @@ int main() { FILE *fp; const WORD w[] = {0x1010, 0x0005, 0x2810, 0x0006, 0x8100, 0x0003, 0x0001}; - const char *f = "a.comet"; + const char *f = "a.o"; if((fp = fopen(f, "w")) == NULL) { perror(f); diff --git a/test/system/comet2/err_205/0.txt b/test/system/comet2/err_205/0.txt new file mode 100644 index 0000000..2622ca0 --- /dev/null +++ b/test/system/comet2/err_205/0.txt @@ -0,0 +1 @@ +Execute error - 205: PR:#0002: r/r1 in word #1 - not GR diff --git a/test/system/comet2/err_205/Makefile b/test/system/comet2/err_205/Makefile new file mode 100644 index 0000000..4bfe864 --- /dev/null +++ b/test/system/comet2/err_205/Makefile @@ -0,0 +1,22 @@ +include ../Define.mk +include ../Test.mk + +CC := gcc +CFLAGS := -Wall +INCLUDEDIR := ../../../../include + +.INTERMEDIATE: create_a a.o + +a.o: create_a + ./$^ + +create_a: create_a.c + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +$(CMD_FILE): a.o + +clean: clean0 + +clean0: + @rm -f create_a + @rm -f a.o diff --git a/test/system/comet2/err_205/cmd b/test/system/comet2/err_205/cmd new file mode 100755 index 0000000..960a2a6 --- /dev/null +++ b/test/system/comet2/err_205/cmd @@ -0,0 +1,2 @@ +make a.o >/dev/null +../../../../comet2 a.o diff --git a/test/system/comet2/err_205/create_a.c b/test/system/comet2/err_205/create_a.c new file mode 100644 index 0000000..3f86464 --- /dev/null +++ b/test/system/comet2/err_205/create_a.c @@ -0,0 +1,22 @@ +#include +#include +#include "cmem.h" +#include "word.h" + +/** + * 引数で指定したファイルにアセンブル結果を書込 + */ +int main() +{ + FILE *fp; + const WORD w[] = {0x1010, 0x0005, 0x22f0, 0x0006, 0x8100, 0x0003, 0x0001}; + const char *f = "a.o"; + + if((fp = fopen(f, "w")) == NULL) { + perror(f); + exit(-1); + } + fwrite(w, sizeof(WORD), ARRAYSIZE(w), fp); + fclose(fp); + return 0; +} diff --git a/test/system/comet2/err_205/desc.txt b/test/system/comet2/err_205/desc.txt new file mode 100644 index 0000000..03ce0ff --- /dev/null +++ b/test/system/comet2/err_205/desc.txt @@ -0,0 +1 @@ +エラー205の発生 diff --git a/test/system/comet2/err_206/0.txt b/test/system/comet2/err_206/0.txt new file mode 100644 index 0000000..8a22601 --- /dev/null +++ b/test/system/comet2/err_206/0.txt @@ -0,0 +1 @@ +Execute error - 206: PR:#0002: x/r2 in word #1 - not GR diff --git a/test/system/comet2/err_206/Makefile b/test/system/comet2/err_206/Makefile new file mode 100644 index 0000000..4bfe864 --- /dev/null +++ b/test/system/comet2/err_206/Makefile @@ -0,0 +1,22 @@ +include ../Define.mk +include ../Test.mk + +CC := gcc +CFLAGS := -Wall +INCLUDEDIR := ../../../../include + +.INTERMEDIATE: create_a a.o + +a.o: create_a + ./$^ + +create_a: create_a.c + $(CC) $(CFLAGS) -I $(INCLUDEDIR) -o $@ $^ + +$(CMD_FILE): a.o + +clean: clean0 + +clean0: + @rm -f create_a + @rm -f a.o diff --git a/test/system/comet2/err_206/cmd b/test/system/comet2/err_206/cmd new file mode 100755 index 0000000..960a2a6 --- /dev/null +++ b/test/system/comet2/err_206/cmd @@ -0,0 +1,2 @@ +make a.o >/dev/null +../../../../comet2 a.o diff --git a/test/system/comet2/err_206/create_a.c b/test/system/comet2/err_206/create_a.c new file mode 100644 index 0000000..b63a28c --- /dev/null +++ b/test/system/comet2/err_206/create_a.c @@ -0,0 +1,22 @@ +#include +#include +#include "cmem.h" +#include "word.h" + +/** + * 引数で指定したファイルにアセンブル結果を書込 + */ +int main() +{ + FILE *fp; + const WORD w[] = {0x1010, 0x0005, 0x220f, 0x0006, 0x8100, 0x0003, 0x0001}; + const char *f = "a.o"; + + if((fp = fopen(f, "w")) == NULL) { + perror(f); + exit(-1); + } + fwrite(w, sizeof(WORD), ARRAYSIZE(w), fp); + fclose(fp); + return 0; +} diff --git a/test/system/comet2/err_206/desc.txt b/test/system/comet2/err_206/desc.txt new file mode 100644 index 0000000..269440b --- /dev/null +++ b/test/system/comet2/err_206/desc.txt @@ -0,0 +1 @@ +エラー206の発生 diff --git a/test/system/comet2/err_207/0.txt b/test/system/comet2/err_207/0.txt new file mode 100644 index 0000000..be06bec --- /dev/null +++ b/test/system/comet2/err_207/0.txt @@ -0,0 +1 @@ +Execute error - 207: PR:#0001: address in word #2 - out of memory diff --git a/test/system/comet2/err_207/Makefile b/test/system/comet2/err_207/Makefile new file mode 100644 index 0000000..b6dac59 --- /dev/null +++ b/test/system/comet2/err_207/Makefile @@ -0,0 +1,2 @@ +include ../Define.mk +include ../Test.mk diff --git a/test/system/comet2/err_207/cmd b/test/system/comet2/err_207/cmd new file mode 100755 index 0000000..fc8b8dc --- /dev/null +++ b/test/system/comet2/err_207/cmd @@ -0,0 +1,4 @@ +YACASL2DIR=../../../.. +$YACASL2DIR/casl2 -O $YACASL2DIR/as/err/err_207.casl +$YACASL2DIR/comet2 -M8 a.o +rm -f a.o diff --git a/test/system/comet2/err_208/0.txt b/test/system/comet2/err_208/0.txt index ab0ed76..5b9f4fb 100644 --- a/test/system/comet2/err_208/0.txt +++ b/test/system/comet2/err_208/0.txt @@ -1 +1 @@ -Execute error - 202: SVC input - out of Input memory +Execute error - 208: SVC input - memory overflow diff --git a/test/system/comet2/err_208/cmd b/test/system/comet2/err_208/cmd index fec741a..37159b8 100755 --- a/test/system/comet2/err_208/cmd +++ b/test/system/comet2/err_208/cmd @@ -1,3 +1,3 @@ -../../../../casl2 -O ../../../../as/err/err_202.casl +../../../../casl2 -O ../../../../as/err/err_208.casl ../../../../comet2 -M32 a.o