Add the new test suite.

This test suite has been in use for a long time now, in place of the obsolete and unmanageable testparser.py and testfuncs.py. It verifies the complete optimizer output to stdout and stderr, to ensure that the output matches the expectations.

See unit_tests/README.txt for more info.
This commit is contained in:
Sei Lisa 2019-01-04 20:26:26 +01:00
parent 7fbde0269c
commit 1867dc78e7
547 changed files with 11680 additions and 0 deletions

View file

@ -0,0 +1,20 @@
[ (string)-.5e-6
, (string)((float)"-0x1.0C6F7Ap-21")
, (string)((float)"0x1.0C6F7Ap-21")
, (string)((float)"-0x1.0C6F7Cp-21")
, (string)((float)"0x1.0C6F7Cp-21")
, (string)<.5e-5,(float)"-0x1.4F8B58p-18",(float)"0x1.4F8B58p-18">
, (string)<(float)"-0x1.4F8B5Ap-18", (float)"0x1.4F8B5Ap-18", 9.999999>
, (string)-123456789.
, (string)-123456784.
, (string)-123456740.
, (string)-12345.674
, (string)-1.2345674
, (string)-1.2345675
, (string)<-123456740., -12345.674, -1.2345674, -1.234564>
, (string)[<-123456750., -12345.675, -12345.676>]
, (string)<-123456750., -12345.675, -12345.676, -12.345675>
, (string)<1234567.5, 1234567.4, 123456.75, 123456.74>
, (string)[<1234567.5, 1234567.4, 0.>]
, (string)<12345675., 12345674., 9.99999>
]

View file

@ -0,0 +1,20 @@
[ "-0.000000"
, "-0.000000"
, "0.000000"
, "-0.000001"
, "0.000001"
, "<0.00000, -0.00000, 0.00000>"
, "<-0.00001, 0.00001, 10.00000>"
, "-123456792.000000"
, "-123456784.000000"
, "-123456736.000000"
, "-12345.673828"
, "-1.234567"
, "-1.234568"
, "<-123456736.00000, -12345.67383, -1.23457, -1.23456>"
, "<-123456752.000000, -12345.674805, -12345.675781>"
, "<-123456752.00000, -12345.67480, -12345.67578, -12.34568>"
, "<1234567.50000, 1234567.37500, 123456.75000, 123456.74219>"
, "<1234567.500000, 1234567.375000, 0.000000>"
, "<12345675.00000, 12345674.00000, 9.99999>"
]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,lso,expr,addstrings -

View file

@ -0,0 +1,10 @@
default
{
state_entry()
{
if ([]) llOwnerSay("[]");
if ([""]) llOwnerSay("[\"\"]");
if (["",""]) llOwnerSay("[\"\",\"\"]");
llOwnerSay((string)("a"!="b"));
}
}

View file

@ -0,0 +1,8 @@
default
{
state_entry()
{
llOwnerSay("[\"\",\"\"]");
llOwnerSay("-1");
}
}

View file

@ -0,0 +1 @@
main.py -O -dcr,lso -

View file

@ -0,0 +1,3 @@
[ (float)"1e38"
, (float)"-1e38"
]

View file

@ -0,0 +1 @@
[1e38, -1e38]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,lso,expr,addstrings -

View file

@ -0,0 +1,16 @@
// SCR-295: LSO global list declarations with keys generate string entries
// It's apparently a consequence of SVC-1710 together with the fact that global
// lists reuse the values verbatim, just like type casting to list does.
// TODO: The optim. that'd allow using llGetListEntryType is not implemented.
// (When a list/vector/rot. variable is only read and not written, use the
// constant value to call the function, rather than the variable, but careful
// with llList2List etc.: ensure that the optimized result isn't bigger than
// the unoptimized input)
key k = TEXTURE_BLANK;
list L = [k,""];
default{timer(){
llOwnerSay((string)llGetListEntryType(L, 0));
llOwnerSay((string)llListFindList(L, (list)k)); // in LSO, this says TYPE_STRING
}}

View file

@ -0,0 +1,11 @@
key k = "5748decc-f629-461c-9a36-a35a221fe21f";
list L = [k, ""];
default
{
timer()
{
llOwnerSay((string)llGetListEntryType(L, 0));
llOwnerSay((string)llListFindList(L, (list)k));
}
}

View file

@ -0,0 +1 @@
main.py -O clear,lso,optimize,constfold -

View file

@ -0,0 +1 @@
ELSONotSupported: Byte strings not supported

View file

@ -0,0 +1 @@
llEscapeURL(llUnescapeURL("%80%C3"))

View file

@ -0,0 +1 @@
main.py -O -dcr,lso,expr -

View file

@ -0,0 +1,7 @@
[ llList2Key([], 0)
, llList2Key([""], 1)
, llList2Key(["a"], 0)
, llList2Key([2], 0)
, llList2Key([<1,0,0>],0)
, llList2Key(llGetObjectDetails(llGetKey(), (list)OBJECT_SCRIPT_MEMORY), 0)
]

View file

@ -0,0 +1,7 @@
[ ((key)"00000000-0000-0000-0000-000000000000")
, ((key)"00000000-0000-0000-0000-000000000000")
, ((key)"a")
, ((key)"00000000-0000-0000-0000-000000000000")
, ((key)"00000000-0000-0000-0000-000000000000")
, ((key)"00000000-0000-0000-0000-000000000000")
]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,addstrings,expr,lso -

View file

@ -0,0 +1,3 @@
[ llListFindList([], [])
, llListFindList([3], [])
]

View file

@ -0,0 +1 @@
[-1, 0]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,addstrings,expr,lso -

View file

@ -0,0 +1,3 @@
[ llAbs(-2147483648)
, llAbs(0)
]

View file

@ -0,0 +1 @@
[-2147483648, 0]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,addstrings,expr,lso -

View file

@ -0,0 +1,15 @@
default
{
timer()
{
llSetPrimitiveParams(
[ [] != []
, [""] != []
, [1] != []
, [] != [1]
, [""] == []
, [] == []
]
);
}
}

View file

@ -0,0 +1,14 @@
default
{
timer()
{
llSetPrimitiveParams(
[ 0
, 1
, 1
, ((integer)-1)
, 0
, 1
]);
}
}

View file

@ -0,0 +1 @@
main.py -O lso,-listadd -

View file

@ -0,0 +1,12 @@
default
{
timer()
{
llSetPrimitiveParams(
[ llGetListEntryType((list)((key)""),0) // TYPE_STRING in LSO
, llGetListEntryType((list)((string)llList2Key([],0)),0) // TYPE_KEY
, llGetListEntryType([] + (key)"",0) // TYPE_KEY (does it right)
, llGetListEntryType([] + (string)llList2Key([],0),0) // TYPE_KEY
]);
}
}

View file

@ -0,0 +1,7 @@
default
{
timer()
{
llSetPrimitiveParams([3, 4, 4, 4]);
}
}

View file

@ -0,0 +1 @@
main.py -O lso -

View file

@ -0,0 +1 @@
Not implemented. TODO: Implement.

View file

@ -0,0 +1 @@
ELSONotSupported: Byte strings not supported

View file

@ -0,0 +1 @@
llUnescapeURL("%E8%B0%C0%80%90%A0%B0")

View file

@ -0,0 +1 @@
main.py -O clear,lso,optimize,constfold,expr,addstrings -

View file

@ -0,0 +1 @@
ELSONotSupported: Byte strings not supported

View file

@ -0,0 +1 @@
llUnescapeURL("%F3%80")

View file

@ -0,0 +1 @@
main.py -O clear,lso,optimize,constfold,expr,addstrings -

View file

@ -0,0 +1,6 @@
[ llToUpper("AZaz")
, llToLower("AZaz")
, llToUpper("τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός")
, llToLower("ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ")
, ""
]

View file

@ -0,0 +1,6 @@
[ "AZAZ"
, "azaz"
, "τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός"
, "ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ, ΔΡΑΣΚΕΛΊΖΕΙ ΥΠΈΡ ΝΩΘΡΟΎ ΚΥΝΌΣ"
, ""
]

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,lso,expr,addstrings -