summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-05-06 13:43:02 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-05-06 13:49:57 +0900
commit80a31d6c8a114799dc5284086ffce2e9be34c50e (patch)
tree1719891657e76c04f063f5ff7b5fdf63d9e562c3 /debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh
parente6ba08c3b21cdb14ee3a97b5d584759a4597b54b (diff)
downloadextra-dependencies-80a31d6c8a114799dc5284086ffce2e9be34c50e.tar.gz
extra-dependencies-80a31d6c8a114799dc5284086ffce2e9be34c50e.zip
uncrustify-trinity: updated based on upstream version 0.75.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh')
-rwxr-xr-xdebian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh
new file mode 100755
index 00000000..053cae17
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/tests/difftest.sh
@@ -0,0 +1,51 @@
+#! /bin/sh
+# Shows the difference for a failed test
+#
+
+if [ -n "$1" ] ; then
+ case "$1" in
+ -h|--help|--usage)
+ fn=$(basename $0)
+ echo "Usage: $fn [TEST [LANG]]"
+ echo
+ echo " TEST : the test number pattern, may contain wildcards"
+ echo " LANG : the language folder name: c, cpp, cs, d, java, oc, pawn, sql"
+ echo
+ echo "The script will find all matching tests in the output folder and diff them against the same"
+ echo "file in the results folder. The language is only required if the same test number is used"
+ echo "for multiple languages and you only want to see one of them."
+ echo
+ echo "Examples:"
+ echo "$fn # show all test failures"
+ echo "$fn 30014 # show test failure 30014"
+ echo "$fn '*' cpp # show all CPP test failure"
+ exit 1
+ ;;
+ esac
+fi
+
+# Use '*' as the pattern if one wasn't defined
+patt=$1
+if [ -z "$patt" ] ; then
+ patt="*"
+fi
+path="output"
+if [ -n "$2" ] ; then
+ path="$path/$2"
+fi
+
+# Find the tests that match, remove the .svn folders
+files=$(find $path -name "$patt-*" -type f | sed "/\.svn/d")
+
+did1=''
+for t in $files ; do
+ other=$(echo $t | sed "s/^output/results/")
+ diff -u $t $other
+ if [ "$?" = "1" ] ; then
+ did1='yup'
+ fi
+done
+
+if [ -z "$did1" ] ; then
+ echo "No differences"
+fi