diff --git a/build_windows/ChangeLog.txt b/build_windows/ChangeLog.txt index a4b7b78dc..9eba7e07d 100644 --- a/build_windows/ChangeLog.txt +++ b/build_windows/ChangeLog.txt @@ -1,4 +1,8 @@ +2024-10-07 Simon Sobisch + + * set_env_vs_dist: supporting space-included paths (not recommended) + 2024-05-15 Simon Sobisch * makedist.cmd: cater for new different library names @@ -315,7 +319,7 @@ * update for subfolder vc10 -2014-07-07 Philipp Böhme +2014-07-07 Philipp B�hme * minor bugfix (tpyos) for subfolder vc12 @@ -326,7 +330,7 @@ * updated all project files * added subfolder vc11 -2014-06-20 Philipp Böhme +2014-06-20 Philipp B�hme * added project files - subfolders: vc7, vc8, vc9, vc10, vc12 (original project files and resource files version_cobc.rc, diff --git a/build_windows/set_env_vs_x64.cmd b/build_windows/set_env_vs_x64.cmd index 4fde7ca57..4c905c9f3 100644 --- a/build_windows/set_env_vs_x64.cmd +++ b/build_windows/set_env_vs_x64.cmd @@ -1,4 +1,4 @@ -:: Copyright (C) 2014-2020 Free Software Foundation, Inc. +:: Copyright (C) 2014-2020,2024 Free Software Foundation, Inc. :: Written by Simon Sobisch, Edward Hart :: :: This file is part of GnuCOBOL. @@ -36,4 +36,4 @@ if %errorlevel% equ 0 ( set "stay_open=x" ) -call %~dp0gcvsvars.cmd %* +call "%~dp0gcvsvars.cmd" %* diff --git a/build_windows/set_env_vs_x64.dist.tmpl.cmd b/build_windows/set_env_vs_x64.dist.tmpl.cmd index 6c5dd8e68..31afef62b 100644 --- a/build_windows/set_env_vs_x64.dist.tmpl.cmd +++ b/build_windows/set_env_vs_x64.dist.tmpl.cmd @@ -1,4 +1,4 @@ -:: Copyright (C) 2014-2020 Free Software Foundation, Inc. +:: Copyright (C) 2014-2020,2024 Free Software Foundation, Inc. :: Written by Simon Sobisch, Edward Hart :: :: This file is part of GnuCOBOL. @@ -36,4 +36,4 @@ if %errorlevel% equ 0 ( set "stay_open=x" ) -call %~dp0gcvsvars.cmd %* +call "%~dp0gcvsvars.cmd" %* diff --git a/build_windows/set_env_vs_x86.cmd b/build_windows/set_env_vs_x86.cmd index c80706ba6..8fc7e2007 100644 --- a/build_windows/set_env_vs_x86.cmd +++ b/build_windows/set_env_vs_x86.cmd @@ -1,4 +1,4 @@ -:: Copyright (C) 2014-2020 Free Software Foundation, Inc. +:: Copyright (C) 2014-2020,2024 Free Software Foundation, Inc. :: Written by Simon Sobisch, Edward Hart :: :: This file is part of GnuCOBOL. @@ -39,4 +39,4 @@ if %errorlevel% equ 0 ( set "stay_open=x" ) -call %~dp0gcvsvars.cmd %* +call "%~dp0gcvsvars.cmd" %* diff --git a/build_windows/set_env_vs_x86.dist.tmpl.cmd b/build_windows/set_env_vs_x86.dist.tmpl.cmd index e8e01d7f6..4a160b87d 100644 --- a/build_windows/set_env_vs_x86.dist.tmpl.cmd +++ b/build_windows/set_env_vs_x86.dist.tmpl.cmd @@ -36,4 +36,4 @@ if %errorlevel% equ 0 ( set "stay_open=x" ) -call %~dp0gcvsvars.cmd %* +call "%~dp0gcvsvars.cmd" %* diff --git a/configure.ac b/configure.ac index 126e2a363..703d359b2 100644 --- a/configure.ac +++ b/configure.ac @@ -1222,7 +1222,7 @@ AS_IF([test "$USE_JSON" = "json-c" -o "$USE_JSON" = check], [ JSON_C_LIBS="-ljson-c" fi LIBS="$LIBS $LIBCOB_LIBS_extern $JSON_C_LIBS" - AC_CHECK_HEADERS([json.h json-c/json.h], [break], + AC_CHECK_HEADERS([json-c/json.h json.h], [break], [if test "$with_json" = "json-c"; then AC_MSG_ERROR([header for libjson-c is required for --with-json=json-c, you may adjust JSON_C_CFLAGS]) else diff --git a/tests/ChangeLog b/tests/ChangeLog index b99d0ba74..29e095b7f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,4 +1,11 @@ +2024-10-05 Simon Sobisch + + * atlocal.in, atlocal_win: export new definition COB_ON_WINDOWS + to allow the testsuite skipping/failing tests + * run_prog_manual.sh.in: fix extranous $COBCRUN for all test runners + * run_prog_manual.sh.in (xterm): use all parameters, not only the first + 2024-10-02 Simon Sobisch * atlocal.in, atlocal_win: allow overriding COB_CC during tests diff --git a/tests/atlocal.in b/tests/atlocal.in index d2f0a4429..254e08e59 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -225,11 +225,19 @@ set_utf8_locale () { } # ensure we don't execute windows paths within programs generated by cygwin -# by passing a hint -if test "$OSTYPE" = "cygwin"; then - COB_ON_CYGWIN=1 - export COB_ON_CYGWIN -fi +# by passing a hint and to (not) skip some tests that are portable in all +# environments but Windows +case "$OSTYPE" in + msys*|win* ) + # Windows but not Cygwin + COB_ON_WINDOWS=yes + export COB_ON_WINDOWS + ;; + cygwin* ) + COB_ON_CYGWIN=yes + export COB_ON_CYGWIN + ;; +esac # Fix for testcases where cobc translates path to win32 equivalents if test "x$MSYSTEM" != "x"; then diff --git a/tests/atlocal_win b/tests/atlocal_win index 8cf1e85cf..3cdb892d4 100644 --- a/tests/atlocal_win +++ b/tests/atlocal_win @@ -125,6 +125,9 @@ set_utf8_locale () { # Note: we explicit do not set COB_ON_CYGWIN here, # as this is file is about running non-cygwin binaries + # Windows but not Cygwin + COB_ON_WINDOWS=1 + export COB_ON_WINDOWS # Fix for testcases where cobc uses win32 paths internally PATHSEP=";" diff --git a/tests/run_prog_manual.sh.in b/tests/run_prog_manual.sh.in index aad4f79f2..dd063596e 100755 --- a/tests/run_prog_manual.sh.in +++ b/tests/run_prog_manual.sh.in @@ -69,7 +69,7 @@ TITLE="GnuCOBOL Manual Test Run - $DESC" _test_with_xterm () { xterm -T "$TITLE" \ -fa 'Liberation Mono' -fs 14 \ - -e "sh -c \"(\$COBCRUN_DIRECT $1 2>./syserr.log && echo \$? > ./result) || echo 1 > ./result\"" + -e "sh -c \"(\$* 2>./syserr.log && echo \$? > ./result) || echo 1 > ./result\"" } @@ -92,7 +92,7 @@ _test_with_screen () { fi # run actual test in screen session screen -S "GCTESTS" -X title "$TITLE" - screen -S "GCTESTS" -X exec ... sh -c "cd \"$PWD\" && ($COBCRUN_DIRECT $* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result" + screen -S "GCTESTS" -X exec ... sh -c "cd \"$PWD\" && ($* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result" } _attach_to_screen () { test -d "$SCREENDIR" && (screen -r "GCTESTS" ; true) && exit @@ -119,7 +119,7 @@ _test_with_tmux () { fi # run actual test in screen session tmux rename-window -t "=GCTESTS:0" "$TITLE" - tmux send-keys -t "=GCTESTS:0" "sh -c \"cd \\\"$PWD\\\" && ($COBCRUN_DIRECT $* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result; echo\"" C-m + tmux send-keys -t "=GCTESTS:0" "sh -c \"cd \\\"$PWD\\\" && ($* 2>./syserr.log && echo $? > ./result) || echo 1 > ./result; echo\"" C-m } _attach_to_tmux () { tmux attach -t "=GCTESTS:0" @@ -133,7 +133,7 @@ _kill_tmux () { _test_with_cmd () { # run cmd to start a detached cmd (via cmd's start), and execute the tests there, # to work around quoting issues we create a sub-cmd - echo "$COBCRUN_DIRECT $(echo $* | tr '/' '\\') 2>syserr.log & echo !errorlevel! >result" > run_manual.cmd + echo "$(echo $* | tr '/' '\\') 2>syserr.log & echo !errorlevel! >result" > run_manual.cmd cmd.exe /c "start \"$TITLE\" /wait cmd /v:on /c run_manual.cmd" #if test -f ./syserr.log; then # dos2unix -q ./syserr.log diff --git a/tests/testsuite.src/used_binaries.at b/tests/testsuite.src/used_binaries.at index 0e200a960..405c48d0f 100644 --- a/tests/testsuite.src/used_binaries.at +++ b/tests/testsuite.src/used_binaries.at @@ -359,9 +359,8 @@ AT_CLEANUP AT_SETUP([temporary path invalid]) AT_KEYWORDS([cobc runmisc]) -# Note: may be either removed completely as there was a report about -# this test "failing" - or skipped as this very often fails for -# WIN32 builds +# Note: we skip this as it often fails for WIN32 builds but sometimes works +AT_SKIP_IF([test "$COB_ON_WINDOWS" = "yes"]) AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. @@ -1379,7 +1378,7 @@ AT_DATA([prog.cob], [ ]) AT_CHECK([$COMPILE prog.cob], [0], [], []) -AT_CHECK([$COBCRUN_DIRECT ./prog| head -n 2], [0], +AT_CHECK([$COBCRUN_DIRECT ./prog | head -n 2], [0], [1 2 ], []) @@ -1390,6 +1389,11 @@ AT_CLEANUP AT_SETUP([signal handling SIGTERM in COBOL]) AT_KEYWORDS([runmisc stack stacktrace]) +# this is portable in all posix environments, but not on Win32; +# note: cygwin-compiled programs handle cygwin-sent SIGTERM as expected +# CTRL+C does raise a SIGINT, but only when executed from "within" the program +AT_XFAIL_IF([test "$COB_ON_WINDOWS" = "yes"]) + AT_DATA([prog.cob], [ IDENTIFICATION DIVISION. PROGRAM-ID. 'prog'.