2018-04-29 16:38:57 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
2019-06-08 13:36:22 +00:00
|
|
|
# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-04-29 16:38:57 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# This file is part of GNU Mes.
|
2018-04-29 16:38:57 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is free software; you can redistribute it and/or modify it
|
2018-04-29 16:38:57 +00:00
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
# your option) any later version.
|
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is distributed in the hope that it will be useful, but
|
2018-04-29 16:38:57 +00:00
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-07-22 12:24:36 +00:00
|
|
|
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-07-21 22:43:39 +00:00
|
|
|
set -e
|
2019-06-08 13:36:22 +00:00
|
|
|
. ./config.sh
|
|
|
|
set -u
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2020-10-06 11:11:20 +00:00
|
|
|
mes_tests="
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/t.c
|
|
|
|
lib/tests/scaffold/01-return-0.c
|
|
|
|
lib/tests/scaffold/02-return-1.c
|
|
|
|
lib/tests/scaffold/03-call.c
|
|
|
|
lib/tests/scaffold/04-call-0.c
|
|
|
|
lib/tests/scaffold/05-call-1.c
|
|
|
|
lib/tests/scaffold/06-call-not-1.c
|
|
|
|
lib/tests/scaffold/06-not-call-1.c
|
|
|
|
lib/tests/scaffold/06-call-2.c
|
|
|
|
lib/tests/scaffold/06-call-string.c
|
|
|
|
lib/tests/scaffold/06-call-variable.c
|
|
|
|
lib/tests/scaffold/06-return-void.c
|
|
|
|
lib/tests/scaffold/07-include.c
|
|
|
|
lib/tests/scaffold/08-assign.c
|
|
|
|
lib/tests/scaffold/08-assign-negative.c
|
|
|
|
lib/tests/scaffold/08-assign-global.c
|
|
|
|
lib/tests/scaffold/10-if-0.c
|
|
|
|
lib/tests/scaffold/11-if-1.c
|
|
|
|
lib/tests/scaffold/12-if-eq.c
|
|
|
|
lib/tests/scaffold/13-if-neq.c
|
|
|
|
lib/tests/scaffold/14-if-goto.c
|
|
|
|
lib/tests/scaffold/15-if-not-f.c
|
|
|
|
lib/tests/scaffold/16-if-t.c
|
|
|
|
lib/tests/scaffold/17-compare-char.c
|
|
|
|
lib/tests/scaffold/17-compare-ge.c
|
|
|
|
lib/tests/scaffold/17-compare-gt.c
|
|
|
|
lib/tests/scaffold/17-compare-le.c
|
|
|
|
lib/tests/scaffold/17-compare-lt.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-ge.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-gt.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-le.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-lt.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-char-le.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-short-le.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-long-le.c
|
|
|
|
lib/tests/scaffold/17-compare-and.c
|
|
|
|
lib/tests/scaffold/17-compare-or.c
|
|
|
|
lib/tests/scaffold/17-compare-and-or.c
|
|
|
|
lib/tests/scaffold/17-compare-assign.c
|
|
|
|
lib/tests/scaffold/17-compare-call.c
|
|
|
|
lib/tests/scaffold/18-assign-shadow.c
|
|
|
|
lib/tests/scaffold/20-while.c
|
|
|
|
lib/tests/scaffold/21-char-array-simple.c
|
|
|
|
lib/tests/scaffold/21-char-array.c
|
|
|
|
lib/tests/scaffold/22-while-char-array.c
|
|
|
|
lib/tests/scaffold/23-global-pointer-init-null.c
|
|
|
|
lib/tests/scaffold/23-global-pointer-init.c
|
|
|
|
lib/tests/scaffold/23-global-pointer-ref.c
|
|
|
|
lib/tests/scaffold/23-global-pointer-pointer-ref.c
|
|
|
|
lib/tests/scaffold/23-pointer-sub.c
|
|
|
|
lib/tests/scaffold/23-pointer.c
|
|
|
|
lib/tests/mes/30-oputs.c
|
2019-03-11 21:45:56 +00:00
|
|
|
lib/tests/mes/30-eputs.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/string/30-strlen.c
|
2019-03-10 20:52:05 +00:00
|
|
|
lib/tests/scaffold/30-exit-0.c
|
|
|
|
lib/tests/scaffold/30-exit-42.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/32-call-wrap.c
|
|
|
|
lib/tests/scaffold/32-compare.c
|
|
|
|
lib/tests/scaffold/33-and-or.c
|
|
|
|
lib/tests/scaffold/34-pre-post.c
|
|
|
|
lib/tests/scaffold/35-compare-char.c
|
|
|
|
lib/tests/scaffold/36-compare-arithmetic.c
|
|
|
|
lib/tests/scaffold/37-compare-assign.c
|
|
|
|
lib/tests/scaffold/38-compare-call-2.c
|
|
|
|
lib/tests/scaffold/38-compare-call-3.c
|
|
|
|
lib/tests/scaffold/38-compare-call.c
|
|
|
|
lib/tests/scaffold/40-if-else.c
|
|
|
|
lib/tests/scaffold/41-ternary.c
|
|
|
|
lib/tests/scaffold/42-goto-label.c
|
|
|
|
lib/tests/scaffold/43-for-do-while.c
|
|
|
|
lib/tests/scaffold/44-switch.c
|
|
|
|
lib/tests/scaffold/44-switch-fallthrough.c
|
|
|
|
lib/tests/scaffold/44-switch-body-fallthrough.c
|
|
|
|
lib/tests/scaffold/45-void-call.c
|
|
|
|
lib/tests/scaffold/46-function-static.c
|
|
|
|
lib/tests/scaffold/47-function-expression.c
|
|
|
|
lib/tests/scaffold/48-global-static.c
|
|
|
|
lib/tests/assert/50-assert.c
|
|
|
|
lib/tests/mes/50-itoa.c
|
|
|
|
lib/tests/posix/50-getenv.c
|
2019-06-25 17:05:58 +00:00
|
|
|
lib/tests/stdlib/50-malloc.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/string/50-strcmp.c
|
|
|
|
lib/tests/string/50-strcpy.c
|
|
|
|
lib/tests/string/50-strncmp.c
|
2019-06-26 19:55:44 +00:00
|
|
|
lib/tests/posix/50-open-read.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/51-pointer-sub.c
|
|
|
|
lib/tests/scaffold/54-argc.c
|
2019-06-26 17:49:36 +00:00
|
|
|
lib/tests/scaffold/54-argv.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/55-char-array.c
|
2019-07-09 20:01:24 +00:00
|
|
|
lib/tests/scaffold/60-math.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/61-array.c
|
|
|
|
lib/tests/scaffold/62-array.c
|
|
|
|
lib/tests/scaffold/63-struct.c
|
|
|
|
lib/tests/scaffold/63-struct-pointer.c
|
|
|
|
lib/tests/scaffold/63-struct-local.c
|
|
|
|
lib/tests/scaffold/63-struct-function.c
|
|
|
|
lib/tests/scaffold/63-struct-assign.c
|
|
|
|
lib/tests/scaffold/63-struct-array.c
|
|
|
|
lib/tests/scaffold/63-struct-array-assign.c
|
|
|
|
lib/tests/scaffold/63-struct-array-compare.c
|
|
|
|
lib/tests/scaffold/63-struct-cell.c
|
|
|
|
lib/tests/scaffold/64-make-cell.c
|
|
|
|
lib/tests/scaffold/65-read.c
|
|
|
|
lib/tests/scaffold/66-local-char-array.c
|
2020-10-06 11:11:20 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
tcc_tests="
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/70-stdarg.c
|
|
|
|
lib/tests/stdio/70-printf-hello.c
|
|
|
|
lib/tests/stdio/70-printf-simple.c
|
|
|
|
lib/tests/stdio/70-printf.c
|
|
|
|
lib/tests/stdlib/70-strtoull.c
|
|
|
|
lib/tests/string/70-strchr.c
|
|
|
|
lib/tests/scaffold/71-struct-array.c
|
|
|
|
lib/tests/scaffold/72-typedef-struct-def.c
|
2019-07-08 07:04:01 +00:00
|
|
|
lib/tests/scaffold/72-typedef-struct-def-local.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/73-union-hello.c
|
|
|
|
lib/tests/scaffold/73-union.c
|
|
|
|
lib/tests/scaffold/74-multi-line-string.c
|
|
|
|
lib/tests/scaffold/75-struct-union.c
|
|
|
|
lib/tests/scaffold/76-pointer-arithmetic-pp.c
|
|
|
|
lib/tests/scaffold/76-pointer-arithmetic.c
|
|
|
|
lib/tests/scaffold/77-pointer-assign.c
|
|
|
|
lib/tests/scaffold/78-union-struct.c
|
|
|
|
lib/tests/scaffold/79-int-array-simple.c
|
|
|
|
lib/tests/scaffold/79-int-array.c
|
|
|
|
lib/tests/scaffold/7a-struct-char-array.c
|
|
|
|
lib/tests/scaffold/7b-struct-int-array-hello.c
|
|
|
|
lib/tests/scaffold/7b-struct-int-array-pointer.c
|
|
|
|
lib/tests/scaffold/7b-struct-int-array.c
|
|
|
|
lib/tests/scaffold/7c-dynarray.c
|
|
|
|
lib/tests/scaffold/7d-cast-char.c
|
|
|
|
lib/tests/scaffold/7e-struct-array-access.c
|
|
|
|
lib/tests/scaffold/7f-struct-pointer-arithmetic.c
|
|
|
|
lib/tests/scaffold/7g-struct-byte-word-field.c
|
|
|
|
lib/tests/scaffold/7h-struct-assign.c
|
|
|
|
lib/tests/scaffold/7i-struct-struct-simple.c
|
|
|
|
lib/tests/scaffold/7i-struct-struct.c
|
|
|
|
lib/tests/scaffold/7k-empty-for.c
|
|
|
|
lib/tests/scaffold/7k-for-each-elem-simple.c
|
|
|
|
lib/tests/scaffold/7k-for-each-elem.c
|
|
|
|
lib/tests/scaffold/7l-struct-any-size-array-simple.c
|
|
|
|
lib/tests/scaffold/7l-struct-any-size-array.c
|
|
|
|
lib/tests/scaffold/7m-struct-char-array-assign.c
|
|
|
|
lib/tests/scaffold/7n-struct-struct-array.c
|
|
|
|
lib/tests/scaffold/7o-struct-pre-post-simple.c
|
|
|
|
lib/tests/scaffold/7o-struct-pre-post.c
|
|
|
|
lib/tests/scaffold/7p-struct-cast.c
|
|
|
|
lib/tests/scaffold/7q-bit-field-simple.c
|
|
|
|
lib/tests/scaffold/7q-bit-field.c
|
|
|
|
lib/tests/scaffold/7r-sign-extend.c
|
|
|
|
lib/tests/scaffold/7s-struct-short.c
|
|
|
|
lib/tests/scaffold/7s-unsigned-compare.c
|
|
|
|
lib/tests/scaffold/7t-function-destruct.c
|
|
|
|
lib/tests/scaffold/7u-double.c
|
|
|
|
lib/tests/scaffold/7u-long-long.c
|
|
|
|
lib/tests/scaffold/7u-ternary-expression.c
|
|
|
|
lib/tests/scaffold/7u-call-ternary.c
|
|
|
|
lib/tests/scaffold/7u-inc-byte-word.c
|
|
|
|
lib/tests/scaffold/7u-struct-func.c
|
|
|
|
lib/tests/scaffold/7u-struct-size10.c
|
|
|
|
lib/tests/scaffold/7u-vstack.c
|
2019-07-20 15:14:55 +00:00
|
|
|
lib/tests/scaffold/70-array-in-struct-init.c
|
2019-07-21 14:48:26 +00:00
|
|
|
lib/tests/scaffold/70-struct-short-enum-init.c
|
2019-07-21 20:40:42 +00:00
|
|
|
lib/tests/scaffold/70-struct-post.c
|
2019-07-27 15:22:00 +00:00
|
|
|
lib/tests/scaffold/70-extern.c
|
2020-11-15 20:40:53 +00:00
|
|
|
lib/tests/scaffold/70-ternary-arithmetic-argument.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/setjmp/80-setjmp.c
|
|
|
|
lib/tests/stdio/80-sscanf.c
|
|
|
|
lib/tests/stdlib/80-qsort.c
|
|
|
|
lib/tests/stdlib/80-qsort-dupes.c
|
|
|
|
lib/tests/string/80-strncpy.c
|
|
|
|
lib/tests/string/80-strrchr.c
|
|
|
|
lib/tests/scaffold/82-define.c
|
|
|
|
lib/tests/scaffold/83-heterogenoous-init.c
|
|
|
|
lib/tests/scaffold/84-struct-field-list.c
|
|
|
|
lib/tests/scaffold/85-sizeof.c
|
2019-07-07 10:17:03 +00:00
|
|
|
"
|
|
|
|
|
2020-10-06 11:11:20 +00:00
|
|
|
gnu_tests="
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/dirent/90-readdir.c
|
|
|
|
lib/tests/io/90-stat.c
|
2019-06-25 10:51:44 +00:00
|
|
|
lib/tests/mes/90-abtod.c
|
2020-01-12 17:42:25 +00:00
|
|
|
lib/tests/mes/90-dtoab.c
|
2019-06-09 22:56:42 +00:00
|
|
|
lib/tests/posix/90-execlp.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/posix/90-unsetenv.c
|
|
|
|
lib/tests/signal/90-signal.c
|
|
|
|
lib/tests/stdio/90-fopen.c
|
|
|
|
lib/tests/stdio/90-fopen-append.c
|
|
|
|
lib/tests/stdio/90-fread-fwrite.c
|
|
|
|
lib/tests/stdio/90-fseek.c
|
2020-01-12 17:42:25 +00:00
|
|
|
lib/tests/stdio/90-sprintf.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/stdlib/90-strtol.c
|
|
|
|
lib/tests/string/90-snprintf.c
|
|
|
|
lib/tests/string/90-strpbrk.c
|
|
|
|
lib/tests/string/90-strspn.c
|
|
|
|
lib/tests/scaffold/90-goto-var.c
|
|
|
|
lib/tests/scaffold/91-goto-array.c
|
|
|
|
lib/tests/scaffold/a0-call-trunc-char.c
|
|
|
|
lib/tests/scaffold/a0-call-trunc-short.c
|
|
|
|
lib/tests/scaffold/a0-call-trunc-int.c
|
|
|
|
lib/tests/scaffold/a0-math-divide-signed-negative.c
|
|
|
|
lib/tests/scaffold/a1-global-no-align.c
|
|
|
|
lib/tests/scaffold/a1-global-no-clobber.c
|
|
|
|
"
|
2018-08-15 16:26:55 +00:00
|
|
|
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/stdio/90-sprintf.c
|
2018-04-29 16:38:57 +00:00
|
|
|
"
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test $compiler = mescc; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/17-compare-unsigned-char-le.c
|
|
|
|
lib/tests/scaffold/17-compare-unsigned-short-le.c
|
|
|
|
lib/tests/scaffold/66-local-char-array.c
|
2019-07-08 07:04:01 +00:00
|
|
|
lib/tests/scaffold/72-typedef-struct-def-local.c
|
2020-11-15 20:40:53 +00:00
|
|
|
lib/tests/scaffold/70-ternary-arithmetic-argument.c
|
2019-12-02 09:00:03 +00:00
|
|
|
lib/tests/mes/90-abtod.c
|
2020-01-12 17:42:25 +00:00
|
|
|
lib/tests/mes/90-dtoab.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/90-goto-var.c
|
|
|
|
lib/tests/scaffold/91-goto-array.c
|
2018-05-01 14:50:29 +00:00
|
|
|
"
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test $mes_cpu = x86; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-05-15 13:18:38 +00:00
|
|
|
"
|
2019-06-08 13:36:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test $mes_cpu = x86_64; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/scaffold/a0-call-trunc-int.c
|
2018-11-06 19:29:35 +00:00
|
|
|
"
|
2019-06-08 13:36:22 +00:00
|
|
|
fi
|
2018-11-06 19:29:35 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test $mes_cpu = x86_64; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/stdio/70-printf-stdarg.c
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $compiler = gcc; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-06-08 13:36:22 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
if test $mes_cpu = x86; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-08-26 22:43:37 +00:00
|
|
|
lib/tests/mes/90-dtoab.c
|
2019-06-08 13:36:22 +00:00
|
|
|
"
|
2018-04-29 16:38:57 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
if test $mes_cpu = x86_64; then
|
2020-10-06 11:11:20 +00:00
|
|
|
xfail_tests="$xfail_tests
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/stdio/70-printf-hello.c
|
2019-09-09 14:01:40 +00:00
|
|
|
lib/tests/stdio/70-printf-simple.c
|
|
|
|
lib/tests/stdio/70-printf.c
|
2019-06-10 21:13:50 +00:00
|
|
|
lib/tests/scaffold/70-extern.c
|
|
|
|
lib/tests/stdio/80-sscanf.c
|
|
|
|
lib/tests/posix/90-execlp.c
|
2019-06-08 13:36:22 +00:00
|
|
|
lib/tests/string/90-snprintf.c
|
|
|
|
"
|
|
|
|
fi
|
2018-04-29 16:38:57 +00:00
|
|
|
fi
|
2019-06-08 13:36:22 +00:00
|
|
|
|
2020-10-06 11:11:20 +00:00
|
|
|
# Allow for make check TESTS=lib/tests/setjmp/80-setjmp.c
|
|
|
|
if test -n "$bootstrap"; then
|
|
|
|
TESTS="${TESTS-$mes_tests$tcc_tests}"
|
|
|
|
else
|
|
|
|
TESTS="${TESTS-$mes_tests$tcc_test$gnu_tests}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Allow for make check xfail_tests=lib/tests/setjmp/80-setjmp.c
|
|
|
|
XFAIL_TESTS="${XFAIL_TESTS-$xfail_tests}"
|
|
|
|
|
2019-06-10 09:39:31 +00:00
|
|
|
recheck=${recheck-false}
|
2019-06-08 13:36:22 +00:00
|
|
|
test_ext=.c
|
2019-06-25 19:40:43 +00:00
|
|
|
log_compiler="${SHELL} ${srcdest}build-aux/test-c.sh"
|
2019-06-08 13:36:22 +00:00
|
|
|
. ${srcdest}build-aux/test-suite.sh
|