yuicompressor/yuicompressor-tests.patch
Mattias Ellert bd55379bb7 Fix test script
Don't use /dev/stderr (permission denied)
  Replace egrep with grep -E
2022-09-21 11:11:13 +02:00

71 lines
1.6 KiB
Diff

diff -ur yuicompressor-2.4.8.orig/tests/suite.sh yuicompressor-2.4.8/tests/suite.sh
--- yuicompressor-2.4.8.orig/tests/suite.sh 2013-05-15 09:23:58.000000000 +0200
+++ yuicompressor-2.4.8/tests/suite.sh 2022-09-21 10:18:43.502934886 +0200
@@ -1,7 +1,7 @@
-#!/usr/bin/env bash
+#!/bin/sh
cd $(dirname $0)
-
+
# Get the jar to use.
jar="$(ls ../build/*.jar | sort | tail -n1)"
echo "jar: $jar"
@@ -13,22 +13,15 @@
cat $expected
)"
filetype="$(
- echo $testfile | egrep -o '(cs|j)s'
+ echo $testfile | grep -E -o '(cs|j)s'
+ )"
+
+ actual="$(
+ java -cp $(build-classpath jargs):$jar com.yahoo.platform.yui.compressor.Bootstrap --type $filetype $testfile
)"
-
- if [ "$2" == "cssminjs" ]; then
- actual="$(
- java -jar ../lib/rhino-1.7R2.jar suite.rhino $testfile
- )"
-
- else
- actual="$(
- java -jar $jar --type $filetype $testfile
- )"
- fi
-
+
if [ "$expected" == "$actual" ]; then
- echo "Passed: $testfile" > /dev/stderr
+ echo "Passed: $testfile" 1>&2
else
(
echo "Test failed: $testfile"
@@ -38,25 +31,17 @@
echo ""
echo "Actual:"
echo "$actual"
- ) > /dev/stderr
+ ) 1>&2
return 1
fi
}
ls *.FAIL 2>/dev/null | while read failtest; do
- echo "Failing test: " $failtest > /dev/stderr
+ echo "Failing test: " $failtest 1>&2
runtest $failtest && echo "Test passed, please remove the '.FAIL' from the filename"
done
ls *.{css,js} | while read testfile; do
runtest $testfile || exit 1
done
-
-echo
-echo "now testing the JS port of CSSMIN..."
-ls *.css | while read testfile; do
- runtest $testfile "cssminjs" || exit 1
-done
-
-exit 0