[Xfce4-commits] <midori:master> Support sh/ py unit tests: add license unit test

Christian Dywan noreply at xfce.org
Fri Nov 16 02:00:01 CET 2012


Updating branch refs/heads/master
         to ee73e9625c1427cec3466eeb03dddd32be0b72de (commit)
       from a27612a6d06c8cce084a074ef88fcc674a86df01 (commit)

commit ee73e9625c1427cec3466eeb03dddd32be0b72de
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Nov 16 01:07:12 2012 +0100

    Support sh/ py unit tests: add license unit test
    
    Add missing licenses to gtkiconentry.h,
        midori-extension-columns.vala,
        gtk3-compat.*

 katze/gtk3-compat.c                  |   11 +++++++++++
 katze/gtk3-compat.h                  |   11 +++++++++++
 midori/gtkiconentry.c                |   16 ----------------
 midori/gtkiconentry.h                |    4 ----
 midori/midori-extensions-column.vala |   10 ++++++++++
 midori/midori-searchaction.c         |    3 +--
 tests/license.sh                     |   11 +++++++++++
 tests/wscript_build                  |   27 +++++++++++++++++++--------
 8 files changed, 63 insertions(+), 30 deletions(-)

diff --git a/katze/gtk3-compat.c b/katze/gtk3-compat.c
index d7fd249..b43f375 100644
--- a/katze/gtk3-compat.c
+++ b/katze/gtk3-compat.c
@@ -1,3 +1,14 @@
+/*
+ Copyright (C) 2011-2012 Christian Dywan <christian at twotoasts.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ See the file COPYING for the full license text.
+*/
+
 #include "katze/gtk3-compat.h"
 
 #if !GTK_CHECK_VERSION (3, 2, 0) && !defined (HAVE_HILDON_2_2)
diff --git a/katze/gtk3-compat.h b/katze/gtk3-compat.h
index 28f38e9..1b0b456 100644
--- a/katze/gtk3-compat.h
+++ b/katze/gtk3-compat.h
@@ -1,3 +1,14 @@
+/*
+ Copyright (C) 2011-2012 Christian Dywan <christian at twotoasts.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ See the file COPYING for the full license text.
+*/
+
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
diff --git a/midori/gtkiconentry.c b/midori/gtkiconentry.c
deleted file mode 100644
index c15ac1f..0000000
--- a/midori/gtkiconentry.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "gtkiconentry.h"
-
-void
-gtk_icon_entry_set_icon_from_pixbuf (GtkEntry*            entry,
-                                     GtkEntryIconPosition position,
-                                     GdkPixbuf*           pixbuf)
-{
-    gboolean activatable;
-
-    /* Without this ugly hack pixbuf icons don't work */
-    activatable = gtk_entry_get_icon_activatable (entry, position);
-    gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
-    gtk_entry_set_icon_activatable (entry, position, !activatable);
-    gtk_entry_set_icon_activatable (entry, position, activatable);
-}
-
diff --git a/midori/gtkiconentry.h b/midori/gtkiconentry.h
index daa1819..9058662 100644
--- a/midori/gtkiconentry.h
+++ b/midori/gtkiconentry.h
@@ -36,10 +36,6 @@ G_BEGIN_DECLS
     #define gtk_icon_entry_set_icon_from_stock gtk_entry_set_icon_from_stock
     #define gtk_icon_entry_set_icon_from_icon_name gtk_entry_set_icon_from_icon_name
 
-    void
-    gtk_icon_entry_set_icon_from_pixbuf (GtkEntry*            entry,
-                                         GtkEntryIconPosition position,
-                                         GdkPixbuf*           pixbuf);
     #define gtk_icon_entry_set_tooltip gtk_entry_set_icon_tooltip_text
     #define gtk_icon_entry_get_tooltip gtk_entry_get_icon_tooltip_text
     #define gtk_icon_entry_set_icon_highlight gtk_entry_set_icon_activatable
diff --git a/midori/midori-extensions-column.vala b/midori/midori-extensions-column.vala
index 2fd1b20..49889f1 100644
--- a/midori/midori-extensions-column.vala
+++ b/midori/midori-extensions-column.vala
@@ -1,3 +1,13 @@
+/*
+   Copyright (C) 2012 André Stösel <andre at stoesel.de>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   See the file COPYING for the full license text.
+*/
 
 public class Midori.ExtensionsColumn : Gtk.TreeViewColumn {
     public signal void row_clicked (Gtk.TreeView view, Gtk.TreePath path);
diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c
index 6444431..c5d2961 100644
--- a/midori/midori-searchaction.c
+++ b/midori/midori-searchaction.c
@@ -529,8 +529,7 @@ midori_search_action_set_entry_icon (MidoriSearchAction* search_action,
                                               entry, &icon_name, TRUE);
         if (icon)
         {
-            gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
-                                                 GTK_ICON_ENTRY_PRIMARY, icon);
+            gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, icon);
             g_object_unref (icon);
         }
         else
diff --git a/tests/license.sh b/tests/license.sh
new file mode 100755
index 0000000..59467cc
--- /dev/null
+++ b/tests/license.sh
@@ -0,0 +1,11 @@
+#! /usr/bin/env sh
+# Copyright 2012 Christian Dywan <christian at twotoasts.de>
+#
+# This script is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+echo Running 'licensecheck'
+test -n "$SRCDIR" && cd $SRCDIR
+find . \! -path './.waf*/*' -a \! -path './_build/*' | xargs licensecheck | grep UNKNOWN && exit 1
+echo ...OK
diff --git a/tests/wscript_build b/tests/wscript_build
index 96780c8..6539dc4 100644
--- a/tests/wscript_build
+++ b/tests/wscript_build
@@ -3,6 +3,8 @@
 # This file is licensed under the terms of the expat license, see the file EXPAT.
 
 import os
+import sys
+import Utils
 
 tests = os.listdir ('tests')
 for test in tests:
@@ -16,15 +18,24 @@ for test in tests:
                 source += ' ' + test + os.sep + fila
         if not source:
             Utils.pprint ('RED', folder + ': No source files found')
-            continue
-    else:
-        if test[-2:] == '.c':
-            target = test[:-2]
-        elif test[-5:] == '.vala':
-            target = test[:-5]
-        else:
-            continue
+            sys.exit (1)
+
+    elif test[-3:] == '.py' or test[-3:] == '.sh':
+        obj = bld.new_task_gen ('command-output')
+        obj.no_inputs = obj.no_outputs = obj.command_is_external = True
+        obj.command = ['python', 'sh'][test[-3:] == '.sh']
+        os.environ['SRCDIR'] = os.getcwd ()
+        obj.argv = [os.path.join (os.getcwd (), folder)]
+        continue
+    elif test[-2:] == '.c':
+        target = test[:-2]
         source = test
+    elif test[-5:] == '.vala':
+        target = test[:-5]
+        source = test
+    else:
+        Utils.pprint ('YELLOW', folder + ': Skipped')
+        continue
 
     obj = bld.new_task_gen ('cc', 'program')
     obj.target = 'test-' + target


More information about the Xfce4-commits mailing list