// file : tests/sendmail/driver.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #include #include #include #include #include // operator<<(ostream, exception) #include #undef NDEBUG #include using namespace std; using namespace butl; // Usage: argv[0] // int main (int argc, const char* argv[]) try { assert (argc == 2); sendmail sm ([] (const char* c[], std::size_t n) { process::print (cerr, c, n); cerr << endl; }, 2, "", "tests/sendmail/driver", {argv[1]}); sm.out << cin.rdbuf (); sm.out.close (); if (!sm.wait ()) return 1; // Assume diagnostics has been issued. } catch (const system_error& e) { cerr << argv[0] << ": " << e << endl; return 1; }