Add basic testing scripts
This commit is contained in:
parent
387a65e4f1
commit
aad9201e58
|
@ -15,3 +15,6 @@ callgrind.*
|
|||
|
||||
# Git hash file
|
||||
githash.txt
|
||||
|
||||
# Test results
|
||||
tests/tc*/actual.txt
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
RED="\033[31m"
|
||||
GREEN="\033[32m"
|
||||
YELLOW="\033[33m"
|
||||
NORMAL="\033[0m"
|
||||
|
||||
fail_count=0
|
||||
pass_count=0
|
||||
|
||||
for testCase in tc*; do
|
||||
cd $testCase;
|
||||
./run.sh;
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${YELLOW}$testCase:${NORMAL} ... ${GREEN}Pass${NORMAL}";
|
||||
let pass_count=pass_count+1
|
||||
else
|
||||
echo -e "${YELLOW}$testCase:${NORMAL} ... ${RED}Fail${NORMAL}";
|
||||
let fail_count=fail_count+1
|
||||
fi
|
||||
cd - > /dev/null;
|
||||
done
|
||||
|
||||
if [ $fail_count -eq 0 ]; then
|
||||
echo -e "${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
|
||||
else
|
||||
echo -e "${RED}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
|
||||
exit 1
|
||||
fi
|
|
@ -0,0 +1,66 @@
|
|||
identifiers
|
||||
algorithm M
|
||||
allocator M
|
||||
array M
|
||||
ascii M
|
||||
base64 M
|
||||
bigint M
|
||||
bitmanip M
|
||||
c P
|
||||
compiler M
|
||||
complex M
|
||||
concurrency M
|
||||
container M
|
||||
conv M
|
||||
cstream M
|
||||
csv M
|
||||
d P
|
||||
datetime M
|
||||
demangle M
|
||||
digest P
|
||||
encoding M
|
||||
exception M
|
||||
experimental P
|
||||
file M
|
||||
format M
|
||||
functional M
|
||||
getopt M
|
||||
internal P
|
||||
json M
|
||||
lexer M
|
||||
math M
|
||||
mathspecial M
|
||||
metastrings M
|
||||
mmfile M
|
||||
net P
|
||||
numeric M
|
||||
outbuffer M
|
||||
parallelism M
|
||||
path M
|
||||
process M
|
||||
random M
|
||||
range M
|
||||
regex M
|
||||
signals M
|
||||
socket M
|
||||
socketstream M
|
||||
stdint M
|
||||
stdio M
|
||||
stdiobase M
|
||||
stream M
|
||||
string M
|
||||
syserror M
|
||||
system M
|
||||
traits M
|
||||
typecons M
|
||||
typelist M
|
||||
typetuple M
|
||||
uni M
|
||||
uri M
|
||||
utf M
|
||||
uuid M
|
||||
variant M
|
||||
windows P
|
||||
xml M
|
||||
zip M
|
||||
zlib M
|
|
@ -0,0 +1 @@
|
|||
import std.
|
|
@ -0,0 +1,5 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
dcd-client file.d -c12 > actual.txt
|
||||
diff actual.txt expected.txt
|
|
@ -0,0 +1,9 @@
|
|||
identifiers
|
||||
alignof k
|
||||
init k
|
||||
mangleof k
|
||||
sizeof k
|
||||
stringof k
|
||||
tupleof k
|
||||
x v
|
||||
y v
|
|
@ -0,0 +1 @@
|
|||
struct S { int x; int y; } void doStuff() { S s; s. }
|
|
@ -0,0 +1,5 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
dcd-client file.d -c52 > actual.txt
|
||||
diff actual.txt expected.txt
|
|
@ -0,0 +1,51 @@
|
|||
abstract class InheritMe(T)
|
||||
{
|
||||
final abstract class GrandChild(U, V)
|
||||
{
|
||||
/// I am uvalue
|
||||
static U uvalue;
|
||||
|
||||
/// I am vvalue
|
||||
static V vvalue;
|
||||
|
||||
/// I am setGrandChild
|
||||
static void setGrandChild(alias X, alias Y)()
|
||||
{
|
||||
X = Y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final abstract class Parent(T)
|
||||
{
|
||||
/// I am stringChild
|
||||
final abstract class StringChild : InheritMe!(string)
|
||||
{
|
||||
/// I am a string GrandChild
|
||||
alias s = GrandChild!(T, string);
|
||||
|
||||
/// I am an int GrandChild
|
||||
alias i = GrandChild!(T, int);
|
||||
}
|
||||
|
||||
/// I am a parentF
|
||||
static void parentF()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// I am stringParent
|
||||
alias stringParent = Parent!string;
|
||||
|
||||
void main(string[] args)
|
||||
{
|
||||
with(stringParent.StringChild.s)
|
||||
{
|
||||
setGrandChild
|
||||
!(
|
||||
uvalue, "test",
|
||||
)();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
dcd-client file.d -c863 > actual.txt
|
||||
diff actual.txt expected.txt
|
Loading…
Reference in New Issue