[gnome-commander/googletest] Revert "Creates a class of tests to be run only if x11 libs are available"



commit c717370c29bb99a603aa04c2efc4f7725715431a
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Tue Nov 24 20:43:42 2015 +0100

    Revert "Creates a class of tests to be run only if x11 libs are available"
    
    This reverts commit d7ee5edbefdd5206e78db464411c766d58312b06 as unit
    tests which need x11 libs are more or less "acceptance tests" and no
    unit tests. The former are not considered to be tested with googletest
    framework.

 configure.ac                  |    8 --------
 tests/Makefile.am             |   18 +++++-------------
 tests/iv_dualrenderer_test.cc |   13 ++-----------
 3 files changed, 7 insertions(+), 32 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0de08d3..6ea9a17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,14 +108,6 @@ fi
 AC_SUBST(GMODULE_AVAIL)
 
 
-dnl Find out if x11 libs are available. The variable X11_LIBS is set
-dnl if libX11 is found.
-PKG_CHECK_MODULES(X11, x11,
-    [AC_MSG_RESULT([x11-libs found, associated tests will be executed if a display is available])],
-    [AC_MSG_WARN([x11 missing, tests which need a display will be skipped by default])])
-AM_CONDITIONAL(HAVE_X11, test -n "$X11_LIBS")
-
-
 dnl Check for gtk+
 AC_MSG_CHECKING(if gtk+ >= ${GTK_REQ} exists)
 if pkg-config --exists gtk+-2.0 ; then
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b359042..a8f1be9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,29 +19,21 @@ TESTS = \
        iv_fileops \
        iv_bm_search \
        iv_datapresentation \
+       iv_dualrenderer \
        iv_imagerenderer \
        iv_inputmodes \
        iv_textrenderer
 
-if HAVE_X11
-TESTS += \
-       iv_dualrenderer
-endif
-
-
 check_PROGRAMS = $(TESTS)
 
 # *** Internal Viewer Tests *** Most of these only consist of serialised
 # function calls for acceptance tests, acutally. Functions of the internal
-# viewer library are not fully tested by unit tests! Currently, I don't
+# viewer library are not fully tested by unit tests. Currently, I don't
 # feel that there is a need of adding unit tests for this nicely working
-# library. Some of these tests require a running X session. It is checked
-# if a session is running in the binaries. If not, the test is skipped.
-if HAVE_X11
-iv_dualrenderer_SOURCES = iv_dualrenderer_test.cc
+# library. Some of these tests require a running X session.
+iv_dualrenderer_SOURCES = iv_dualrenderer_test.cc gcmd_tests_main.cc
 iv_dualrenderer_CXXFLAGS = $(INTVLIBS)
-iv_dualrenderer_LDFLAGS = $(INTVLIBS) -lX11 -lgtest
-endif
+iv_dualrenderer_LDFLAGS = $(INTVLIBS) -lgtest
 
 iv_imagerenderer_SOURCES = iv_imagerenderer_test.cc gcmd_tests_main.cc
 iv_imagerenderer_CXXFLAGS = $(INTVLIBS)
diff --git a/tests/iv_dualrenderer_test.cc b/tests/iv_dualrenderer_test.cc
index a175502..f0e7cf8 100644
--- a/tests/iv_dualrenderer_test.cc
+++ b/tests/iv_dualrenderer_test.cc
@@ -26,11 +26,10 @@
  */
 
 #include "gtest/gtest.h"
-#include <intviewer/libgviewer.h>
-#include <X11/Xlib.h>  // to check for an available display
+#include <iv_dualrenderer_test.h>
 
-class DualRendererTest : public ::testing::Test {};
 TEST_F(DualRendererTest, dualrenderer_test) {
+
     GtkWidget *window;
     GtkWidget *tscrollbox, *iscrollbox;
     GtkWidget *imgr;
@@ -93,11 +92,3 @@ TEST_F(DualRendererTest, dualrenderer_test) {
     }
     gtk_widget_destroy (window);
 }
-
-int main(int argc, char **argv) {
-  ::testing::InitGoogleTest(&argc, argv);
-  if (XOpenDisplay(NULL))
-      return RUN_ALL_TESTS();
-  else
-      return(77);
-}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]