diff options
author | matthew <matthew> | 2009-07-15 20:13:51 +0000 |
---|---|---|
committer | matthew <matthew> | 2009-07-15 20:13:51 +0000 |
commit | 217fb0207d32dd96b1960d93470a065ffcf6df7c (patch) | |
tree | 4605d92bfff96b67b19d5c56528fa37f1727718f /bin/test-mailin | |
parent | 9c28e80e38a0836716387f8b9345427901e5c4d8 (diff) |
Start of test suite.
Diffstat (limited to 'bin/test-mailin')
-rwxr-xr-x | bin/test-mailin | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/test-mailin b/bin/test-mailin new file mode 100755 index 000000000..33f8ab80c --- /dev/null +++ b/bin/test-mailin @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w -I../../perllib +# +# test-mailin: +# Receives incoming mail for the test harness, and stores it in the database +# for the test harness to access. +# +# Hook this up with something like this in /etc/aliases... +# pbharness: "| /home/francis/devel/mysociety/pb/bin/test-mailin" +# ... or some other appropriate way. +# +# Copyright (c) 2005 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# + +# Horrible boilerplate to set up appropriate library paths. +use FindBin; +use lib "$FindBin::Bin/../perllib"; +use lib "$FindBin::Bin/../../perllib"; +chdir $FindBin::Bin; + +use File::Slurp; + +use mySociety::SystemMisc qw(print_log); +mySociety::SystemMisc::log_to_stderr(0); + +use mySociety::Config; +mySociety::Config::set_file('../conf/general'); +use mySociety::WebTestHarness; + +print_log('notice', "started"); +our $wth = new mySociety::WebTestHarness(); +$wth->database_connect('BCI_'); +print_log('notice', "reading mail from STDIN"); +my $slurped = read_file(\*STDIN); +print_log('notice', "calling email_incoming"); +$wth->email_incoming($slurped); +print_log('notice', "done"); + |