Skip to content

Commit

Permalink
Merge branch 'patchable-ir-main' into ekilmer/uid-codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
2over12 authored Oct 12, 2023
2 parents cf7798c + 91c7162 commit b1925fe
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,30 @@ jobs:
run: |
dpkg -i ${{ steps.package_names.outputs.DEB_PACKAGE_PATH }}
- name: Run Integration Tests (AnghaBench 50)
shell: bash
working-directory: ${{ steps.build_paths.outputs.REL_SOURCE }}/anvill
run: |
python3 -m pip install -r libraries/lifting-tools-ci/requirements.txt
scripts/test-angha-50.sh \
--ghidra-install-dir $GHIDRA_INSTALL_DIR \
--decompile-cmd "anvill-decompile-spec" \
--jobs 8
- name: Tar and Compress logs
if: failure()
run: |
shopt -s globstar
tar -cf test-errs.tar.xz ${{ steps.build_paths.outputs.REL_SOURCE }}/anvill/angha-test-50/**/std*
shell: bash

- name: Upload stderr/stdout logs on error
if: failure()
uses: actions/upload-artifact@v3
with:
name: AnghaBench 50 logs
path: test-errs.tar.xz

- name: Store the DEB package
uses: actions/upload-artifact@v3
with:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion libraries/lifting-tools-ci
29 changes: 21 additions & 8 deletions scripts/test-angha-1k.sh → scripts/test-angha-50.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ GHIDRA_INSTALL_DIR="~/ghidra_10.1.5_PUBLIC/"
ANVILL_DECOMPILE="anvill-decompile-spec"
function Help
{
echo "Run Anvill on AnghaBech-1K"
echo "Run Anvill on AnghaBench-50"
echo ""
echo "Options:"
echo " --ghidra-install-dir <dir> The ghidra install dir. Default ${GHIDRA_INSTALL_DIR}"
echo " --decompile-cmd <cmd> The anvill decompile command to invoke. Default ${ANVILL_DECOMPILE}"
echo " --jobs <N> The number of jobs that can run concurrently. Defaults to system's CPU count"
echo " -h --help Print help."
}

Expand Down Expand Up @@ -69,6 +70,12 @@ while [[ $# -gt 0 ]] ; do
--decompile-cmd)
ANVILL_DECOMPILE=${2}
shift # past argument
;;

# How many concurrent jobs
--jobs)
NUM_JOBS=${2}
shift # past argument
;;

*)
Expand All @@ -90,17 +97,17 @@ fi


if ! ${ANVILL_DECOMPILE} --version &>/dev/null;
then
then
echo "[!] Could not execute anvill decompile cmd: ${ANVILL_DECOMPILE}"
exit 1
fi

# create a working directory
mkdir -p angha-test-1k
pushd angha-test-1k
mkdir -p angha-test-50
pushd angha-test-50

# fetch the test set: 1K binaries (per arch)
${SRC_DIR}/libraries/lifting-tools-ci/datasets/fetch_anghabench.sh --run-size 1k --binaries
# fetch the test set: 50 binaries (per arch)
${SRC_DIR}/libraries/lifting-tools-ci/datasets/fetch_anghabench.sh --run-size 50 --binaries
# extract it
for tarfile in *.tar.xz
do
Expand All @@ -111,14 +118,20 @@ FAILED="no"
for arch in $(ls -1 binaries/)
do
echo "[+] Testing architecture ${arch}"
${SRC_DIR}/libraries/lifting-tools-ci/tool_run_scripts/anvill.py \
args=(
--ghidra-install-dir "${GHIDRA_INSTALL_DIR}" \
--anvill-decompile "${ANVILL_DECOMPILE}" \
--input-dir "$(pwd)/binaries/${arch}" \
--output-dir "$(pwd)/results/${arch}" \
--run-name "anvill-live-ci-${arch}" \
--test-options "${SRC_DIR}/ci/angha_1k_test_settings.json" \
--test-options "${SRC_DIR}/ci/angha_50_test_settings.json" \
--dump-stats
)
if [[ -v NUM_JOBS ]]; then
args+=(--jobs "${NUM_JOBS}")
fi
${SRC_DIR}/libraries/lifting-tools-ci/tool_run_scripts/anvill.py "${args[@]}"



if ! check_test "$(pwd)/results/${arch}/python/stats.json"
Expand Down

0 comments on commit b1925fe

Please sign in to comment.