Blame 0001-hack-test.patch

7568b7
From 8d9408c9448d8fa243b7afead3f39ab23a03a1d9 Mon Sep 17 00:00:00 2001
5ddba6
From: Jeremy Linton <jeremy.linton@arm.com>
5ddba6
Date: Tue, 27 Aug 2024 20:11:01 -0500
5ddba6
Subject: [PATCH] hack test
5ddba6
5ddba6
The opencsd tests have an option to test an installed
5ddba6
trc_pkt_lister for basic decoding, yet the comparison fails
5ddba6
because they shift off the parameter after checking it the
5ddba6
first time. Hack off the 'shift' and it works for our purposes.
5ddba6
5ddba6
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
5ddba6
---
5ddba6
 decoder/tests/run_pkt_decode_tests.bash | 14 +++-----------
5ddba6
 1 file changed, 3 insertions(+), 11 deletions(-)
5ddba6
5ddba6
--- a/decoder/tests/run_pkt_decode_tests.bash
5ddba6
+++ b/decoder/tests/run_pkt_decode_tests.bash
5ddba6
@@ -46,6 +46,8 @@
5ddba6
 # run_pkt_decode_tests.bash -bindir <custom>/<path>/ <options>
5ddba6
 #
5ddba6
 
5ddba6
+set -e
5ddba6
+
5ddba6
 OUT_DIR=./results
5ddba6
 SNAPSHOT_DIR=./snapshots
5ddba6
 BIN_DIR=./bin/linux64/rel/
Michel Lind 771205
@@ -73,10 +75,7 @@ echo "Running trc_pkt_lister on snapshot
5ddba6
 
5ddba6
 mkdir -p ${OUT_DIR}
5ddba6
 
5ddba6
-if [ "$1" == "use-installed" ]; then
5ddba6
-    BIN_DIR=""
5ddba6
-    shift
5ddba6
-elif [ "$1" == "-bindir" ]; then
5ddba6
+if [ "$1" == "-bindir" ]; then
5ddba6
     BIN_DIR=$2
5ddba6
     shift
5ddba6
     shift
5ddba6
@@ -84,11 +83,6 @@ fi
5ddba6
 
5ddba6
 echo "Tests using BIN_DIR = ${BIN_DIR}"
5ddba6
 
5ddba6
-if [ "${BIN_DIR}" != "" ]; then
5ddba6
-    export LD_LIBRARY_PATH=${BIN_DIR}.
5ddba6
-    echo "LD_LIBRARY_PATH set to ${BIN_DIR}"
5ddba6
-fi
5ddba6
-
5ddba6
 # === test the decode set ===
5ddba6
 for test_dir in "${test_dirs_decode[@]}"
5ddba6
 do
5ddba6
@@ -105,7 +99,6 @@ env | grep OPENCSD
Michel Lind 771205
 ${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/juno_r1_1" $@ -decode -no_time_print -logfilename "${OUT_DIR}/juno_r1_1_rangelimit.ppl"
5ddba6
 unset OPENCSD_INSTR_RANGE_LIMIT
5ddba6
 echo "Done : Return $?"
5ddba6
-env | grep OPENCSD
5ddba6
 
7568b7
 echo "Test with bad opcode detect on using env var..."
5ddba6
 export OPENCSD_ERR_ON_AA64_BAD_OPCODE=1
5ddba6
@@ -113,7 +106,6 @@ env | grep OPENCSD
Michel Lind 771205
 ${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/juno_r1_1" $@ -decode -no_time_print -logfilename "${OUT_DIR}/juno_r1_1_badopcode.ppl"
5ddba6
 unset OPENCSD_ERR_ON_AA64_BAD_OPCODE
5ddba6
 echo "Done : Return $?"
5ddba6
-env | grep OPENCSD
5ddba6
 
7568b7
 echo "Test with bad opcode detect on using flag..."
Michel Lind 771205
 ${BIN_DIR}trc_pkt_lister -ss_dir "${SNAPSHOT_DIR}/juno_r1_1" $@ -decode -no_time_print -aa64_opcode_chk -logfilename "${OUT_DIR}/juno_r1_1_badopcode_flag.ppl"