test log improvements

This commit is contained in:
Arvid Norberg 2013-06-21 01:06:40 +00:00
parent 208321dab0
commit 6b6c06fa0b
3 changed files with 21 additions and 14 deletions

View File

@ -27,13 +27,20 @@ rule libtorrent_dependency ( properties * )
return $(result) ;
}
lib libtorrent_test
: # sources
setup_transfer.cpp
dht_server.cpp
peer_server.cpp
: # requirements
<conditional>@libtorrent_dependency
;
project
: requirements
<conditional>@libtorrent_dependency
<source>main.cpp
<source>setup_transfer.cpp
<source>dht_server.cpp
<source>peer_server.cpp
<conditional>@libtorrent_dependency
<library>libtorrent_test/<link>shared
: default-build
<threading>multi
<invariant-checks>full

View File

@ -167,12 +167,11 @@ void print_ses_rate(float time
, libtorrent::torrent_status const* st2
, libtorrent::torrent_status const* st3)
{
std::cerr
<< time << "s "
<< int(st1->download_payload_rate / 1000.f) << "kB/s "
<< int(st1->upload_payload_rate / 1000.f) << "kB/s "
<< int(st1->progress * 100) << "% "
<< st1->num_peers;
fprintf(stderr, "%3.1fs | %dkB/s %dkB/s %d%% %d", time
, int(st1->download_payload_rate / 1000)
, int(st1->upload_payload_rate / 1000)
, int(st1->progress * 100)
, st1->num_peers);
if (st2)
std::cerr << " : "
<< int(st2->download_payload_rate / 1000.f) << "kB/s "
@ -188,7 +187,7 @@ void print_ses_rate(float time
<< st3->num_peers
<< " cc: " << st3->connect_candidates;
std::cerr << std::endl;
fprintf(stderr, "\n");
}
void test_sleep(int millisec)

View File

@ -298,6 +298,7 @@ def main(argv):
# a precautio to make sure a malicious repo
# won't clean things outside of the test directory
if not os.path.abspath(f).startswith(test_dir): continue
print 'deleting %s' %f
os.rmdirs(f)
finally:
# always restore current directory