| 1 | #!/usr/bin/env python3 |
| 2 | # Python rewrite of testsuite/simd-checksum.test. |
| 3 | # |
| 4 | # Run the simdtest helper, which compares the SIMD checksum |
| 5 | # implementations against the C reference. Skip if the helper wasn't |
| 6 | # built (i.e. SIMD acceleration is unavailable on this host). |
| 7 | |
| 8 | import os |
| 9 | import subprocess |
| 10 | |
| 11 | from rsyncfns import TOOLDIR, test_fail, test_skipped |
| 12 | |
| 13 | |
| 14 | simdtest = TOOLDIR / 'simdtest' |
| 15 | if not (simdtest.is_file() and os.access(simdtest, os.X_OK)): |
| 16 | test_skipped("simdtest not built (SIMD not available)") |
| 17 | |
| 18 | proc = subprocess.run([str(simdtest)]) |
| 19 | if proc.returncode != 0: |
| 20 | test_fail(f"simdtest exited {proc.returncode}") |