diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:55:23 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 11:55:23 +0100 |
| commit | bb5abea645a31832e9d6a94cea09714a9b1632e3 (patch) | |
| tree | fbad437281bb330287f4f4275a783a81512bac40 | |
| parent | 8059d63339b49d37af894f861956de4b89429bee (diff) | |
| download | nissy-core-bb5abea645a31832e9d6a94cea09714a9b1632e3.tar.gz nissy-core-bb5abea645a31832e9d6a94cea09714a9b1632e3.zip | |
Fixed bug in tests with different architectures
| -rwxr-xr-x | configure.sh | 8 | ||||
| -rw-r--r-- | test/020_io_H48_read_write/io_H48_tests.c | 8 | ||||
| -rw-r--r-- | test/021_io_SRC_write/io_SRC_tests.c | 8 | ||||
| -rw-r--r-- | test/023_io_LST_write/io_LST_tests.c | 8 |
4 files changed, 19 insertions, 13 deletions
diff --git a/configure.sh b/configure.sh index e4a142d..fdebf27 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -7,12 +7,9 @@ detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; } | |||
| 7 | 7 | ||
| 8 | TYPE=${TYPE-"$detected"} | 8 | TYPE=${TYPE-"$detected"} |
| 9 | 9 | ||
| 10 | echo "Using CUBE_$TYPE" | ||
| 11 | |||
| 12 | STD="-std=c99" | 10 | STD="-std=c99" |
| 13 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" | 11 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" |
| 14 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" | 12 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" |
| 15 | |||
| 16 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" | 13 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" |
| 17 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" | 14 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" |
| 18 | SAN="$ADDR $UNDEF" | 15 | SAN="$ADDR $UNDEF" |
| @@ -20,11 +17,14 @@ SAN="$ADDR $UNDEF" | |||
| 20 | CFLAGS="$STD $WFLAGS $AVX -O3" | 17 | CFLAGS="$STD $WFLAGS $AVX -O3" |
| 21 | DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG" | 18 | DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG" |
| 22 | 19 | ||
| 20 | echo "Cube type: CUBE_$TYPE" | ||
| 21 | echo "Compiler: ${CC:-cc}" | ||
| 22 | |||
| 23 | { | 23 | { |
| 24 | echo "CUBETYPE = CUBE_$TYPE"; | 24 | echo "CUBETYPE = CUBE_$TYPE"; |
| 25 | echo ""; | 25 | echo ""; |
| 26 | echo "CFLAGS = $CFLAGS"; | 26 | echo "CFLAGS = $CFLAGS"; |
| 27 | echo "DBGFLAGS = $DBGFLAGS"; | 27 | echo "DBGFLAGS = $DBGFLAGS"; |
| 28 | echo ""; | 28 | echo ""; |
| 29 | echo "CC = cc" | 29 | echo "CC = ${CC:-cc}" |
| 30 | } > config.mk | 30 | } > config.mk |
diff --git a/test/020_io_H48_read_write/io_H48_tests.c b/test/020_io_H48_read_write/io_H48_tests.c index fafd396..705356c 100644 --- a/test/020_io_H48_read_write/io_H48_tests.c +++ b/test/020_io_H48_read_write/io_H48_tests.c | |||
| @@ -1,11 +1,13 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | int main(void) { | 3 | int main(void) { |
| 4 | char *c, str[STRLENMAX]; | 4 | char str[STRLENMAX], *aux; |
| 5 | cube_t cube; | 5 | cube_t cube; |
| 6 | 6 | ||
| 7 | for (c = str; (*c = getchar()) != EOF; c++) ; | 7 | aux = str; |
| 8 | *c = '\0'; | 8 | while (fgets(aux, STRLENMAX, stdin) != NULL) |
| 9 | while (*aux != '\n') | ||
| 10 | aux++; | ||
| 9 | 11 | ||
| 10 | cube = readcube("H48", str); | 12 | cube = readcube("H48", str); |
| 11 | 13 | ||
diff --git a/test/021_io_SRC_write/io_SRC_tests.c b/test/021_io_SRC_write/io_SRC_tests.c index ca33d1e..c427c6c 100644 --- a/test/021_io_SRC_write/io_SRC_tests.c +++ b/test/021_io_SRC_write/io_SRC_tests.c | |||
| @@ -1,11 +1,13 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | int main(void) { | 3 | int main(void) { |
| 4 | char *c, str[STRLENMAX]; | 4 | char str[STRLENMAX], *aux; |
| 5 | cube_t cube; | 5 | cube_t cube; |
| 6 | 6 | ||
| 7 | for (c = str; (*c = getchar()) != EOF; c++) ; | 7 | aux = str; |
| 8 | *c = '\0'; | 8 | while (fgets(aux, STRLENMAX, stdin) != NULL) |
| 9 | while (*aux != '\n') | ||
| 10 | aux++; | ||
| 9 | 11 | ||
| 10 | cube = readcube("H48", str); | 12 | cube = readcube("H48", str); |
| 11 | 13 | ||
diff --git a/test/023_io_LST_write/io_LST_tests.c b/test/023_io_LST_write/io_LST_tests.c index 3f42d7a..45cc203 100644 --- a/test/023_io_LST_write/io_LST_tests.c +++ b/test/023_io_LST_write/io_LST_tests.c | |||
| @@ -8,11 +8,13 @@ cube_t readcube(char *, char *); | |||
| 8 | void writecube(char *, cube_t, char *); | 8 | void writecube(char *, cube_t, char *); |
| 9 | 9 | ||
| 10 | int main(void) { | 10 | int main(void) { |
| 11 | char *c, str[STRLENMAX]; | 11 | char str[STRLENMAX], *aux; |
| 12 | cube_t cube; | 12 | cube_t cube; |
| 13 | 13 | ||
| 14 | for (c = str; (*c = getchar()) != EOF; c++) ; | 14 | aux = str; |
| 15 | *c = '\0'; | 15 | while (fgets(aux, STRLENMAX, stdin) != NULL) |
| 16 | while (*aux != '\n') | ||
| 17 | aux++; | ||
| 16 | 18 | ||
| 17 | cube = readcube("H48", str); | 19 | cube = readcube("H48", str); |
| 18 | 20 | ||
