Skip to content

Commit

Permalink
add workflow and tests for xxhash
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
  • Loading branch information
trollkarlen authored and pauldreik committed Feb 1, 2025
1 parent 53c44b9 commit c3915fe
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 10 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ubuntu-default-with-xxhash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: ubuntu default build with xxhash

"on":
push:
branches:
- main
- devel
pull_request:

jobs:
build:
name: Test on ${{ matrix.os }} with xxhash
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]

steps:
- name: checkout
uses: actions/checkout@v4
- name: install packages
run: sudo apt install build-essential nettle-dev libxxhash-dev
- name: bootstrap
run: ./bootstrap.sh
- name: configure
run: ./configure --with-xxhash --enable-warnings CXXFLAGS=-std=c++17
- name: make
run: make
- name: make check
run: WITH_XXHASH=1 make check
- name: WITH_XXHASH=1 make distcheck
run: make distcheck CXXFLAGS=-std=c++17
- name: store the logs as an artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: log-artifacts-${{ matrix.os }}
path: '**/*.log'
2 changes: 1 addition & 1 deletion testcases/checksum_buffersize_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ make_test_files

cat /dev/null >"$TEST_DIR/results.tsv"
for filesize in big small; do
for checksumtype in md5 sha1; do
for checksumtype in sha1 xxh128; do
i=1
while :; do
if [ $i -gt 4096 ]; then
Expand Down
6 changes: 0 additions & 6 deletions testcases/checksum_options.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/sh
# Test that selection of checksum works as expected.


set -e
. "$(dirname "$0")/common_funcs.sh"



allchecksumtypes="md5 sha1 sha256 sha512"


for checksumtype in $allchecksumtypes; do
reset_teststate
dbgecho "trying checksum $checksumtype with small files"
Expand Down
5 changes: 2 additions & 3 deletions testcases/checksum_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set -e

reset_teststate


if [ ! -d speedtest ] ; then
mkdir -p speedtest
fi
Expand All @@ -21,9 +20,9 @@ if [ ! -e speedtest/largefile1 ] ; then
fi


for checksumtype in md5 sha1 sha256; do
for checksumtype in $allchecksumtypes; do
dbgecho "trying checksum $checksumtype"
time $rdfind -removeidentinode false -checksum $checksumtype speedtest/largefile1 speedtest/largefile2 > rdfind.out
time $rdfind -removeidentinode false -checksum "$checksumtype" speedtest/largefile1 speedtest/largefile2 > rdfind.out
done

dbgecho "all is good in this test!"
5 changes: 5 additions & 0 deletions testcases/common_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ set -e

me="$(basename "$0")"

if [ "$WITH_XXHASH" = "1" ]; then
export allchecksumtypes="md5 sha1 sha256 sha512 xxh128"
else
export allchecksumtypes="md5 sha1 sha256 sha512"
fi

# shellcheck disable=SC3037
/bin/echo -n "$me: checking for rdfind ..."
Expand Down

0 comments on commit c3915fe

Please sign in to comment.