Skip to content

Commit

Permalink
build and test updates
Browse files Browse the repository at this point in the history
* configure: check expected json-c header first
* tests:
	* atlocal.in, atlocal_win: export new definition COB_ON_WINDOWS to allow the testsuite skipping/failing tests - and applied it to used_binaries.at
	* 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

* build_windows/set_env_vs_dist: supporting space-included paths (not recommended)
  • Loading branch information
sf-mensch committed Oct 8, 2024
1 parent 83ec077 commit b583a35
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 23 deletions.
8 changes: 6 additions & 2 deletions build_windows/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

2024-10-07 Simon Sobisch <[email protected]>

* set_env_vs_dist: supporting space-included paths (not recommended)

2024-05-15 Simon Sobisch <[email protected]>

* makedist.cmd: cater for new different library names
Expand Down Expand Up @@ -315,7 +319,7 @@

* update for subfolder vc10

2014-07-07 Philipp B�hme <[email protected]>
2014-07-07 Philipp B�hme <[email protected]>

* minor bugfix (tpyos) for subfolder vc12

Expand All @@ -326,7 +330,7 @@
* updated all project files
* added subfolder vc11

2014-06-20 Philipp B�hme <[email protected]>
2014-06-20 Philipp B�hme <[email protected]>

* added project files - subfolders: vc7, vc8, vc9, vc10, vc12
(original project files and resource files version_cobc.rc,
Expand Down
4 changes: 2 additions & 2 deletions build_windows/set_env_vs_x64.cmd
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -36,4 +36,4 @@ if %errorlevel% equ 0 (
set "stay_open=x"
)

call %~dp0gcvsvars.cmd %*
call "%~dp0gcvsvars.cmd" %*
4 changes: 2 additions & 2 deletions build_windows/set_env_vs_x64.dist.tmpl.cmd
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -36,4 +36,4 @@ if %errorlevel% equ 0 (
set "stay_open=x"
)

call %~dp0gcvsvars.cmd %*
call "%~dp0gcvsvars.cmd" %*
4 changes: 2 additions & 2 deletions build_windows/set_env_vs_x86.cmd
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -39,4 +39,4 @@ if %errorlevel% equ 0 (
set "stay_open=x"
)

call %~dp0gcvsvars.cmd %*
call "%~dp0gcvsvars.cmd" %*
2 changes: 1 addition & 1 deletion build_windows/set_env_vs_x86.dist.tmpl.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ if %errorlevel% equ 0 (
set "stay_open=x"
)

call %~dp0gcvsvars.cmd %*
call "%~dp0gcvsvars.cmd" %*
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

2024-10-05 Simon Sobisch <[email protected]>

* 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 <[email protected]>

* atlocal.in, atlocal_win: allow overriding COB_CC during tests
Expand Down
18 changes: 13 additions & 5 deletions tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/atlocal_win
Original file line number Diff line number Diff line change
Expand Up @@ -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=";"
Expand Down
8 changes: 4 additions & 4 deletions tests/run_prog_manual.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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\""
}


Expand All @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions tests/testsuite.src/used_binaries.at
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
], [])
Expand All @@ -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'.
Expand Down

0 comments on commit b583a35

Please sign in to comment.