nashorn/bin/rundiff.sh
author chegar
Sun, 17 Aug 2014 15:51:56 +0100
changeset 25868 686eef1e7a79
parent 24719 f726e9d67629
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     1
#!/bin/sh
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     2
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     3
# do two runs of a script, one optimistic and one pessimistic, expect identical outputs
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     4
# if not, display and error message and a diff
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     5
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     6
which opendiff >/dev/null
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     7
RES=$?
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     8
if [ $RES = 0 ]; then
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     9
    DIFFTOOL=opendiff
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    10
else
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    11
    DIFFTOOL=diff
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    12
fi
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    13
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    14
OPTIMISTIC=out_optimistic
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    15
PESSIMISTIC=out_pessimistic
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    16
$JAVA_HOME/bin/java -ea -jar ../dist/nashorn.jar ${@} >$PESSIMISTIC
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    17
$JAVA_HOME/bin/java -ea -Dnashorn.optimistic -jar ../dist/nashorn.jar ${@} >$OPTIMISTIC
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    18
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    19
if ! diff -q $PESSIMISTIC $OPTIMISTIC >/dev/null ; then
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    20
    echo "Failure! Results are different"
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    21
    echo ""
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    22
    $DIFFTOOL $PESSIMISTIC $OPTIMISTIC
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    23
else
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    24
    echo "OK - Results are identical"
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    25
fi