From 11800635cd685832781d9043a6d2da95cf04a492 Mon Sep 17 00:00:00 2001 From: Sergio Martin Date: Wed, 24 Jan 2024 20:09:54 +0100 Subject: [PATCH] Adding main push test and homogenizing test running --- .github/workflows/make.yml | 2 ++ tests/run_test.sh | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index c5f67eb..efbbabc 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -3,6 +3,8 @@ name: Build and Run Tests on: pull_request: branches: [ "main" ] + push: + branches: [ "main" ] jobs: build: diff --git a/tests/run_test.sh b/tests/run_test.sh index 4817da1..7286838 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -4,8 +4,8 @@ set -e # Getting executable paths -quickerNESExecutable=${1} -quickNESExecutable=${2} +baseExecutable=${1} +newExecutable=${2} # Getting script name script=${3} @@ -24,32 +24,32 @@ folder=`basename $PWD` pid=$$ # Hash files -quickerNESHashFile="/tmp/quickerNES.${folder}.${script}.${mode}.${pid}.hash" -quickNESHashFile="/tmp/quickNES.${folder}.${script}.${mode}.${pid}.hash" +baseHashFile="/tmp/quickerNES.${folder}.${script}.${mode}.${pid}.hash" +newHashFile="/tmp/quickNES.${folder}.${script}.${mode}.${pid}.hash" # Removing them if already present -rm -f ${quickerNESHashFile} -rm -f ${quickNESHashFile} +rm -f ${baseHashFile} +rm -f ${newHashFile} set -x # Running script on quickerNES -${quickerNESExecutable} ${script} --hashOutputFile ${quickerNESHashFile} ${testerArgs} +${baseExecutable} ${script} --hashOutputFile ${baseHashFile} ${testerArgs} # Running script on quickNES -${quickNESExecutable} ${script} --hashOutputFile ${quickNESHashFile} ${testerArgs} +${newExecutable} ${script} --hashOutputFile ${newHashFile} ${testerArgs} set +x # Comparing hashes -quickerNESHash=`cat ${quickerNESHashFile}` +baseHash=`cat ${baseHashFile}` # Comparing hashes -quickNESHash=`cat ${quickNESHashFile}` +newHash=`cat ${newHashFile}` # Removing temporary files -rm -f ${quickerNESHashFile} ${quickNESHashFile} +rm -f ${baseHashFile} ${newHashFile} # Compare hashes -if [ "${quickerNESHash}" = "${quickNESHash}" ]; then +if [ "${baseHash}" = "${newHash}" ]; then echo "[] Test Passed" exit 0 else