Skip to content

Commit

Permalink
added scons script to build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel (dmilith) Dettlaff committed Aug 29, 2008
1 parent ff90298 commit 7461733
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 43 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ main
examples
tests/test_*
*~
tests/.sconsign.dblite
2 changes: 1 addition & 1 deletion CleanAll
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ rm -f *.so
rm -f test_*
rm -f main
cd tests/
rm -f test_*
scons -c
echo "Done."

26 changes: 2 additions & 24 deletions MakeAllTests
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,9 @@
if [ -e "libhl-sha.so" ]; then

cd tests/

echo "boost::asio tests.."
#g++ asio_client_test.cpp -ggdb -O0 -L.. -lhl-sha -lcoordinates -lcharacter -lsoul -lboost_thread -lboost_system -o test_asio_client
#g++ asio_server_test.cpp -ggdb -O0 -L.. -lhl-sha -lcoordinates -lcharacter -lsoul -lboost_thread -lboost_system -o test_asio_server
g++ asio_tcp_client_test.cpp -ggdb -O0 -L.. -lhl-sha -lcoordinates -lcharacter -lsoul -lboost_thread -lboost_system -o test_asio_tcp_client
g++ asio_tcp_server_test.cpp -ggdb -O0 -L.. -lhl-sha -lcoordinates -lcharacter -lsoul -lboost_thread -lboost_system -o test_asio_tcp_server

echo "Serialization tests.."
g++ serialization_test.cpp -ggdb -O0 -L.. -lhl-sha -lboost_serialization -lcoordinates -litem -lsoul -lcoordinates -lcharacter -o test_serialization

echo "sha-1 generation/ thread tests.."
g++ sha1_speed_test_with_threads.cpp -ggdb -O0 -L.. -lhl-sha -o test_sha1_speed_threads -lboost_thread -lncurses
g++ sha1_speed_test_without_threads.cpp -ggdb -O0 -L.. -lhl-sha -o test_sha1_speed_no_threads -lboost_thread -lncurses

echo "Thread tests.."
g++ thread_group_test.cpp -ggdb -O0 -L.. -lhl-sha -lboost_thread -o test_thread_group

echo "Thread synchronization tests.."
g++ synchronization_test.cpp -ggdb -O0 -L.. -lhl-sha -lboost_thread -o test_thread_synchronization
g++ synchronization_test_2.cpp -ggdb -O0 -L.. -lboost_thread -o test_thread_synchronization_2

echo "Ncurses thread monitor tests.."
g++ ncurses_thread_monitor_test.cpp -ggdb -O0 -L.. -lhl-sha -lncurses -o test_ncurses_thread_monitor -lboost_thread
scons

else
echo "Please compile libraries first!"
echo "Please compile shared objects first! ( execute MakeAllLibs script )"
exit
fi
9 changes: 9 additions & 0 deletions Sconstruct
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""

This is OpenSource Project;
It's licensed on GPL/ LGPL public license;
It's written by Daniel (dmilith) Dettlaff since August 2oo8.
You can redistribute this project only with this header.

"""

import os
print 'scons script written by dmilith[at]gmail[dot]com (c) 2oo8'

Expand Down
86 changes: 86 additions & 0 deletions tests/Sconstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""

This is OpenSource Project;
It's licensed on GPL/ LGPL public license;
It's written by Daniel (dmilith) Dettlaff since August 2oo8.
You can redistribute this project only with this header.

"""

release = Environment( CXX = 'g++ -O0 -ggdb -W' )
release.Program('test_sha1_speed_threads' , 'hashlib/sha1_speed_test_with_threads.cpp',
LIBS=[ 'boost_thread', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release2 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release2.Program('test_sha1_speed_without_threads' , 'hashlib/sha1_speed_test_without_threads.cpp',
LIBS=[ 'boost_thread', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release3 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release3.Program('test_asio_udp_server' , 'network/asio_udp_server_test.cpp',
LIBS=[ 'boost_thread', 'boost_system', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release4 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release4.Program('test_asio_udp_client' , 'network/asio_udp_client_test.cpp',
LIBS=[ 'boost_thread', 'boost_system', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release5 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release5.Program('test_asio_tcp_server' , 'network/asio_tcp_server_test.cpp',
LIBS=[ 'boost_thread', 'boost_system', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release6 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release6.Program('test_asio_tcp_client' , 'network/asio_tcp_client_test.cpp',
LIBS=[ 'boost_thread', 'boost_system', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release7 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release7.Program('test_serialization' , 'other/serialization_test.cpp',
LIBS=[ 'boost_thread', 'boost_serialization', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release8 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release8.Program('test_thread' , 'thread/thread_group_test.cpp',
LIBS=[ 'boost_thread', 'boost_serialization', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release9 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release9.Program('test_thread_synchronization_1' , 'thread/synchronization_test.cpp',
LIBS=[ 'boost_thread', 'boost_serialization', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release10 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release10.Program('test_thread_synchronization_2' , 'thread/synchronization_test_2.cpp',
LIBS=[ 'boost_thread', 'boost_serialization', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

release11 = Environment( CXX = 'g++ -O0 -ggdb -W' )
release11.Program('test_ncurses_thread_monitor' , 'thread/ncurses_thread_monitor_test.cpp',
LIBS=[ 'boost_thread', 'boost_serialization', 'hl-sha', 'job', 'character', 'coordinates',
'item', 'map', 'place', 'soul', 'theritory', 'ncurses',
'world'],
LIBPATH=[ '../', '/usr/local/lib', '/usr/lib' ])

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../hashlib/hl_tools.h"
#include "../../hashlib/hl_tools.h"
#include <boost/thread/thread.hpp>
#include <iostream>
#include <ctime>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../hashlib/hl_tools.h"
#include "../../hashlib/hl_tools.h"
#include <iostream>

using namespace std;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <cstring>
#include <iostream>
#include <boost/asio.hpp>
#include "../character.h"
#include "../soul.h"
#include "../network.h"
#include "../../character.h"
#include "../../soul.h"
#include "../../network.h"

using boost::asio::ip::tcp;
Ccharacter *z = new Ccharacter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#include <boost/smart_ptr.hpp>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include "../character.h"
#include "../soul.h"
#include "../network.h"
#include "../../character.h"
#include "../../soul.h"
#include "../../network.h"

#define VERBOSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

#include "../character.h"
#include "../soul.h"
#include "../../character.h"
#include "../../soul.h"


using boost::asio::ip::udp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <cstdlib>
#include <iostream>
#include <boost/asio.hpp>
#include "../character.h"
#include "../soul.h"
#include "../../character.h"
#include "../../soul.h"

using boost::asio::ip::udp;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include <boost/version.hpp>
//#include "../coordinates.h"

#include "../soul.h"
#include "../item.h"
#include "../character.h"
#include "../world.h"
#include "../../soul.h"
#include "../../item.h"
#include "../../character.h"
#include "../../world.h"
//
//#include "../serialized.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../hashlib/hl_tools.h"
#include "../../hashlib/hl_tools.h"
#include <boost/thread/thread.hpp>
#include <ncurses.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../hashlib/hl_tools.h"
#include "../../hashlib/hl_tools.h"
#include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/progress.hpp>
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 7461733

Please sign in to comment.