You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-commits@incubator.apache.org by jp...@apache.org on 2011/12/10 22:17:57 UTC

[zeta-commits] svn commit: r1212900 - /incubator/zetacomponents/scripts/tests_filenames.sh

Author: jpic
Date: Sat Dec 10 22:17:57 2011
New Revision: 1212900

URL: http://svn.apache.org/viewvc?rev=1212900&view=rev
Log:
- Added tests_filenames.sh: helps migration to PHPUnit 3.5

Added:
    incubator/zetacomponents/scripts/tests_filenames.sh   (with props)

Added: incubator/zetacomponents/scripts/tests_filenames.sh
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/scripts/tests_filenames.sh?rev=1212900&view=auto
==============================================================================
--- incubator/zetacomponents/scripts/tests_filenames.sh (added)
+++ incubator/zetacomponents/scripts/tests_filenames.sh Sat Dec 10 22:17:57 2011
@@ -0,0 +1,47 @@
+#!/bin/bash
+my_mv="$1"
+component="$2"
+
+if [ -z "$my_mv" ]; then
+    echo This script finds test files which are not suffixed with _test.php
+    echo and it can fix it.
+    echo 
+    echo Arguments: 
+    echo scripts/tests_filenames.sh 'MV COMMAND' [component]
+    echo 
+    echo Usages:
+    echo scripts/tests_filenames.sh 'echo'
+    echo scripts/tests_filenames.sh 'mv'
+    echo scripts/tests_filenames.sh 'svn mv'
+    echo
+    echo Optionnaly, suffix the command with a component name to work with only
+    echo one component
+    exit 1
+fi
+
+echo MV Command: $my_mv
+if [ -n "$component" ]; then
+    echo Component: $component
+fi
+
+for c in trunk/*; do
+    if [ ! -d "$c" ]; then
+        continue
+    fi
+
+    if [ -n "$component" -a "${c##trunk/}" != "$component" ]; then
+        continue
+    fi
+
+    for f in $(find $c/tests -name '*php' -not -iwholename '*.svn*' -not -iwholename '*_test.php'); do
+        grep -q 'extends ezcTestCase' $f
+        if [ $? -eq 0 ]; then
+            if [[ $f == '_tests.php' ]]; then
+                $my_mv $f ${f%tests.php}_test.php
+            else
+                $my_mv $f ${f%.php}_test.php
+            fi
+        fi
+    done
+done
+

Propchange: incubator/zetacomponents/scripts/tests_filenames.sh
------------------------------------------------------------------------------
    svn:executable = *