Last active
October 24, 2025 13:44
-
-
Save Raimo33/ca3b8a157861e42167ede3322e2e3df8 to your computer and use it in GitHub Desktop.
Test the previous N commits sequentially (Bitcoincore)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| N=${1:-1} | |
| CURRENT_COMMIT=$(git rev-parse HEAD) | |
| COMMITS=$(git rev-list --max-count="$N" --reverse HEAD) | |
| trap 'git checkout -q "$CURRENT_COMMIT"' EXIT SIGINT SIGTERM | |
| RED="\033[0;31m" | |
| GREEN="\033[0;32m" | |
| YELLOW="\033[1;33m" | |
| NC="\033[0m" | |
| for COMMIT in $COMMITS; do | |
| git checkout -q "$COMMIT" | |
| COMMIT_MSG=$(git log -1 --pretty=format:"%s") | |
| echo -en "${YELLOW}Testing commit ${COMMIT}: '${COMMIT_MSG}'${NC}" | |
| cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON --fresh | |
| ninja -C build test_bitcoin | |
| ./build/bin/test_bitcoin | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment