Skip to content

Commit

Permalink
Merge pull request #6 from GaloisInc/benchmarking
Browse files Browse the repository at this point in the history
Benchmarking test
  • Loading branch information
jprider63 committed Aug 27, 2024
2 parents 3ea8e72 + 3a1c0bb commit 4ac053b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

# cancel in-progress job when a new push is performed
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
group: ci-bench-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -35,7 +35,7 @@ jobs:

- name: System dependencies (ubuntu)
run: |
sudo apt install build-essential libgmp-dev z3 opam cmake
sudo apt install build-essential libgmp-dev z3 opam cmake jq
- name: Restore cached opam
id: cache-opam-restore
Expand Down
25 changes: 10 additions & 15 deletions tests/run-ci-benchmarks.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail -o noclobber
# set -xv # uncomment to debug variables

JSON_FILE="benchmark-data.json"

cat << EOF >> ${JSON_FILE}
[
EOF
echo "[" >> "${JSON_FILE}"

DIRNAME=$(dirname "$0")

SUCC=$(find "${DIRNAME}"/cn -name '*.c' | grep -v '\.error\.c')
TESTS=$(find "${DIRNAME}"/cn -name '*.c')

COUNT=0
for TEST in ${SUCC}; do
for TEST in ${TESTS}; do
let COUNT=${COUNT}+1
done

INDEX=0
echo $SUCC
echo $COUNT
for TEST in ${SUCC}; do
echo ${INDEX}
for TEST in ${TESTS}; do

# Record wall clock time in seconds
/usr/bin/time -f "%e" -o /tmp/time cn verify ${TEST}
/usr/bin/time --quiet -f "%e" -o /tmp/time cn verify "${TEST}" || true
TIME=$(cat /tmp/time)

# If we're last, don't print a trailing comma.
Expand All @@ -48,8 +45,6 @@ EOF
let INDEX=${INDEX}+1
done

cat << EOF >> ${JSON_FILE}
]
EOF
echo "]" >> "${JSON_FILE}"

cat ${JSON_FILE}
jq . "${JSON_FILE}"

0 comments on commit 4ac053b

Please sign in to comment.