[nautilus-actions] Install two check, not distributable, scripts
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Install two check, not distributable, scripts
- Date: Sat, 27 Feb 2010 23:19:05 +0000 (UTC)
commit ed7dc5ea534fd392f5830883cb6b84c85253b56e
Author: Pierre Wieser <pwieser trychlos org>
Date: Fri Feb 26 08:34:58 2010 +0100
Install two check, not distributable, scripts
ChangeLog | 5 ++
src/test/check-po.sh | 101 +++++++++++++++++++++++++++++++++++++++++++
src/test/dbus-introspect.sh | 6 ++-
src/test/time.sh | 39 ++++++++++++++++
4 files changed, 149 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8941b7e..f1bfb37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-26 Pierre Wieser <pwieser trychlos org>
+
+ * src/test/check-po.sh: Test cpompleteness of po/POTFILES.in.
+ * src/test/time.sh: Bench the elapsed build time.
+
2009-02-25 Pierre Wieser <pwieser trychlos org>
* po/POTFILES.in: Updated.
diff --git a/src/test/check-po.sh b/src/test/check-po.sh
new file mode 100755
index 0000000..030fab3
--- /dev/null
+++ b/src/test/check-po.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# a small script to check the completeness of po/POTFILES.in
+#
+# should be ran from top_srcdir
+
+PO=po/POTFILES.in
+if [ ! -r ${PO} ]; then
+ echo "${PO}: file not found" 1>&2
+ echo "This script should be ran from top_srcdir." 1>&2
+ exit 1
+fi
+
+# first, check that all .ui are in po/POTFILE.in
+
+total=0
+count=0
+errs=0
+echo ""
+echo "checking that all .ui are in ${PO}..."
+for f in $(find src -name '*.ui' | sed 's?^\./??'); do
+ if [ "$(grep -x ${f} ${PO})" != "${f}" ]; then
+ echo " ${f} should be added to ${PO}"
+ let errs+=1
+ fi
+ let count+=1
+done
+echo "pass 1/5: count=${count} error(s)=${errs}"
+let total+=${errs}
+
+# second, check that all .ui in PO exist
+
+count=0
+errs=0
+echo ""
+echo "checking that all .ui from ${PO} actually exist..."
+for f in $(grep -E '\.ui$' ${PO}); do
+ if [ ! -r ${f} ]; then
+ echo " ${f} should be removed from ${PO}"
+ let errs+=1
+ fi
+ let count+=1
+done
+echo "pass 2/5: count=${count} error(s)=${errs}"
+let total+=${errs}
+
+# third, check that all files which use _( construct are in PO
+
+count=0
+errs=0
+echo ""
+echo "checking that all translatable files are in ${PO}..."
+exceptions_pass3="src/test/check-po.sh"
+for f in $(git grep '_(' src | cut -d: -f1 | sort -u); do
+ if [ "$(echo ${exceptions_pass3} | grep -w ${f})" = "" ]; then
+ if [ "$(grep -x ${f} ${PO})" != "${f}" ]; then
+ echo " ${f} should be added to ${PO}"
+ let errs+=1
+ fi
+ fi
+ let count+=1
+done
+echo "pass 3/5: count=${count} error(s)=${errs}"
+let total+=${errs}
+
+# fourth, check that all files in PO actually use the _( construct
+
+count=0
+errs=0
+echo ""
+echo "checking that all files in ${PO} actually use the '_(' construct..."
+for f in $(grep -E '^src/' ${PO} | grep -vE '\.ui$' | grep -vE '\.in$'); do
+ grep '_(' ${f} 1>/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo " ${f} should be removed from ${PO}"
+ let errs+=1
+ fi
+ let count+=1
+done
+echo "pass 4/5: count=${count} error(s)=${errs}"
+let total+=${errs}
+
+# last, check that all files which include gi18n.h are relevant
+
+count=0
+errs=0
+echo ""
+echo "checking that all files have a good reason to include gi18n.h..."
+for f in $(git grep '#include <glib/gi18n.h>' src | cut -d: -f1 | sort -u); do
+ grep '_(' ${f} 1>/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo " ${f} should not include <glib/gi18n.h>"
+ let errs+=1
+ fi
+ let count+=1
+done
+echo "pass 5/5: count=${count} error(s)=${errs}"
+let total+=${errs}
+
+echo ""
+echo "total: ${total} error(s)."
diff --git a/src/test/dbus-introspect.sh b/src/test/dbus-introspect.sh
index 2395f48..b0d19d7 100755
--- a/src/test/dbus-introspect.sh
+++ b/src/test/dbus-introspect.sh
@@ -1,9 +1,11 @@
#!/bin/sh
+#
+# let's check the NATracker service
NA_SERVICE=org.nautilus-actions.DBus
NA_PATH_TRACKER=/org/nautilus_actions/DBus/Tracker
echo ""
-echo "D-Bus service = '${NA_SERVICE}'"
-echo "D-Bus tracker path = '${NA_PATH_TRACKER}'"
+echo "D-Bus service = ${NA_SERVICE}"
+echo "D-Bus tracker path = ${NA_PATH_TRACKER}"
dbus-send --session --type=method_call --print-reply --dest=${NA_SERVICE} ${NA_PATH_TRACKER} org.freedesktop.DBus.Introspectable.Introspect
diff --git a/src/test/time.sh b/src/test/time.sh
new file mode 100755
index 0000000..c88d993
--- /dev/null
+++ b/src/test/time.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# this small script is used both to follow the increase of the product
+# and to bench our workstations
+# very simple indeed !
+#
+# should be run from top_srcdir
+
+if [ ! -r ./autogen.sh ]; then
+ echo "This script should be ran from top_srcdir." 1>&2
+ exit 1
+fi
+
+function do_build
+{
+ ./autogen.sh \
+ --prefix=$(pwd)/install \
+ --with-nautilus-extdir=$(pwd)/install/lib/nautilus \
+ --disable-schemas-install &&
+ make clean &&
+ make &&
+ make install
+}
+
+function loop_build
+{
+ i=0
+ while [ ${i} -lt ${count} ]; do
+ do_build
+ let i+=1
+ done
+}
+
+###
+### MAIN
+###
+
+count=1
+time loop_build
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]