Added semi-automatic test scripts
parent
63a3ad5e90
commit
5e70bc7bd7
@ -0,0 +1,21 @@
|
||||
Reading cow.raw first
|
||||
Size: 37502
|
||||
Done
|
||||
|
||||
Loading cow.wav by filename:
|
||||
Source size: 37502
|
||||
rate=11025
|
||||
channels=1
|
||||
bits=16
|
||||
Reading entire buffer into memory
|
||||
Comparing...
|
||||
Done
|
||||
|
||||
Loading cow.wav by stream:
|
||||
Source size: 37502
|
||||
rate=11025
|
||||
channels=1
|
||||
bits=16
|
||||
Reading entire buffer into memory
|
||||
Comparing...
|
||||
Done
|
@ -0,0 +1,12 @@
|
||||
Reading cow.raw first
|
||||
Size: 37502
|
||||
Done
|
||||
|
||||
Loading cow.wav by filename:
|
||||
rate=11025
|
||||
channels=1
|
||||
bits=16
|
||||
Reading entire buffer into memory
|
||||
Actually read: 37502
|
||||
Comparing...
|
||||
Done
|
@ -0,0 +1,3 @@
|
||||
Playing cow.wav
|
||||
Playing owl.ogg
|
||||
Playing cow.wav (from stream)
|
@ -0,0 +1,5 @@
|
||||
Loading cow.raw
|
||||
rate=11025
|
||||
channels=1
|
||||
bits=16
|
||||
Playing
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
make || exit
|
||||
|
||||
mkdir -p output
|
||||
|
||||
PROGS=*_test
|
||||
|
||||
for a in $PROGS; do
|
||||
if [ -f "output/$a.out" ]; then
|
||||
echo "Running $a:"
|
||||
$a | diff output/$a.out -
|
||||
else
|
||||
echo "Creating $a.out"
|
||||
$a > "output/$a.out"
|
||||
git add "output/$a.out"
|
||||
fi
|
||||
done
|
@ -0,0 +1,9 @@
|
||||
pos=0
|
||||
2 bytes: he
|
||||
pos=2
|
||||
pos=4
|
||||
3 bytes: o w
|
||||
pos=6
|
||||
pos=7
|
||||
last 4 bytes: orld
|
||||
entire stream: hello world
|
@ -0,0 +1,22 @@
|
||||
Size: 11
|
||||
Pos: 0
|
||||
Seeking...
|
||||
Pos: 3
|
||||
Reading: 4
|
||||
Four bytes: lo w
|
||||
Eof: 0
|
||||
Pos: 7
|
||||
Seeking again...
|
||||
Pos: 11
|
||||
Eof: 1
|
||||
Seek to 6
|
||||
Eof: 0
|
||||
Pos: 6
|
||||
Over-reading: 5
|
||||
Result: world
|
||||
Eof: 1
|
||||
Pos: 11
|
||||
Finally, reading the entire string: 11
|
||||
Result: hello world
|
||||
Eof: 1
|
||||
Pos: 11
|
@ -0,0 +1,3 @@
|
||||
pos=0 eof=0
|
||||
First 20 bytes: #include "../servers
|
||||
pos=20 eof=0
|
@ -0,0 +1,23 @@
|
||||
Size: 12
|
||||
Pos: 0
|
||||
Seeking...
|
||||
Pos: 3
|
||||
Reading: 4
|
||||
Four bytes: lo w
|
||||
Eof: 0
|
||||
Pos: 7
|
||||
Seeking again...
|
||||
Pos: 12
|
||||
Eof: 1
|
||||
Seek to 6
|
||||
Eof: 0
|
||||
Pos: 6
|
||||
Over-reading: 6
|
||||
Result: world
|
||||
Eof: 1
|
||||
Pos: 12
|
||||
Finally, reading the entire string: 11
|
||||
Result: hello world
|
||||
Eof: 0
|
||||
Pos: 11
|
||||
Entire stream from pointer: hello world
|
@ -0,0 +1,5 @@
|
||||
Name: hello
|
||||
As string: hello world
|
||||
pos=11 eof=1
|
||||
pos=0 eof=0
|
||||
pos=3 eof=0
|
@ -0,0 +1,36 @@
|
||||
|
||||
Slice 1:
|
||||
--------
|
||||
Size: 6
|
||||
Pos: 0
|
||||
Seeking...
|
||||
Reading 6 bytes
|
||||
Result: hello
|
||||
Pos: 6
|
||||
Eof: 1
|
||||
Seeking:
|
||||
Pos: 2
|
||||
Eof: 0
|
||||
Reading 4 bytes
|
||||
Result: llo
|
||||
Pos: 6
|
||||
Eof: 1
|
||||
Entire stream as pointer: hello
|
||||
|
||||
Slice 2:
|
||||
--------
|
||||
Size: 6
|
||||
Pos: 0
|
||||
Seeking...
|
||||
Reading 6 bytes
|
||||
Result: world
|
||||
Pos: 6
|
||||
Eof: 1
|
||||
Seeking:
|
||||
Pos: 2
|
||||
Eof: 0
|
||||
Reading 4 bytes
|
||||
Result: rld
|
||||
Pos: 6
|
||||
Eof: 1
|
||||
Entire stream as pointer: world
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
make || exit
|
||||
|
||||
mkdir -p output
|
||||
|
||||
PROGS=*_test
|
||||
|
||||
for a in $PROGS; do
|
||||
if [ -f "output/$a.out" ]; then
|
||||
echo "Running $a:"
|
||||
$a | diff output/$a.out -
|
||||
else
|
||||
echo "Creating $a.out"
|
||||
$a > "output/$a.out"
|
||||
git add "output/$a.out"
|
||||
fi
|
||||
done
|
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
function run()
|
||||
{
|
||||
cd "$1/tests/"
|
||||
./test.sh
|
||||
cd ../../
|
||||
}
|
||||
|
||||
run stream
|
||||
run vfs
|
||||
run sound
|
||||
run .
|
@ -0,0 +1 @@
|
||||
Playing 'owl.ogg' from 'sound.zip'
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
make || exit
|
||||
|
||||
mkdir -p output
|
||||
|
||||
PROGS=*_test
|
||||
|
||||
for a in $PROGS; do
|
||||
if [ -f "output/$a.out" ]; then
|
||||
echo "Running $a:"
|
||||
$a | diff output/$a.out -
|
||||
else
|
||||
echo "Creating $a.out"
|
||||
$a > "output/$a.out"
|
||||
git add "output/$a.out"
|
||||
fi
|
||||
done
|
@ -0,0 +1,31 @@
|
||||
Listing all files:
|
||||
name: file1
|
||||
basename: file1
|
||||
isDir: 0
|
||||
size: 1
|
||||
time: 0
|
||||
name: dir/file2
|
||||
basename: file2
|
||||
isDir: 0
|
||||
size: 2
|
||||
time: 0
|
||||
|
||||
Stat for single files:
|
||||
name: file1
|
||||
basename: file1
|
||||
isDir: 0
|
||||
size: 1
|
||||
time: 0
|
||||
|
||||
name: dir/file2
|
||||
basename: file2
|
||||
isDir: 0
|
||||
size: 2
|
||||
time: 0
|
||||
|
||||
name: dir
|
||||
basename: dir
|
||||
isDir: 1
|
||||
size: 0
|
||||
time: 0
|
||||
filesize: 11
|
@ -0,0 +1,12 @@
|
||||
Case: 1
|
||||
Name: dummy
|
||||
Type: Mangle
|
||||
All files:
|
||||
file1
|
||||
dir/file2
|
||||
Non-recursive:
|
||||
file1
|
||||
Dirs:
|
||||
dir
|
||||
filesize: 11
|
||||
contents: hello world
|
@ -0,0 +1,20 @@
|
||||
|
||||
File: Makefile
|
||||
Size: 814
|
||||
First line: GCC=g++ -I../
|
||||
|
||||
File: ogre_resource_test.cpp
|
||||
Size: 1437
|
||||
First line: #include <iostream>
|
||||
|
||||
File: bleh
|
||||
Does not exist
|
||||
|
||||
All source files:
|
||||
physfs_server_test.cpp
|
||||
dummy_test.cpp
|
||||
ogre_resource_test.cpp
|
||||
server_common.cpp
|
||||
dummy_vfs.cpp
|
||||
ogre_client_test.cpp
|
||||
ogre_server_test.cpp
|
@ -0,0 +1,11 @@
|
||||
|
||||
File: Makefile
|
||||
Size: 814
|
||||
First 12 bytes: GCC=g++ -I..
|
||||
|
||||
File: testfile.txt
|
||||
Size: 13
|
||||
First 12 bytes: hello world!
|
||||
|
||||
File: blah_bleh
|
||||
File doesn't exist
|
@ -0,0 +1,11 @@
|
||||
|
||||
File: Makefile
|
||||
Size: 814
|
||||
First 12 bytes: GCC=g++ -I..
|
||||
|
||||
File: testfile.txt
|
||||
Size: 13
|
||||
First 12 bytes: hello world!
|
||||
|
||||
File: blah_bleh
|
||||
File doesn't exist
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
make || exit
|
||||
|
||||
mkdir -p output
|
||||
|
||||
PROGS=*_test
|
||||
|
||||
for a in $PROGS; do
|
||||
if [ -f "output/$a.out" ]; then
|
||||
echo "Running $a:"
|
||||
$a | diff output/$a.out -
|
||||
else
|
||||
echo "Creating $a.out"
|
||||
$a > "output/$a.out"
|
||||
git add "output/$a.out"
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue