handle EBCDIC in the testsuite runner (error display)
- move categories for that to test.sh, simplifying it - $ebcdic in Build.sh is now for the target, not the buildhost
This commit is contained in:
parent
60a9292b2f
commit
d8bd19e23e
23
Build.sh
23
Build.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.721 2017/05/01 20:03:25 tg Exp $'
|
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.722 2017/05/03 13:00:09 tg Exp $'
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||||
# 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
# 2011, 2012, 2013, 2014, 2015, 2016, 2017
|
||||||
@ -55,11 +55,10 @@ alls=______________________________________________________________
|
|||||||
|
|
||||||
case `echo a | tr '\201' X` in
|
case `echo a | tr '\201' X` in
|
||||||
X)
|
X)
|
||||||
ebcdic=true
|
# EBCDIC build system
|
||||||
lfcr='\n\r'
|
lfcr='\n\r'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
ebcdic=false
|
|
||||||
lfcr='\012\015'
|
lfcr='\012\015'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -507,7 +506,7 @@ last=
|
|||||||
tfn=
|
tfn=
|
||||||
legacy=0
|
legacy=0
|
||||||
textmode=0
|
textmode=0
|
||||||
ebcdic=0
|
ebcdic=false
|
||||||
|
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
@ -532,7 +531,7 @@ do
|
|||||||
last=c
|
last=c
|
||||||
;;
|
;;
|
||||||
:-E)
|
:-E)
|
||||||
ebcdic=1
|
ebcdic=true
|
||||||
;;
|
;;
|
||||||
:-G)
|
:-G)
|
||||||
echo "$me: Do not call me with '-G'!" >&2
|
echo "$me: Do not call me with '-G'!" >&2
|
||||||
@ -618,10 +617,7 @@ else
|
|||||||
add_cppflags -DMKSH_LEGACY_MODE
|
add_cppflags -DMKSH_LEGACY_MODE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $ebcdic = 0; then
|
if $ebcdic; then
|
||||||
check_categories="$check_categories shell:ebcdic-no shell:ascii-yes"
|
|
||||||
else
|
|
||||||
check_categories="$check_categories shell:ebcdic-yes shell:ascii-no"
|
|
||||||
add_cppflags -DMKSH_EBCDIC
|
add_cppflags -DMKSH_EBCDIC
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -2456,13 +2452,18 @@ cat >test.sh <<-EOF
|
|||||||
done
|
done
|
||||||
shift \$((OPTIND - 1))
|
shift \$((OPTIND - 1))
|
||||||
set -A args -- '$srcdir/check.pl' -p "\$pflag"
|
set -A args -- '$srcdir/check.pl' -p "\$pflag"
|
||||||
x=
|
if $ebcdic; then
|
||||||
|
args[\${#args[*]}]=-E
|
||||||
|
x=shell:ebcdic-yes,shell:ascii-no
|
||||||
|
else
|
||||||
|
x=shell:ebcdic-no,shell:ascii-yes
|
||||||
|
fi
|
||||||
for y in "\${check_categories[@]}"; do
|
for y in "\${check_categories[@]}"; do
|
||||||
x=\$x,\$y
|
x=\$x,\$y
|
||||||
done
|
done
|
||||||
if [[ -n \$x ]]; then
|
if [[ -n \$x ]]; then
|
||||||
args[\${#args[*]}]=-C
|
args[\${#args[*]}]=-C
|
||||||
args[\${#args[*]}]=\${x#,}
|
args[\${#args[*]}]=\$x
|
||||||
fi
|
fi
|
||||||
if (( usee )); then
|
if (( usee )); then
|
||||||
args[\${#args[*]}]=-e
|
args[\${#args[*]}]=-e
|
||||||
|
19
check.pl
19
check.pl
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.pl,v 1.45 2017/05/01 19:43:23 tg Exp $
|
# $MirOS: src/bin/mksh/check.pl,v 1.46 2017/05/03 13:00:10 tg Exp $
|
||||||
# $OpenBSD: th,v 1.1 2013/12/02 20:39:44 millert Exp $
|
# $OpenBSD: th,v 1.1 2013/12/02 20:39:44 millert Exp $
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011,
|
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011,
|
||||||
@ -247,7 +247,7 @@ $nxpassed = 0;
|
|||||||
|
|
||||||
%known_tests = ();
|
%known_tests = ();
|
||||||
|
|
||||||
if (!getopts('C:e:Pp:s:T:t:U:v')) {
|
if (!getopts('C:Ee:Pp:s:T:t:U:v')) {
|
||||||
print STDERR $Usage;
|
print STDERR $Usage;
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
@ -256,6 +256,7 @@ die "$prog: no program specified (use -p)\n" if !defined $opt_p;
|
|||||||
die "$prog: no test set specified (use -s)\n" if !defined $opt_s;
|
die "$prog: no test set specified (use -s)\n" if !defined $opt_s;
|
||||||
$test_prog = $opt_p;
|
$test_prog = $opt_p;
|
||||||
$verbose = defined $opt_v && $opt_v;
|
$verbose = defined $opt_v && $opt_v;
|
||||||
|
$is_ebcdic = defined $opt_E && $opt_E;
|
||||||
$test_set = $opt_s;
|
$test_set = $opt_s;
|
||||||
$temp_base = $opt_T || "/tmp";
|
$temp_base = $opt_T || "/tmp";
|
||||||
$utflocale = $opt_U || (($os eq "hpux") ? "en_US.utf8" : "en_US.UTF-8");
|
$utflocale = $opt_U || (($os eq "hpux") ? "en_US.utf8" : "en_US.UTF-8");
|
||||||
@ -883,6 +884,20 @@ format_char
|
|||||||
local($ch, $s);
|
local($ch, $s);
|
||||||
|
|
||||||
$ch = ord($_[0]);
|
$ch = ord($_[0]);
|
||||||
|
|
||||||
|
if ($is_ebcdic) {
|
||||||
|
if ($ch == 0x15) {
|
||||||
|
return '\n';
|
||||||
|
} elsif ($ch == 0x16) {
|
||||||
|
return '\b';
|
||||||
|
} elsif ($ch == 0x05) {
|
||||||
|
return '\t';
|
||||||
|
} elsif ($ch < 64 || $ch == 255) {
|
||||||
|
return sprintf("X'%02X'", $ch);
|
||||||
|
}
|
||||||
|
return chr($ch);
|
||||||
|
}
|
||||||
|
|
||||||
if ($ch == 10) {
|
if ($ch == 10) {
|
||||||
return '\n';
|
return '\n';
|
||||||
} elsif ($ch == 13) {
|
} elsif ($ch == 13) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user