FYI: Here are stats from my 2.4Ghz E5530 system:
Patch to enable these tests is attached (and pushed to my tree).
[r...@i7-dqc-1 tests]# ./test_xrl_receiver&
[r...@i7-dqc-1 tests]# ./test_xrl_sender
XrlAtoms per call = 1
Send method = pipeline
start_transmission_cb 100 Okay
Received 10000 XRLs; delta_time = 0.738458 secs; speed = 13541.731554 XRLs/s
start_transmission_cb 100 Okay
Received 10000 XRLs; delta_time = 0.439395 secs; speed = 22758.565755 XRLs/s
start_transmission_cb 100 Okay
Received 10000 XRLs; delta_time = 0.408516 secs; speed = 24478.845382 XRLs/s
start_transmission_cb 100 Okay
Received 10000 XRLs; delta_time = 0.407115 secs; speed = 24563.084141 XRLs/s
Thanks,
Ben
--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com
diff --git a/SConstruct b/SConstruct
index 57f0604..7bc73c1 100644
--- a/SConstruct
+++ b/SConstruct
@@ -45,6 +45,7 @@ Help("""
prefix=<some path> to specify a different install directory.
Default is "/usr/local/xorp".
enable_olsr=true if you want to build OLSR.
+ enable_tests=true if you want to build test programs.
""")
import sys
@@ -75,6 +76,7 @@ vars.AddVariables(
BoolVariable('debug_fn', 'Build with function names in debug_msg output', False),
BoolVariable('debug_cb', 'Build with callback debugging', False),
BoolVariable('enable_olsr', 'Build OLSR', False),
+ BoolVariable('enable_tests', 'Build Test Programs', False),
)
build_arch = os.uname()[4].lower()
@@ -151,6 +153,9 @@ print 'Debug callbacks: ', env['debug_cb']
env['WITH_OLSR'] = ARGUMENTS.get('enable_olsr', False)
print 'Enable OLSR: ', env['enable_olsr']
+env['WITH_TESTS'] = ARGUMENTS.get('enable_tests', False)
+print 'Enable Tests: ', env['enable_tests']
+
env['CONFIGURELOG'] = str(builddir) + os.sep + 'config.log'
env['CONFIGUREDIR'] = str(builddir) + os.sep + '.sconf_temp'
diff --git a/libxipc/SConscript b/libxipc/SConscript
index 16f30a9..415ebbb 100644
--- a/libxipc/SConscript
+++ b/libxipc/SConscript
@@ -20,9 +20,9 @@
import os
Import("env")
-subdirs = [ 'tests' ]
-
-SConscript(dirs = subdirs, exports='env')
+if env['WITH_TESTS']:
+ subdirs = [ 'tests' ]
+ SConscript(dirs = subdirs, exports='env')
is_shared = env.has_key('SHAREDLIBS')
@@ -54,7 +54,6 @@ libxipc_sources = [
'finder_msgs.cc',
'finder_tcp.cc',
'finder_tcp_messenger.cc',
- #'header.cc', # only for udp
'hmac.cc',
'hmac_md5.c',
'permits.cc',
@@ -71,11 +70,9 @@ libxipc_sources = [
'xrl_parser_input.cc',
'xrl_pf.cc',
'xrl_pf_factory.cc',
- #'xrl_pf_inproc.cc', # not used in production build
#'xrl_pf_kill.cc', # not used in production build
'xrl_pf_stcp.cc',
'xrl_pf_stcp_ph.cc',
- #'xrl_pf_sudp.cc', # not used in production build
'xrl_pf_unix.cc',
'xrl_router.cc',
'xrl_std_router.cc',
@@ -83,6 +80,14 @@ libxipc_sources = [
'xuid.cc', # only for udp (and fea tcpudp mgr)
]
+if env['WITH_TESTS']:
+ # Files needed for tests only
+ libxipc_sources += [
+ 'header.cc',
+ 'xrl_pf_inproc.cc',
+ 'xrl_pf_sudp.cc',
+ ]
+
# deal with shared objects
if is_shared:
libxipc_sources += [
diff --git a/libxipc/bench_ipc.sh b/libxipc/bench_ipc.sh
index 8a78569..f5d156b 100755
--- a/libxipc/bench_ipc.sh
+++ b/libxipc/bench_ipc.sh
@@ -1,4 +1,4 @@
-#!/usr/local/bin/bash
+#!/bin/bash
#
# $XORP$
diff --git a/libxipc/tests/SConscript b/libxipc/tests/SConscript
index b14a6f3..9c9817a 100644
--- a/libxipc/tests/SConscript
+++ b/libxipc/tests/SConscript
@@ -32,13 +32,19 @@ env.AppendUnique(LIBPATH = [
'$BUILDDIR/libxipc',
'$BUILDDIR/libxorp',
'$BUILDDIR/libcomm',
+ '$BUILDDIR/xrl/interfaces',
+ '$BUILDDIR/xrl/targets',
])
env.AppendUnique(LIBS = [
- 'xipc',
+ 'testxrlsxif',
+ 'testxrlsbase',
+ 'findereventnotifierxif',
+ 'testfindereventsbase',
'finder',
- 'xorp',
+ 'xipc',
'comm',
+ 'xorp',
])
# Missing:
@@ -47,31 +53,67 @@ env.AppendUnique(LIBS = [
# test_xrl_parser.sh
simple_cpp_tests = [
- #'finder', # XXX test target needed
- #'finder_events',
- #'finder_messenger',
- #'finder_msgs',
- #'finder_tcp',
- #'finder_to',
+ 'finder',
+ 'finder_events',
+ 'finder_messenger',
+ 'finder_msgs',
+ 'finder_tcp',
+ 'finder_to',
'header',
'inproc',
'lemming',
- #'receiver', # compound
'stcp',
'stcppf',
'sudp',
- 'xrl',
'xrl_args',
'xrl_atom',
+ 'xrl',
'xrl_error',
'xrl_parser',
- #'xrl_receiver', # compound
'xrl_router',
- #'xrl_sender', # compound
]
+xrlrcvr_sources = [
+ 'test_xrl_receiver.cc',
+ 'test_receiver.cc',
+ ]
+
+xrlsnd_sources = [
+ 'test_xrl_sender.cc',
+ 'test_receiver.cc',
+ ]
+
+
+# Do the compound tools here.
+xrlrcvr = env.Program(target = 'test_xrl_receiver', source = xrlrcvr_sources)
+xrlsnd = env.Program(target = 'test_xrl_sender', source = xrlsnd_sources)
+
+libxipctestpath = '$exec_prefix/libxipc/tests'
+
+env.Alias('install', env.InstallProgram(libxipctestpath, xrlrcvr))
+env.Alias('install', env.InstallProgram(libxipctestpath, xrlsnd))
+
+scripts_list = [
+ 'test_finder_deaths.sh',
+ 'test_leaks.sh',
+ 'test_xrl_parser.sh',
+ ]
+
+env.Alias('install', env.InstallProgram(libxipctestpath, scripts_list))
+
+scripts_data = [
+ 'test_xrl_parser.data',
+ ]
+
+env.Alias('install', env.InstallData(libxipctestpath, scripts_data))
+
cpp_test_targets = []
+
for ct in simple_cpp_tests:
cpp_test_targets.append(env.AutoTest(target = 'test_%s' % ct,
source = 'test_%s.cc' % ct))
+ env.Alias('install', env.InstallProgram(libxipctestpath, 'test_%s' %ct))
+
+Default(cpp_test_targets, xrlrcvr, xrlsnd)
+Default()
diff --git a/libxipc/tests/test_finder_events.cc b/libxipc/tests/test_finder_events.cc
index 138c56c..2e752c1 100644
--- a/libxipc/tests/test_finder_events.cc
+++ b/libxipc/tests/test_finder_events.cc
@@ -244,6 +244,11 @@ public:
return XrlCmdError::OKAY();
}
+ XrlCmdError common_0_1_startup()
+ {
+ return XrlCmdError::OKAY();
+ }
+
XrlCmdError common_0_1_shutdown()
{
//We don't normally want to shutdown a process through this
diff --git a/libxipc/tests/test_receiver.hh b/libxipc/tests/test_receiver.hh
index d2ee60b..1cab2cf 100644
--- a/libxipc/tests/test_receiver.hh
+++ b/libxipc/tests/test_receiver.hh
@@ -48,6 +48,7 @@ private:
string& reason);
XrlCmdError common_0_1_shutdown();
+ XrlCmdError common_0_1_startup() { return XrlCmdError::OKAY(); }
XrlCmdError test_xrls_0_1_start_transmission();
_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers