check_vtk.m4 \
check_VTKViewer.m4 \
check_corba_in_GUI.m4 \
-check_QxGraphViewer.m4
+check_QxGraphViewer.m4 \
+check_TestRecorder.m4
--- /dev/null
+#
+# Check existence of Test recorder sources and libraries.
+# Set DISABLE_TESTRECORDER to yes|no
+#
+# Author : Margarita KARPUNINA (OCN, 2008)
+#
+
+AC_DEFUN([CHECK_TESTRECORDER],[
+
+AC_ARG_WITH(testrecorder,
+ [ --with-testrecorder=DIR root directory path of TestRecorder installation],
+ [],
+ [with_testrecorder=no])
+
+AS_IF([test "x$with_testrecorder" != xno || test "$with_testrecorder" != "no"],[
+
+ echo
+ echo ---------------------------------------------
+ echo Testing TestRecorder
+ echo ---------------------------------------------
+ echo
+
+ AC_REQUIRE([CHECK_QT])dnl
+ AC_REQUIRE([AC_PROG_CXX])dnl
+ AC_REQUIRE([AC_PROG_CXXCPP])dnl
+
+ AC_CHECKING(for TestRecorder product)
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ TESTRECORDER_INCLUDES=""
+ TESTRECORDER_LIBS=""
+ DISABLE_TESTRECORDER="yes"
+
+ TestRecorder_ok=no
+
+ if test "$with_testrecorder" == "yes" || test "$with_testrecorder" == "auto"; then
+ TESTRECORDER_HOME=""
+ else
+ TESTRECORDER_HOME="$with_testrecorder"
+ fi
+
+ if test "$TESTRECORDER_HOME" == "" ; then
+ if test "x$TESTRECORDERHOME" != "x" ; then
+ TESTRECORDER_HOME=$TESTRECORDERHOME
+ fi
+ fi
+
+ if test "x$TESTRECORDER_HOME" != "x"; then
+ TESTRECORDER_INCLUDES="-I$TESTRECORDER_HOME"
+ TESTRECORDER_LIBS="-L$TESTRECORDER_HOME/lib -lTestRecorder"
+
+ CPPFLAGS_old="$CPPFLAGS"
+ CXXFLAGS_old="$CXXFLAGS"
+ CPPFLAGS="$TESTRECORDER_INCLUDES $QT_INLCUDES $CPPFLAGS"
+ CXXFLAGS="$TESTRECORDER_INCLUDES $QT_INCLUDES $CXXFLAGS"
+
+ AC_MSG_CHECKING(for TestRecorder header file)
+
+ AC_CHECK_HEADER(TestApplication.h,TestRecorder_ok=yes,TestRecorder_ok=no)
+
+ if test "x$TestRecorder_ok" == "xyes"; then
+
+ AC_MSG_CHECKING(for TestRecorder library)
+
+ LDFLAGS_old="$LDFLAGS"
+ LDFLAGS="-L. -$TESTRECORDER_LIBS $QT_LIBS $LDFLAGS"
+
+ AC_TRY_LINK(
+ #include "TestApplication.h",
+ TESTRECORDER_init();,
+ TestRecorder_ok=yes,TestRecorder_ok=no
+ )
+
+ LDFLAGS="$LDFLAGS_old"
+
+ AC_MSG_RESULT($TestRecorder_ok)
+ fi
+
+ CPPFLAGS="$CPPFLAGS_old"
+ CXXFLAGS="$CXXFLAGS_old"
+
+ fi
+
+ if test "x$TestRecorder_ok" == xno ; then
+ AC_MSG_RESULT(for TestRecorder: no)
+ AC_MSG_WARN(TestRecorder is not found or not properly installed)
+ else
+ AC_MSG_RESULT(for TestRecorder: yes)
+ DISABLE_TESTRECORDER="no"
+ fi
+
+ AC_SUBST(TESTRECORDER_INCLUDES)
+ AC_SUBST(TESTRECORDER_LIBS)
+
+ AC_LANG_RESTORE
+
+ ])
+
+])dnl
done
echo "---Optional:"
-variables="cppunit_ok TESTRECORDER_ok"
+variables="cppunit_ok TestRecorder_ok"
for var in $variables
do
SUIT_msg_en.qm
libsuit_la_CPPFLAGS = $(QT_INCLUDES) -I$(srcdir)/../Qtx -I$(srcdir)/../ObjBrowser
+
+if ENABLE_TESTRECORDER
+ libsuit_la_CPPFLAGS+= $(TESTRECORDER_INCLUDES)
+else !ENABLE_TESTRECORDER
+ libsuit_la_CPPFLAGS+= -DDISABLE_TESTRECORDER
+endif
+
libsuit_la_LDFLAGS = $(QT_MT_LIBS)
+
+if ENABLE_TESTRECORDER
+ libsuit_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
+
libsuit_la_LIBADD = ../Qtx/libqtx.la ../ObjBrowser/libObjBrowser.la
#include "SUIT_MessageBox.h"
+#ifndef DISABLE_TESTRECORDER
+ #include <TestApplication.h>
+#endif
+
#include <QApplication>
/*!\class SUIT_ExceptionHandler
*/
bool SUIT_ExceptionHandler::internalHandle( QObject* o, QEvent* e )
{
+#ifndef DISABLE_TESTRECORDER
+ TestApplication* aTApp = qobject_cast<TestApplication*>(qApp);
+ return aTApp ? aTApp->TestApplication::notify( o, e ) : false;
+#else
return qApp ? qApp->QApplication::notify( o, e ) : false;
+#endif
}
/*!
libSUITApp_la_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
-I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
+if ENABLE_TESTRECORDER
+ libSUITApp_la_CPPFLAGS+= $(TESTRECORDER_INCLUDES)
+else !ENABLE_TESTRECORDER
+ libSUITApp_la_CPPFLAGS+= -DDISABLE_TESTRECORDER
+endif
+
libSUITApp_la_LDFLAGS = $(QT_MT_LIBS)
+
+if ENABLE_TESTRECORDER
+ libSUITApp_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
+
libSUITApp_la_LIBADD = ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
if ENABLE_PYCONSOLE
SUITApp_CPPFLAGS = $(QT_INCLUDES) $(PYTHON_INCLUDES) \
-I$(srcdir)/../SUIT -I$(srcdir)/../Qtx -I$(srcdir)/../Style
+if ENABLE_TESTRECORDER
+ SUITApp_CPPFLAGS+= $(TESTRECORDER_INCLUDES)
+else !ENABLE_TESTRECORDER
+ SUITApp_CPPFLAGS+= -DDISABLE_TESTRECORDER
+endif
+
SUITApp_LDADD = libSUITApp.la ../Qtx/libqtx.la ../SUIT/libsuit.la ../Style/libSalomeStyle.la
+
+if ENABLE_TESTRECORDER
+ SUITApp_LDADD+= $(TESTRECORDER_LIBS)
+endif
Constructor
*/
SUITApp_Application::SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv ),
+#ifndef DISABLE_TESTRECORDER
+ : TestApplication( argc, argv ),
+#else
+ : QApplication( argc, argv ),
+#endif
myExceptHandler( hand )
{
QString path = SUIT_Tools::dir( argv[0] ) + QDir::separator() + "../../resources";
Constructor
*/
SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
-: QApplication( argc, argv, type ),
+#ifndef DISABLE_TESTRECORDER
+ : TestApplication( argc, argv ),
+#else
+ : QApplication( argc, argv, type ),
+#endif
myExceptHandler( hand )
{
QTranslator* strTbl = new QTranslator( 0 );
bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
{
return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
+#ifndef DISABLE_TESTRECORDER
+ TestApplication::notify( receiver, e );
+#else
QApplication::notify( receiver, e );
+#endif
}
/*!
#ifndef SUITAPP_APPLICATION_H
#define SUITAPP_APPLICATION_H
-#include <QApplication>
+#ifndef DISABLE_TESTRECORDER
+ #include <TestApplication.h>
+#else
+ #include <QApplication>
+#endif
class SUIT_ExceptionHandler;
-class SUITApp_Application : public QApplication
+#ifndef DISABLE_TESTRECORDER
+ class SUITApp_Application : public TestApplication
+#else
+ class SUITApp_Application : public QApplication
+#endif
{
Q_OBJECT
-I$(srcdir)/../Qtx -I$(srcdir)/../SUIT -I$(srcdir)/../Event \
-I$(srcdir)/../Style @LIBXML_INCLUDES@
+if ENABLE_TESTRECORDER
+ libSalomeSession_la_CPPFLAGS+= $(TESTRECORDER_INCLUDES)
+else !ENABLE_TESTRECORDER
+ libSalomeSession_la_CPPFLAGS+= -DDISABLE_TESTRECORDER
+endif
+
libSalomeSession_la_LDFLAGS = $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS \
-lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lSalomeCatalog \
-lSalomeDSClient $(CAS_KERNEL) -lwith_loggerTraceCollector \
../SUIT/libsuit.la ../Event/libEvent.la ../../idl/libSalomeIDLGUI.la \
../Style/libSalomeStyle.la
+if ENABLE_TESTRECORDER
+ libSalomeSession_la_LDFLAGS+= $(TESTRECORDER_LIBS)
+endif
+
# Executable
bin_PROGRAMS = SALOME_Session_Server
-lSalomeNotification -lSALOMEBasics -lSalomeLauncher ../Qtx/libqtx.la \
$(top_builddir)/idl/libSalomeIDLGUI.la \
libSalomeSession.la
+
+if ENABLE_TESTRECORDER
+ SALOME_Session_Server_LDADD+= $(TESTRECORDER_LIBS)
+endif
#include <ConnectionManager_i.hxx>
#include <SALOME_LifeCycleCORBA.hxx>
+#ifndef DISABLE_TESTRECORDER
+ #include <TestApplication.h>
+#endif
+
#include <QDir>
#include <QFile>
#include <QApplication>
}
};
-class SALOME_QApplication : public QApplication
+#ifndef DISABLE_TESTRECORDER
+ class SALOME_QApplication : public TestApplication
+#else
+ class SALOME_QApplication : public QApplication
+#endif
{
public:
+#ifndef DISABLE_TESTRECORDER
+ SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
+#else
SALOME_QApplication( int& argc, char** argv ) : QApplication( argc, argv ), myHandler ( 0 ) {}
+#endif
virtual bool notify( QObject* receiver, QEvent* e )
{
}
#endif
+#ifndef DISABLE_TESTRECORDER
+ return myHandler ? myHandler->handle( receiver, e ) :
+ TestApplication::notify( receiver, e );
+#else
return myHandler ? myHandler->handle( receiver, e ) :
QApplication::notify( receiver, e );
+#endif
}
SUIT_ExceptionHandler* handler() const { return myHandler; }
void setHandler( SUIT_ExceptionHandler* h ) { myHandler = h; }