From c65749b73502f4c8aa3e2ec170ae5acfd9a57ef8 Mon Sep 17 00:00:00 2001 From: secher Date: Fri, 8 Apr 2011 09:24:16 +0000 Subject: [PATCH] add a test for c++ Launcher --- src/Launcher/Makefile.am | 6 +++++- src/Launcher/TestLauncher.cxx | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 src/Launcher/TestLauncher.cxx diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index 48dd964dd..12d594b8d 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -154,7 +154,7 @@ libLauncher_la_LIBADD =\ # =============================================================== # if !WITHONLYLAUNCHER - bin_PROGRAMS = SALOME_LauncherServer + bin_PROGRAMS = SALOME_LauncherServer TestLauncher endif SALOME_LauncherServer_SOURCES =\ @@ -173,4 +173,8 @@ SALOME_LauncherServer_LDADD =\ $(LIBXML_LIBS) \ $(PYTHON_LIBS) +TestLauncher_SOURCES = TestLauncher.cxx +TestLauncher_CPPFLAGS = -I${LIBXML_DIR}/include/libxml2 -I${KERNEL_ROOT_DIR}/include/salome + +TestLauncher_LDADD = -L${LIBXML_DIR}/lib -lxml2 -L${KERNEL_ROOT_DIR}/lib/salome -lLauncher -lResourcesManager -L${LIBBATCH_ROOT_DIR}/lib -lBatch diff --git a/src/Launcher/TestLauncher.cxx b/src/Launcher/TestLauncher.cxx new file mode 100755 index 000000000..fef4ea93e --- /dev/null +++ b/src/Launcher/TestLauncher.cxx @@ -0,0 +1,23 @@ +#include "Launcher.hxx" + +int main(int argc, char** argv) +{ + + try { + Launcher_cpp *lcpp = new Launcher_cpp(); + ResourcesManager_cpp *rcpp = new ResourcesManager_cpp(); + lcpp->SetResourcesManager(rcpp); + delete lcpp; + delete rcpp; + std::cout << "test OK" << std::endl; + } catch ( const ResourcesException &ex) { + std::cout << ex.msg.c_str() << std::endl; + } + catch ( const LauncherException &ex) { + std::cout << ex.msg.c_str() << std::endl; + } + catch (...){ + std::cout << "test KO" << std::endl; + } + exit(0); +} -- 2.39.2