aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorChristopher Li <sparse@chrisli.org>2017-08-11 10:50:53 -0400
committerChristopher Li <sparse@chrisli.org>2017-08-11 10:51:12 -0400
commitbc2e3dd6cd9cd31ab5fd7226c5825b7795915606 (patch)
treefce76b8e9ce0c53cc9fedd1c57dfb235e9aa210d /validation
parent08c90b01cf00e6c18d1e69cd473f7e097a2231a7 (diff)
parent64c9129b5beee61f0a311556259d97d7e56d2879 (diff)
downloadsparse-dev-bc2e3dd6cd9cd31ab5fd7226c5825b7795915606.tar.gz
Merge remote-tracking branch 'luc/remove-singlestore-shortcut'
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'validation')
-rw-r--r--validation/infinite-loop0.c11
-rwxr-xr-xvalidation/test-suite7
2 files changed, 18 insertions, 0 deletions
diff --git a/validation/infinite-loop0.c b/validation/infinite-loop0.c
new file mode 100644
index 00000000..0e3e3805
--- /dev/null
+++ b/validation/infinite-loop0.c
@@ -0,0 +1,11 @@
+void foo(void)
+{
+ int a = a || 0;
+ if (a) ;
+}
+
+/*
+ * check-name: internal infinite loop (0)
+ * check-command: sparse -Wno-decl $file
+ * check-timeout:
+ */
diff --git a/validation/test-suite b/validation/test-suite
index 3056fce9..cf151a36 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -39,6 +39,7 @@ get_tag_value()
check_name=""
check_command="$default_cmd"
check_exit_value=0
+ check_timeout=0
check_known_to_fail=0
check_error_ignore=0
check_output_ignore=0
@@ -56,6 +57,8 @@ get_tag_value()
check-name:) check_name="$val" ;;
check-command:) check_command="$val" ;;
check-exit-value:) check_exit_value="$val" ;;
+ check-timeout:) [ -z "$val" ] && val=1
+ check_timeout="$val" ;;
check-known-to-fail) check_known_to_fail=1 ;;
check-error-ignore) check_error_ignore=1 ;;
check-output-ignore) check_output_ignore=1 ;;
@@ -211,6 +214,10 @@ do_test()
expected_exit_value=$check_exit_value
verbose "Expecting exit value: $expected_exit_value"
+ # do we want a timeout?
+ if [ $check_timeout -ne 0 ]; then
+ cmd="timeout -k 1s $check_timeout $cmd"
+ fi
# grab the actual output & exit value
$cmd 1> $file.output.got 2> $file.error.got