Add more test cases
This commit is contained in:
parent
da469a0579
commit
eb79c2a7ab
|
|
@ -0,0 +1,3 @@
|
|||
module object;
|
||||
|
||||
alias string = immutable(char)[];
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
module testfile1;
|
||||
|
||||
class Base
|
||||
{
|
||||
int z;
|
||||
}
|
||||
|
|
@ -2,12 +2,25 @@ RED="\033[31m"
|
|||
GREEN="\033[32m"
|
||||
YELLOW="\033[33m"
|
||||
NORMAL="\033[0m"
|
||||
IMPORTS=$(pwd)/imports
|
||||
|
||||
fail_count=0
|
||||
pass_count=0
|
||||
|
||||
# Make sure that the server is shut down
|
||||
echo "Shutting down currently-running server..."
|
||||
../bin/dcd-client --shutdown 2>/dev/null > /dev/null
|
||||
sleep 1s;
|
||||
|
||||
# Start up the server
|
||||
echo "Starting server..."
|
||||
../bin/dcd-server --ignoreConfig -I $IMPORTS 2>/dev/null > /dev/null &
|
||||
sleep 1s;
|
||||
|
||||
# Run tests
|
||||
for testCase in tc*; do
|
||||
cd $testCase;
|
||||
|
||||
./run.sh;
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${YELLOW}$testCase:${NORMAL} ... ${GREEN}Pass${NORMAL}";
|
||||
|
|
@ -16,9 +29,15 @@ for testCase in tc*; do
|
|||
echo -e "${YELLOW}$testCase:${NORMAL} ... ${RED}Fail${NORMAL}";
|
||||
let fail_count=fail_count+1
|
||||
fi
|
||||
|
||||
cd - > /dev/null;
|
||||
done
|
||||
|
||||
# Shut down
|
||||
echo "Shutting down server..."
|
||||
../bin/dcd-client --shutdown 2>/dev/null > /dev/null
|
||||
|
||||
# Report
|
||||
if [ $fail_count -eq 0 ]; then
|
||||
echo -e "${GREEN}${pass_count} tests passed and ${fail_count} failed.${NORMAL}"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -4,20 +4,20 @@ S doStuff(int x) { return S(); }
|
|||
|
||||
void main(string[] args)
|
||||
{
|
||||
auto a = 10;
|
||||
auto b = S(1, 2);
|
||||
int c = 4;
|
||||
auto d = doStuff();
|
||||
auto alpha = 10;
|
||||
auto bravo = S(1, 2);
|
||||
int charlie = 4;
|
||||
auto delta = doStuff();
|
||||
{
|
||||
a.
|
||||
alpha.
|
||||
}
|
||||
{
|
||||
b.
|
||||
bravo.
|
||||
}
|
||||
{
|
||||
c.
|
||||
charlie.
|
||||
}
|
||||
{
|
||||
d.
|
||||
delta.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
dcd-client file.d -c162 > actual1.txt
|
||||
dcd-client file.d -c184 > actual1.txt
|
||||
diff actual1.txt expected1.txt
|
||||
|
||||
dcd-client file.d -c173 > actual2.txt
|
||||
dcd-client file.d -c199 > actual2.txt
|
||||
diff actual2.txt expected2.txt
|
||||
|
||||
dcd-client file.d -c184 > actual3.txt
|
||||
dcd-client file.d -c216 > actual3.txt
|
||||
diff actual3.txt expected3.txt
|
||||
|
||||
dcd-client file.d -c195 > actual4.txt
|
||||
dcd-client file.d -c231 > actual4.txt
|
||||
diff actual4.txt expected4.txt
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ set -e
|
|||
set -u
|
||||
|
||||
dcd-client file.d -c83 > actual1.txt
|
||||
dcd-client file.d -c93 > actual2.txt
|
||||
dcd-client file.d -c148 > actual3.txt
|
||||
diff actual1.txt expected1.txt
|
||||
|
||||
dcd-client file.d -c93 > actual2.txt
|
||||
diff actual2.txt expected2.txt
|
||||
|
||||
dcd-client file.d -c148 > actual3.txt
|
||||
diff actual3.txt expected3.txt
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
identifiers
|
||||
__monitor v
|
||||
__vptr v
|
||||
alignof k
|
||||
classinfo v
|
||||
init k
|
||||
mangleof k
|
||||
sizeof k
|
||||
stringof k
|
||||
tupleof v
|
||||
x v
|
||||
y v
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
identifiers
|
||||
__monitor v
|
||||
__vptr v
|
||||
alignof k
|
||||
classinfo v
|
||||
init k
|
||||
mangleof k
|
||||
sizeof k
|
||||
stringof k
|
||||
tupleof v
|
||||
x v
|
||||
z v
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import testfile1;
|
||||
|
||||
class Inherits : Base
|
||||
{
|
||||
int x;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
Inherits i;
|
||||
i.
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
set -e
|
||||
set -u
|
||||
|
||||
cp testfile1_old.d ../imports/testfile1.d
|
||||
# Sleep because modification times aren't stored with granularity of less
|
||||
# than one second
|
||||
sleep 1s;
|
||||
|
||||
dcd-client file.d -c84 > actual1.txt
|
||||
diff actual1.txt expected1.txt
|
||||
|
||||
cp testfile1_new.d ../imports/testfile1.d
|
||||
# Same here
|
||||
sleep 1s;
|
||||
|
||||
dcd-client file.d -c84 > actual2.txt
|
||||
diff actual2.txt expected2.txt
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
module testfile1;
|
||||
|
||||
class Base
|
||||
{
|
||||
int z;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
module testfile1;
|
||||
|
||||
class Base
|
||||
{
|
||||
int y;
|
||||
}
|
||||
Loading…
Reference in New Issue