forked from starnakin/IronGOLEM
add: test init
This commit is contained in:
parent
c928153a54
commit
37d2b05896
4
test.sh
Executable file
4
test.sh
Executable file
@ -0,0 +1,4 @@
|
||||
cat src/$1.🗿 tests/$1.🗿 tests/test.🗿 >tmp.🗿
|
||||
golemc tmp.🗿 > tmp.asm
|
||||
orgaasm tmp.asm tmp.rom
|
||||
orgaemu tmp.rom
|
31
tests/test.🗿
Normal file
31
tests/test.🗿
Normal file
@ -0,0 +1,31 @@
|
||||
putstr(str){
|
||||
local i;
|
||||
i = 0;
|
||||
loop {
|
||||
if ([str + i] == 0)
|
||||
return;
|
||||
wrt [str + i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
test(value, reach_value, error_message)
|
||||
{
|
||||
putstr(name);
|
||||
if (value != reach_value)
|
||||
{
|
||||
putstr(": ERROR: ");
|
||||
putstr(", ");
|
||||
putstr(error_message);
|
||||
putstr(" [");
|
||||
putstr(reach_value);
|
||||
putstr(" != ");
|
||||
putstr(value);
|
||||
putstr("]");
|
||||
}
|
||||
else
|
||||
{
|
||||
putstr(": OK: ");
|
||||
}
|
||||
wrt '\n';
|
||||
}
|
Loading…
Reference in New Issue
Block a user