2024-01-16 21:22:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Stop if anything fails
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Getting executable paths
|
2024-01-24 19:09:54 +00:00
|
|
|
baseExecutable=${1}
|
|
|
|
newExecutable=${2}
|
2024-01-16 21:22:36 +00:00
|
|
|
|
|
|
|
# Getting script name
|
|
|
|
script=${3}
|
|
|
|
|
|
|
|
# Getting additional arguments
|
|
|
|
testerArgs=${@:4}
|
|
|
|
|
|
|
|
# If running full cycle, add that to the hash file output
|
|
|
|
mode="normal"
|
|
|
|
if [ "${4}" = "--fullCycle" ]; then mode="fullCycle"; fi
|
|
|
|
|
2024-01-19 16:03:47 +00:00
|
|
|
# Getting current folder (game name)
|
|
|
|
folder=`basename $PWD`
|
|
|
|
|
|
|
|
# Getting pid (for uniqueness)
|
|
|
|
pid=$$
|
|
|
|
|
2024-01-16 21:39:18 +00:00
|
|
|
# Hash files
|
2024-01-24 19:09:54 +00:00
|
|
|
baseHashFile="/tmp/quickerNES.${folder}.${script}.${mode}.${pid}.hash"
|
|
|
|
newHashFile="/tmp/quickNES.${folder}.${script}.${mode}.${pid}.hash"
|
2024-01-16 21:39:18 +00:00
|
|
|
|
|
|
|
# Removing them if already present
|
2024-01-24 19:09:54 +00:00
|
|
|
rm -f ${baseHashFile}
|
|
|
|
rm -f ${newHashFile}
|
2024-01-16 21:39:18 +00:00
|
|
|
|
2024-01-21 14:34:15 +00:00
|
|
|
set -x
|
2024-01-16 21:22:36 +00:00
|
|
|
# Running script on quickerNES
|
2024-01-24 19:09:54 +00:00
|
|
|
${baseExecutable} ${script} --hashOutputFile ${baseHashFile} ${testerArgs}
|
2024-01-16 21:22:36 +00:00
|
|
|
|
|
|
|
# Running script on quickNES
|
2024-01-24 19:09:54 +00:00
|
|
|
${newExecutable} ${script} --hashOutputFile ${newHashFile} ${testerArgs}
|
2024-01-21 14:34:15 +00:00
|
|
|
set +x
|
2024-01-16 21:22:36 +00:00
|
|
|
|
|
|
|
# Comparing hashes
|
2024-01-24 19:09:54 +00:00
|
|
|
baseHash=`cat ${baseHashFile}`
|
2024-01-16 21:22:36 +00:00
|
|
|
|
|
|
|
# Comparing hashes
|
2024-01-24 19:09:54 +00:00
|
|
|
newHash=`cat ${newHashFile}`
|
2024-01-16 21:22:36 +00:00
|
|
|
|
2024-01-17 17:25:55 +00:00
|
|
|
# Removing temporary files
|
2024-01-24 19:09:54 +00:00
|
|
|
rm -f ${baseHashFile} ${newHashFile}
|
2024-01-17 17:25:55 +00:00
|
|
|
|
2024-01-16 21:22:36 +00:00
|
|
|
# Compare hashes
|
2024-01-24 19:09:54 +00:00
|
|
|
if [ "${baseHash}" = "${newHash}" ]; then
|
2024-01-16 21:22:36 +00:00
|
|
|
echo "[] Test Passed"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "[] Test Failed"
|
|
|
|
exit -1
|
|
|
|
fi
|