| 1 |
# Copyright (c) 2015-2026, The matio contributors |
| 2 |
# Copyright (c) 2010-2014, Christopher C. Hulbert |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without |
| 6 |
# modification, are permitted provided that the following conditions are met: |
| 7 |
# |
| 8 |
# 1. Redistributions of source code must retain the above copyright notice, this |
| 9 |
# list of conditions and the following disclaimer. |
| 10 |
# |
| 11 |
# 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 |
# this list of conditions and the following disclaimer in the documentation |
| 13 |
# and/or other materials provided with the distribution. |
| 14 |
# |
| 15 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 |
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 |
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 18 |
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 19 |
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 20 |
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 21 |
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 22 |
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 23 |
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 |
|
| 26 |
AT_INIT([matio testsuite]) |
| 27 |
|
| 28 |
AT_COPYRIGHT(Copyright (C) 2010-2024 Christopher C. Hulbert and the matio contributors) |
| 29 |
|
| 30 |
AT_COLOR_TESTS |
| 31 |
|
| 32 |
m4_divert_push([PREPARE_TESTS]) |
| 33 |
[ |
| 34 |
ovs_wait () { |
| 35 |
# First try a quick sleep, so that the test completes very quickly |
| 36 |
# in the normal case. POSIX doesn't require fractional times to |
| 37 |
# work, so this might not work. |
| 38 |
sleep 0.1 |
| 39 |
ovs_wait_cond && exit 0 |
| 40 |
# Then wait up to 10 seconds. |
| 41 |
for d in 0 1 2 3 4 5 6 7 8 9; do |
| 42 |
sleep 1 |
| 43 |
ovs_wait_cond && exit 0 |
| 44 |
done |
| 45 |
exit 1 |
| 46 |
} |
| 47 |
|
| 48 |
# Prints the integers from $1 to $2, increasing by $3 (default 1) on stdout. |
| 49 |
seq () { |
| 50 |
while test $1 -le $2; do |
| 51 |
echo $1 |
| 52 |
set `expr $1 + ${3-1}` $2 $3 |
| 53 |
done |
| 54 |
} |
| 55 |
|
| 56 |
if test $IS_WIN32 -eq 1; then |
| 57 |
pwd () { |
| 58 |
command pwd -W "$@" |
| 59 |
} |
| 60 |
|
| 61 |
diff () { |
| 62 |
command diff --strip-trailing-cr "$@" |
| 63 |
} |
| 64 |
|
| 65 |
kill () { |
| 66 |
case "$1" in |
| 67 |
-0) |
| 68 |
shift |
| 69 |
for i in $*; do |
| 70 |
# tasklist will always have return code 0. |
| 71 |
# If pid does exist, there will be a line with the pid. |
| 72 |
if tasklist //fi "PID eq $i" | grep $i; then |
| 73 |
: |
| 74 |
else |
| 75 |
return 1 |
| 76 |
fi |
| 77 |
done |
| 78 |
return 0 |
| 79 |
;; |
| 80 |
-[1-9]*) |
| 81 |
shift |
| 82 |
for i in $*; do |
| 83 |
taskkill //F //PID $i |
| 84 |
done |
| 85 |
;; |
| 86 |
[1-9][1-9]*) |
| 87 |
for i in $*; do |
| 88 |
taskkill //F //PID $i |
| 89 |
done |
| 90 |
;; |
| 91 |
esac |
| 92 |
} |
| 93 |
fi |
| 94 |
] |
| 95 |
m4_divert_pop([PREPARE_TESTS]) |
| 96 |
|
| 97 |
AT_BANNER(Read [MAT version 4 (Little Endian)]) |
| 98 |
m4_include([mat4_read_le.at]) |
| 99 |
m4_include([mat4_readslab_le.at]) |
| 100 |
|
| 101 |
AT_BANNER(Read [MAT version 4 (Big Endian)]) |
| 102 |
m4_include([mat4_read_be.at]) |
| 103 |
m4_include([mat4_readslab_be.at]) |
| 104 |
|
| 105 |
AT_BANNER([Read Uncompressed MAT version 5 (Little Endian)]) |
| 106 |
m4_include([mat5_uncompressed_read_le.at]) |
| 107 |
m4_include([mat5_uncompressed_readslab_le.at]) |
| 108 |
|
| 109 |
AT_BANNER([Read Compressed MAT version 5 (Little Endian)]) |
| 110 |
m4_include([mat5_compressed_read_le.at]) |
| 111 |
m4_include([mat5_compressed_readslab_le.at]) |
| 112 |
|
| 113 |
AT_BANNER([Read Uncompressed MAT version 5 (Big Endian)]) |
| 114 |
m4_include([mat5_uncompressed_read_be.at]) |
| 115 |
m4_include([mat5_uncompressed_readslab_be.at]) |
| 116 |
|
| 117 |
AT_BANNER([Read Compressed MAT version 5 (Big Endian)]) |
| 118 |
m4_include([mat5_compressed_read_be.at]) |
| 119 |
m4_include([mat5_compressed_readslab_be.at]) |
| 120 |
|
| 121 |
AT_BANNER([Read Compressed MAT version 7.3 (HDF5 Schema 1) (Little Endian)]) |
| 122 |
m4_include([mat73_compressed_read_le.at]) |
| 123 |
m4_include([mat73_compressed_readslab_le.at]) |
| 124 |
|
| 125 |
AT_BANNER([Read Uncompressed MAT version 7.3 (HDF5 Schema 1) (Little Endian)]) |
| 126 |
m4_include([mat73_uncompressed_read_le.at]) |
| 127 |
m4_include([mat73_uncompressed_readslab_le.at]) |
| 128 |
|
| 129 |
AT_BANNER([Read MAT version 7.3 (HDF5 Schema 1) (Big Endian)]) |
| 130 |
m4_include([mat73_read_be.at]) |
| 131 |
m4_include([mat73_readslab_be.at]) |
| 132 |
|
| 133 |
AT_BANNER([Write MAT version 4]) |
| 134 |
m4_include([mat4_write.at]) |
| 135 |
|
| 136 |
AT_BANNER([Read/Write MAT version 4]) |
| 137 |
m4_include([mat4_readwrite.at]) |
| 138 |
|
| 139 |
AT_BANNER([Write Uncompressed MAT version 5]) |
| 140 |
m4_include([mat5_uncompressed_write.at]) |
| 141 |
|
| 142 |
AT_BANNER([Read/Write Uncompressed MAT version 5]) |
| 143 |
m4_include([mat5_uncompressed_readwrite.at]) |
| 144 |
|
| 145 |
AT_BANNER([Write Compressed MAT version 5]) |
| 146 |
m4_include([mat5_compressed_write.at]) |
| 147 |
|
| 148 |
AT_BANNER([Read/Write Compressed MAT version 5]) |
| 149 |
m4_include([mat5_compressed_readwrite.at]) |
| 150 |
|
| 151 |
AT_BANNER([Write MAT version 7.3]) |
| 152 |
m4_include([mat73_write.at]) |
| 153 |
|
| 154 |
AT_BANNER([Write/Append MAT version 7.3]) |
| 155 |
m4_include([mat73_writeappend.at]) |
| 156 |
|
| 157 |
AT_BANNER([Read/Write Compressed MAT version 7.3]) |
| 158 |
m4_include([mat73_compressed_readwrite.at]) |
| 159 |
|
| 160 |
AT_BANNER([Read/Write Uncompressed MAT version 7.3]) |
| 161 |
m4_include([mat73_uncompressed_readwrite.at]) |
| 162 |
|
| 163 |
AT_BANNER([Write Compressed MAT version 7.3]) |
| 164 |
m4_include([mat73_compressed_write.at]) |
| 165 |
|
| 166 |
AT_BANNER([Write/Append Compressed MAT version 7.3]) |
| 167 |
m4_include([mat73_compressed_writeappend.at]) |
| 168 |
|
| 169 |
AT_BANNER([Extended Sparse MAT version 4]) |
| 170 |
m4_include([mat4_extended_sparse.at]) |
| 171 |
|
| 172 |
AT_BANNER([Extended Sparse Uncompressed MAT version 5]) |
| 173 |
m4_include([mat5_uncompressed_extended_sparse.at]) |
| 174 |
|
| 175 |
AT_BANNER([Extended Sparse Compressed MAT version 5]) |
| 176 |
m4_include([mat5_compressed_extended_sparse.at]) |
| 177 |
|
| 178 |
AT_BANNER([Extended Sparse Uncompressed MAT version 7.3]) |
| 179 |
m4_include([mat73_uncompressed_extended_sparse.at]) |
| 180 |
|
| 181 |
AT_BANNER([Extended Sparse Compressed MAT version 7.3]) |
| 182 |
m4_include([mat73_compressed_extended_sparse.at]) |
| 183 |
|
| 184 |
AT_BANNER([API Tests]) |
| 185 |
m4_include([struct_api.at]) |
| 186 |
m4_include([cell_api.at]) |
| 187 |
m4_include([subscript_api.at]) |