[gnome-logs/wip/test: 22/31] Add behave tests to Makefile.am and configure.ac. Clean after-scenario in environment.py



commit c255da9a4307c05deb64ff978e6953ce07ab223c
Author: Rashi Aswani <aswanirashi19 gmail com>
Date:   Thu Aug 20 20:43:18 2015 +0530

    Add behave tests to Makefile.am and configure.ac. Clean after-scenario in environment.py

 Makefile.am                  |    4 +++-
 configure.ac                 |    5 +++++
 m4/behave-installed-tests.m4 |    8 ++++----
 tests/common_steps.py        |    2 +-
 tests/environment.py         |   20 ++------------------
 5 files changed, 15 insertions(+), 24 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 7f8ac50..b048902 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -265,7 +265,9 @@ TESTS = \
 endif
 
 @BEHAVE_INSTALLED_TESTS_RULE@
-INSTALLED_TESTS=general.feature
+INSTALLED_TESTS=       \
+               general.feature \
+               $(NULL)
 INSTALLED_TESTS_TYPE=session-exclusive
 
 iconthemedir = $(datadir)/icons/hicolor
diff --git a/configure.ac b/configure.ac
index 533e776..e536dfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,7 @@ AS_IF([test "x$enable_man" != "xno"],
 
 AM_CONDITIONAL([ENABLE_MAN], [test "x$have_manutils" = "xyes"])
 
+dnl Installed tests
 BEHAVE_INSTALLED_TESTS
 
 dnl AppData XML
@@ -115,3 +116,7 @@ Makefile
 po/Makefile.in
 ])
 AC_OUTPUT
+
+AC_MSG_NOTICE([
+       Installed tests:          $enable_installed_tests
+])
diff --git a/m4/behave-installed-tests.m4 b/m4/behave-installed-tests.m4
index 4feb82d..170a8fe 100644
--- a/m4/behave-installed-tests.m4
+++ b/m4/behave-installed-tests.m4
@@ -90,14 +90,14 @@ endif
 installed-tests-exec-hook:
        @$(MKDIR_P) $(EXEC_DIRECTORY);
        @for feature in $(BEHAVE_FEATURES); do                                                                
                  \
-           $(LIBTOOL) --mode=install $(INSTALL) --mode=644 $$feature $(EXEC_DIRECTORY);\
+           $(LIBTOOL) --mode=install $(INSTALL) --mode=777 $$feature $(EXEC_DIRECTORY);\
        done
        @for common_file in $(BEHAVE_COMMON_FILES); do                                                        
                  \
-           $(LIBTOOL) --mode=install $(INSTALL) --mode=644 $$common_file $(EXEC_DIRECTORY);\
+           $(LIBTOOL) --mode=install $(INSTALL) --mode=777 $$common_file $(EXEC_DIRECTORY);\
        done
        @$(MKDIR_P) $(EXEC_DIRECTORY)/steps;
        @for step_definition in $(BEHAVE_STEP_DEFINITION); do                                                 
                  \
-           $(LIBTOOL) --mode=install $(INSTALL) --mode=644 $$step_definition $(EXEC_DIRECTORY)/steps;\
+           $(LIBTOOL) --mode=install $(INSTALL) --mode=777 $$step_definition $(EXEC_DIRECTORY)/steps;\
        done
 
 
@@ -106,7 +106,7 @@ installed-tests-data-hook:
        @for test in $(INSTALLED_TESTS); do                                                     \
            echo "Installing $$test.test to $(META_DIRECTORY)";                                 \
            echo m4_escape([[Test]]) > $(META_DIRECTORY)/$$test.test;                           \
-           echo "Exec=behave $(pkglibexecdir)/installed-tests -t $$test -k -f html -o $$test.html -f plain"  
  \
+           echo "Exec=behave $(pkglibexecdir)/installed-tests -i $$test -k -f html -o $$test.html -f plain"  
  \
                                                   >> $(META_DIRECTORY)/$$test.test;            \
            echo "Type=$(INSTALLED_TESTS_TYPE)" >> $(META_DIRECTORY)/$$test.test;               \
        done
diff --git a/tests/common_steps.py b/tests/common_steps.py
index 6d7f372..9bd283d 100644
--- a/tests/common_steps.py
+++ b/tests/common_steps.py
@@ -10,7 +10,7 @@ from signal import signal, alarm, SIGALRM
 from subprocess import Popen, PIPE
 from behave import step
 from gi.repository import GLib, Gio
-import fcntl, os
+import os
 
 from dogtail.rawinput import keyCombo, absoluteMotion, pressKey
 from dogtail.tree import root
diff --git a/tests/environment.py b/tests/environment.py
index e7e48ba..82c7ee0 100644
--- a/tests/environment.py
+++ b/tests/environment.py
@@ -31,7 +31,7 @@ def before_all(context):
         # Store scenario start time for session logs
         context.log_start_time = strftime("%Y-%m-%d %H:%M:%S", localtime())
 
-        context.app_class = App('./gnome-logs-behave-test')
+        context.app_class = App('/home/rashi/checkout/gnome/gnome-logs/tests/gnome-logs-behave-test')
 
     except Exception as e:
         print("Error in before_all: %s" % e.message)
@@ -57,23 +57,7 @@ def after_scenario(context, scenario):
     """
 
     try:
-        # Attach journalctl logs
-        if hasattr(context, "embed"):
-            os.system("journalctl /usr/bin/gnome-session --no-pager -o cat --since='%s'> 
/tmp/journal-session.log" % context.log_start_time)
-            data = open("/tmp/journal-session.log", 'r').read()
-            if data:
-                context.embed('text/plain', data)
-
-            context.app_class.kill()
-
-            stdout = non_block_read(context.app_class.process.stdout)
-            stderr = non_block_read(context.app_class.process.stderr)
-
-            if stdout:
-                context.embed('text/plain', stdout)
-
-            if stderr:
-                context.embed('text/plain', stderr)
+        context.app_class.kill()
 
         # Make some pause after scenario
         sleep(1)


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