Don't run UTF-8.exp test if newlib is not built with multibyte support.

Submitted on behalf of Yuriy Kolerov.

newlib/ChangeLog

2016-04-29  Yuriy Kolerov <yuriy.kolerov@synopsys.com>

        testsuite/newlib.locale/UTF-8.exp: Don't run if multibyte support is
        disabled.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Signed-off-by: Anton Kolesov <anton.kolesov@synopsys.com>
This commit is contained in:
Jeff Johnston 2016-05-02 16:03:27 -04:00
parent 11afe8f6b6
commit 58dd08ee50
1 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,18 @@
load_lib checkoutput.exp
# Don't run this test if newlib's build does not support multibyte encodings.
set newlib_header_name "$objdir/targ-include/newlib.h"
if [file exists $newlib_header_name] {
set newlib_header_fid [open $newlib_header_name r]
set newlib_header_text [read $newlib_header_fid]
close $newlib_header_fid
if {![regexp "#define _MB_CAPABLE" $newlib_header_text] || \
[regexp "#define _MB_LEN_MAX 1" $newlib_header_text]} {
return
}
}
set expected_output {
"Set C-UTF-8 locale."
"* U-00000000"