Skip to content

Commit d835bc0

Browse files
committed
Skip certain test cases if using dynamic linking
1 parent b929772 commit d835bc0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/driver.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ esac
5757

5858
if [ $# -ge 2 ] && [ "$2" = "1" ]; then
5959
readonly SHECC_CFLAGS="--dynlink"
60+
readonly IS_DYNLINK="1"
6061
else
6162
readonly SHECC_CFLAGS=""
63+
readonly IS_DYNLINK="0"
6264
fi
6365

6466
# Utility Functions
@@ -2098,6 +2100,7 @@ EOF
20982100
# Category: Memory Management
20992101
begin_category "Memory Management" "Testing malloc, free, and dynamic memory allocation"
21002102

2103+
if [ "$IS_DYNLINK" = "0" ]; then
21012104
# malloc and free
21022105
try_ 1 << EOF
21032106
int main()
@@ -2113,6 +2116,9 @@ int main()
21132116
return a == b;
21142117
}
21152118
EOF
2119+
else
2120+
echo "Skip test cases in dynamic linking mode"
2121+
fi # "IS_DYNLINK" = "0"
21162122

21172123
try_ 1 << EOF
21182124
int main()
@@ -3228,6 +3234,8 @@ int main()
32283234
}
32293235
EOF
32303236

3237+
if [ "$IS_DYNLINK" = "0" ]; then
3238+
32313239
# printf family, including truncation and zero size input
32323240
try_output 11 "Hello World" << EOF
32333241
int main() {
@@ -3387,6 +3395,9 @@ int main()
33873395
return c == -1;
33883396
}
33893397
EOF
3398+
else
3399+
echo "Skip test cases in dynamic linking mode"
3400+
fi # "IS_DYNLINK" = "0"
33903401

33913402
# tests integer type conversion
33923403
# excerpted and modified from issue #166

0 commit comments

Comments
 (0)