|
|
|
@ -6,6 +6,25 @@ IFS=$'\n\t'
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
|
|
failed_count=0
|
|
|
|
|
show_diff=0
|
|
|
|
|
|
|
|
|
|
while (( "$#" )); do
|
|
|
|
|
if [ "$1" = "--help" ]; then
|
|
|
|
|
cat<<EOF
|
|
|
|
|
Runs the full compliance test suite.
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
--show-diff Shows the difference between the two dust implementations
|
|
|
|
|
EOF
|
|
|
|
|
exit 0
|
|
|
|
|
elif [ "$1" = "--show-diff" ]; then
|
|
|
|
|
show_diff=1
|
|
|
|
|
else
|
|
|
|
|
(>&2 echo "Unrecognized option: $1")
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
while read -r test_group; do
|
|
|
|
|
test_group_name=$(basename "$test_group")
|
|
|
|
@ -14,11 +33,13 @@ while read -r test_group; do
|
|
|
|
|
test_case_name=${test_case_file_name%.*}
|
|
|
|
|
set +e
|
|
|
|
|
(
|
|
|
|
|
if cmp --quiet <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') node "$DIR/dustjs_shim.js" < "$test_case") <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') "$DIR/../target/debug/duster-cli" < "$test_case"); then
|
|
|
|
|
if cmp -s <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') node "$DIR/dustjs_shim.js" < "$test_case") <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') "$DIR/../target/debug/duster-cli" < "$test_case"); then
|
|
|
|
|
echo "$test_group_name::$test_case_name PASSED"
|
|
|
|
|
else
|
|
|
|
|
echo "$test_group_name::$test_case_name FAILED"
|
|
|
|
|
diff <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') node "$DIR/dustjs_shim.js" < "$test_case") <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') "$DIR/../target/debug/duster-cli" < "$test_case")
|
|
|
|
|
if [ $show_diff -eq 1 ]; then
|
|
|
|
|
diff --label "dustjs-linked" --label "duster" <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') node "$DIR/dustjs_shim.js" < "$test_case") <(xargs -a <(find "$test_group" -maxdepth 1 -mindepth 1 -type f -name 'main.dust'; find "$test_group" -maxdepth 1 -mindepth 1 -type f -name '*.dust' ! -name 'main.dust') "$DIR/../target/debug/duster-cli" < "$test_case")
|
|
|
|
|
fi
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
)
|
|
|
|
|