Use smtp-sink for benchmarks

This commit is contained in:
Alexis Mousset
2015-10-22 23:37:04 +02:00
parent 31a7504d54
commit 2884da8f90
2 changed files with 3 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ before_script:
- sudo apt-get update -qq
- sudo apt-get install -y postfix
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
- smtp-sink 2525 1000&
script:
- |
travis-cargo build &&

View File

@@ -11,7 +11,7 @@ use lettre::email::EmailBuilder;
#[bench]
fn bench_simple_send(b: &mut test::Bencher) {
b.iter(|| {
let sender = SmtpTransportBuilder::localhost().unwrap().build();
let sender = SmtpTransportBuilder::new("127.0.0.1:2525").unwrap().build();
let mut mailer = Mailer::new(sender);
let email = EmailBuilder::new()
.to("root@localhost")
@@ -28,7 +28,7 @@ fn bench_simple_send(b: &mut test::Bencher) {
#[bench]
fn bench_reuse_send(b: &mut test::Bencher) {
let sender = SmtpTransportBuilder::localhost().unwrap().connection_reuse(true).build();
let sender = SmtpTransportBuilder::new("127.0.0.1:2525").unwrap().connection_reuse(true).build();
let mut mailer = Mailer::new(sender);
b.iter(|| {
let email = EmailBuilder::new()