diff options
| author | enricotenuti <tenutz_27@outlook.it> | 2024-08-07 20:09:12 +0200 |
|---|---|---|
| committer | enricotenuti <tenutz_27@outlook.it> | 2024-08-07 20:09:12 +0200 |
| commit | d613e7258bca459a59cdb7b4fb8a7cb041137377 (patch) | |
| tree | 28b3341cf75e2348a26ab9ee44f386c9cda22cfd /test | |
| parent | f148aa65dfe587e7b5d2f48b5005be670788dbe6 (diff) | |
| download | nissy-core-d613e7258bca459a59cdb7b4fb8a7cb041137377.tar.gz nissy-core-d613e7258bca459a59cdb7b4fb8a7cb041137377.zip | |
cube_neon ver1
Diffstat (limited to 'test')
| -rw-r--r-- | test/104_cocsep_ttrep/cocsep_ttrep_tests.c | 2 | ||||
| -rw-r--r-- | test/test.h | 9 | ||||
| -rwxr-xr-x | test/test.sh | 33 |
3 files changed, 27 insertions, 17 deletions
diff --git a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c index f0da151..f692ca8 100644 --- a/test/104_cocsep_ttrep/cocsep_ttrep_tests.c +++ b/test/104_cocsep_ttrep/cocsep_ttrep_tests.c | |||
| @@ -29,7 +29,7 @@ void run(void) { | |||
| 29 | l = coord_cocsep(c); | 29 | l = coord_cocsep(c); |
| 30 | if (k != l) | 30 | if (k != l) |
| 31 | printf("cocsep %" PRId64 " (%" PRId64 "): " | 31 | printf("cocsep %" PRId64 " (%" PRId64 "): " |
| 32 | "%" PRId64 " ttrep %" PRIu8 | 32 | "%" PRId64 " ttrep %" PRIu32 |
| 33 | " -> %" PRId64 "\n", i, l, j, tt, k); | 33 | " -> %" PRId64 "\n", i, l, j, tt, k); |
| 34 | } | 34 | } |
| 35 | } | 35 | } |
diff --git a/test/test.h b/test/test.h index d092244..1f4b2c3 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -7,9 +7,16 @@ | |||
| 7 | 7 | ||
| 8 | #define STRLENMAX 10000 | 8 | #define STRLENMAX 10000 |
| 9 | 9 | ||
| 10 | #ifdef CUBE_AVX2 | 10 | #if defined(CUBE_AVX2) |
| 11 | #include <immintrin.h> | 11 | #include <immintrin.h> |
| 12 | typedef __m256i cube_t; | 12 | typedef __m256i cube_t; |
| 13 | #elif defined(CUBE_NEON) | ||
| 14 | #include <stdlib.h> | ||
| 15 | #include <arm_neon.h> | ||
| 16 | typedef struct { | ||
| 17 | uint8x16_t corner; | ||
| 18 | uint8x16_t edge; | ||
| 19 | } cube_t; | ||
| 13 | #else | 20 | #else |
| 14 | typedef struct { | 21 | typedef struct { |
| 15 | uint8_t corner[8]; | 22 | uint8_t corner[8]; |
diff --git a/test/test.sh b/test/test.sh index 33613b1..4325c91 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -11,21 +11,24 @@ for t in test/*; do | |||
| 11 | if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then | 11 | if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then |
| 12 | continue | 12 | continue |
| 13 | fi | 13 | fi |
| 14 | if [ ! -d $t ]; then continue; fi | 14 | |
| 15 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1; | 15 | # Verifica se $t รจ una directory e se il suo nome inizia con tre cifre |
| 16 | for cin in $t/*.in; do | 16 | if [ -d "$t" ] && echo "$(basename "$t")" | grep -Eq '^[0-9]{3}'; then |
| 17 | c=$(echo "$cin" | sed 's/\.in//') | 17 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1 |
| 18 | cout=$c.out | 18 | for cin in $t/*.in; do |
| 19 | printf "$c: " | 19 | c=$(echo "$cin" | sed 's/\.in//') |
| 20 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR | 20 | cout=$c.out |
| 21 | if diff $cout $TESTOUT; then | 21 | printf "$c: " |
| 22 | printf "OK\n" | 22 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR |
| 23 | else | 23 | if diff $cout $TESTOUT; then |
| 24 | printf "Test failed! stderr:\n" | 24 | printf "OK\n" |
| 25 | cat $TESTERR | 25 | else |
| 26 | exit 1 | 26 | printf "Test failed! stderr:\n" |
| 27 | fi | 27 | cat $TESTERR |
| 28 | done | 28 | exit 1 |
| 29 | fi | ||
| 30 | done | ||
| 31 | fi | ||
| 29 | done | 32 | done |
| 30 | 33 | ||
| 31 | echo "All tests passed!" | 34 | echo "All tests passed!" |
