Skip to content

Commit

Permalink
Merge SVN 4971
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed Sep 13, 2024
1 parent 93543a9 commit 446b75d
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 31 deletions.
4 changes: 4 additions & 0 deletions build_aux/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

2023-02-06 Simon Sobisch <[email protected]>

* pre-inst-env.in: export COB_ON_CYGWIN for testsuite checks

2023-01-21 Simon Sobisch <[email protected]>

* pre-inst-env.in: prefer config.status replacement over environment var
Expand Down
7 changes: 7 additions & 0 deletions build_aux/pre-inst-env.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export COB_CONFIG_DIR COB_COPY_DIR
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
export COB_LIBRARY_PATH

# 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

# not robust check, but better than none
if test "x${BASH_SOURCE}" != "x" -a "${BASH_SOURCE}" != "$0"; then
echo "This script should not be sourced but called instead!"
Expand Down
8 changes: 8 additions & 0 deletions tests/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
under MSVC Release, by forcing a flush of stdout with
fflush and using cob_free instead of free in C codes

2023-02-06 Simon Sobisch <[email protected]>

* atlocal.in, atlocal_valgrind, atlocal_win: do not unset OS
as this is an external var we need to keep for win32
* atlocal_valgrind, atlocal_win: added notes for things we
explicit don't want to do
* testsuite.src/run_file.at: skip OS recognition on cygwin

2023-01-23 David Declerck <[email protected]>

* testsuite.src/configuration.at: test reading translation
Expand Down
14 changes: 11 additions & 3 deletions tests/atlocal.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ UNIFY_LISTING="@abs_srcdir@/listings-sed.sh"
# test runner for manual tests, content may be adjusted by the user
RUN_PROG_MANUAL="@abs_builddir@/run_prog_manual.sh"

# unset option if not internally set in this script
# unset option if not internally set in this script - or external
_unset_option () {
if test "$1" != "COB_CONFIG_DIR" \
-a "$1" != "COB_COPY_DIR" \
Expand All @@ -125,7 +125,8 @@ _unset_option () {
-a "$1" != "COB_CFLAGS" \
-a "$1" != "COB_LDFLAGS" \
-a "$1" != "COB_LIBS" \
-a "$1" != "COB_UNIX_LF"; then
-a "$1" != "COB_UNIX_LF" \
-a "$1" != "OS"; then
unset $1
fi
}
Expand All @@ -137,6 +138,13 @@ _return_path () {
echo "$1"
}

# 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

# Fix for testcases where cobc translates path to win32 equivalents
if test "x$MSYSTEM" != "x"; then
PATHSEP=";"
Expand All @@ -147,7 +155,7 @@ if test "x$MSYSTEM" != "x"; then
# the Win32 variant when starting the cobc process)
COBCRUN=${ABS_COBCRUN}
else
PATHSEP='@PATH_SEPARATOR@';
PATHSEP='@PATH_SEPARATOR@'
fi
export PATHSEP

Expand Down
18 changes: 9 additions & 9 deletions tests/atlocal_valgrind
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ COMPILE_MODULE="${COBC} -m ${FLAGS}"
# test runner for manual tests, content may be adjusted by the user
RUN_PROG_MANUAL="${abs_builddir}/run_prog_manual.sh"

# unset option if not internally set in this script
# unset option if not internally set in this script - or external
_unset_option () {
if test "$1" != "COB_CONFIG_DIR" \
-a "$1" != "COB_COPY_DIR" \
Expand All @@ -130,7 +130,8 @@ _unset_option () {
-a "$1" != "COB_CFLAGS" \
-a "$1" != "COB_LDFLAGS" \
-a "$1" != "COB_LIBS" \
-a "$1" != "COB_UNIX_LF"; then
-a "$1" != "COB_UNIX_LF" \
-a "$1" != "OS"; then
unset $1
fi
}
Expand All @@ -143,13 +144,12 @@ _return_path () {
echo "$1"
}

# Fix for testcases where cobc translates path to win32 equivalents
if test "x$MSYSTEM" != "x"; then
PATHSEP=";"
else
PATHSEP='@PATH_SEPARATOR@';
fi
export PATHSEP
# Note: we explicit do not set COB_ON_CYGWIN here,
# as this is file is about running non-cygwin binaries

# Note: we explicit do not handle PATHSEP here,
# as this is file is about running non-windows binaries
PATHSEP='@PATH_SEPARATOR@'

# entries likely referenced in the LIBS entries below
prefix="@prefix@"
Expand Down
8 changes: 6 additions & 2 deletions tests/atlocal_win
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ COMPILE_MODULE="${COBC} -m ${FLAGS}"
# test runner for manual tests, content may be adjusted by the user
RUN_PROG_MANUAL="${abs_builddir}/run_prog_manual.sh"

# unset option if not internally set in this script
# unset option if not internally set in this script - or external
_unset_option () {
if test "$1" != "COB_CONFIG_DIR" \
-a "$1" != "COB_COPY_DIR" \
Expand All @@ -67,7 +67,8 @@ _unset_option () {
-a "$1" != "COB_CFLAGS" \
-a "$1" != "COB_LDFLAGS" \
-a "$1" != "COB_LIBS" \
-a "$1" != "COB_UNIX_LF"; then
-a "$1" != "COB_UNIX_LF" \
-a "$1" != "OS"; then
unset $1
fi
}
Expand All @@ -89,6 +90,9 @@ _return_path () {
fi
}

# Note: we explicit do not set COB_ON_CYGWIN here,
# as this is file is about running non-cygwin binaries

# Fix for testcases where cobc uses win32 paths internally
PATHSEP=";"
export PATHSEP
Expand Down
64 changes: 47 additions & 17 deletions tests/testsuite.src/run_file.at
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Copyright (C) 2003-2012, 2014-2022 Free Software Foundation, Inc.
## Copyright (C) 2003-2012, 2014-2023 Free Software Foundation, Inc.
## Written by Keisuke Nishida, Roger While, Simon Sobisch, Ron Norman,
## Brian Tiffin, Joe Robbins, Edward Hart
##
Expand Down Expand Up @@ -6645,7 +6645,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -6711,7 +6713,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open i-o file1 with lock.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -6779,7 +6783,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -6847,7 +6853,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -6919,7 +6927,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open i-o file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7276,7 +7286,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7350,7 +7362,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1 with lock.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7427,7 +7441,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7504,7 +7520,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7583,7 +7601,9 @@ AT_DATA([prog1.cob], [
open output file1.
close file1.
open input file1.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7674,7 +7694,9 @@ AT_DATA([prog1.cob], [
read file1.
if fs not = "00"
display "FAILED 1::r fs=" fs.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7765,7 +7787,9 @@ AT_DATA([prog1.cob], [
rewrite file1-rec.
if fs not = "00"
display "FAILED 1::rw fs=" fs.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -7852,7 +7876,9 @@ AT_DATA([prog1.cob], [
read file1 with lock.
if fs not = "00"
display "FAILED 1::r fs=" fs.
accept os-check from environment "OS".
accept os-check from environment "COB_ON_CYGWIN".
if os-check = spaces
accept os-check from environment "OS".
if os-check = spaces
accept os-check from environment "OS_NAME".
inspect os-check converting "werfdosin" to "WERFDOSIN".
Expand Down Expand Up @@ -26584,9 +26610,13 @@ AT_DATA([prog.cob], [
*>> fileio-sort currently returns constant length records
MOVE 1-rsz(ix-1) TO rsz
*>> END-OF-DETOUR
IF (1-rsz(ix-1) <> rsz) or
(1-rec(ix-1) <> file2-rec)
DISPLAY "FAILED"
IF (1-rsz(ix-1) <> rsz)
DISPLAY "FAILED Test " ix-1 ": "
1-rsz(ix-1) " <> " rsz
END-IF
IF (1-rec(ix-1) <> file2-rec)
DISPLAY "FAILED Test " ix-1 ": "
1-rec(ix-1) " <> " file2-rec
END-IF
END-PERFORM.
CLOSE file2.
Expand Down

0 comments on commit 446b75d

Please sign in to comment.