From c21dfe68806bbaa0a058ae538ae11e652af53824 Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 27 Sep 2015 20:49:59 +0200 Subject: [PATCH] [TEST] added a simple Wt test --- test/TestWt.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/TestWt.cpp diff --git a/test/TestWt.cpp b/test/TestWt.cpp new file mode 100644 index 00000000..aefbdb0a --- /dev/null +++ b/test/TestWt.cpp @@ -0,0 +1,49 @@ + +#include +#include +#include +#include + + +class TestApplication : public Wt::WApplication +{ + public: + TestApplication(const Wt::WEnvironment& env) + : Wt::WApplication(env) + { + root()->addWidget(new Wt::WText("Hello, world!")); + } + +}; + +static Wt::WApplication *createTestApplication(const Wt::WEnvironment& env) +{ + return new TestApplication(env); +} + +int main(int argc, char *argv[]) +{ + try + { + + Wt::WServer server(argv[0]); + server.setServerConfiguration (argc, argv); + + server.addEntryPoint(Wt::Application, createTestApplication); + + server.start(); + + Wt::WServer::waitForShutdown(argv[0]); + + server.stop(); + + return EXIT_SUCCESS; + } + catch (std::exception& e) + { + std::cerr << "Caught exception: " << e.what(); + return EXIT_FAILURE; + } + +} +