From e1f4d2bd276eb96e3e264e4aaff0eae53b47a74e Mon Sep 17 00:00:00 2001 From: Akuli Date: Mon, 19 Feb 2024 17:14:44 +0200 Subject: [PATCH] Disable core dumps --- compare_compilers.sh | 20 ++------------------ tests/should_succeed/file.jou | 2 +- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/compare_compilers.sh b/compare_compilers.sh index 211a0708..ccdd5675 100755 --- a/compare_compilers.sh +++ b/compare_compilers.sh @@ -5,7 +5,7 @@ # If tokenizing/parsing a Jou file fails, both compilers should fail with the same error message. set -e -ulimit -c unlimited +ulimit -c 0 # disable core dumps files=() actions=() @@ -40,13 +40,6 @@ fi rm -rf tmp/compare_compilers mkdir -p tmp/compare_compilers -# shellcheck disable=SC2010 -if ls | grep -q core$; then - for core in *core; do - mv -v -- "$core" "$core"~ - done -fi - YELLOW="\x1b[33m" GREEN="\x1b[32m" RED="\x1b[31m" @@ -139,19 +132,10 @@ for action in ${actions[@]}; do fi else echo " Compilers behave differently as expected (listed in $error_list_file)" - echo -en ${YELLOW} - rm -vf -- *core | xargs -r echo Core dumped and ignored: - echo -en ${RESET} fi else if $DIFF -u $diff_color tmp/compare_compilers/compiler_written_in_c.txt tmp/compare_compilers/self_hosted.txt; then - # shellcheck disable=SC2010 - if ls | grep -q core$; then - echo -e " ${RED}Error: Core dumped.${RESET}" - exit 1 - else - echo " Compilers behave the same as expected" - fi + echo " Compilers behave the same as expected" else if [ $fix = yes ]; then append_line $error_list_file $file diff --git a/tests/should_succeed/file.jou b/tests/should_succeed/file.jou index 67267e38..99925608 100644 --- a/tests/should_succeed/file.jou +++ b/tests/should_succeed/file.jou @@ -5,7 +5,7 @@ def write_hello_123() -> None: f = fopen("tmp/tests/hello.txt", "w") if f == NULL: printf("can't write tmp/tests/hello.txt\n") - exit(1) # abort() would make a core dump when comparing compilers + abort() fputc('h', f) fputs("ell", f)