From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id DD7B938C5BC5; Mon, 19 Dec 2022 11:13:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD7B938C5BC5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x22a.google.com with SMTP id v70so7542950oie.3; Mon, 19 Dec 2022 03:13:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YlsHTDuRWFzHCBBa+9IdmNyxBS/DvnLBi737Vjvt2qg=; b=f/P4+3ty7+2O4KjtPqpiCuSfn54DuKfFFF6cDmoGurvbd6DHW7p2lOhbGv585+FeN4 TXEhnVRgiKIruZ54k3bBh+/ypvxkOUbTePbm0Z+qax5D8KSb/3Hs1awK7fEO5L4piibn h2I5P5MW5T5llPJT0aBHx/mgMoqwx6vCyzchrbOv+Ii7cZspPk+pvn01T29Eej2Nlna9 w60EBi8FaRyLH9KaYfReH0XdKKJ337NdYzKHtRI4Ojaz2DeIfgQfyn/pK9o6tXIpiasD ysvFu5+qRLyxafVNeVDTCp8W9cJFQPEvjnqaE+o1MlAN4axyRJA5c4Q88aJySMZ9kSEM QJ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YlsHTDuRWFzHCBBa+9IdmNyxBS/DvnLBi737Vjvt2qg=; b=x1ABOv7jvPmse9yx0/Q3zGIzIcl9M+OZsEFd0ROep7mbcXG4qEmM7DLIH2Rm6nZzUK GZpMikzIsL15bT/qZuDMl6BUvouAOq7eU0hQUIBHwP4Ah7ZPahI5h3EdIpOvEF8KusgC H186k+UGoQ0dFTyrdIyxS/maN9sckHmM44tInv9GkP4uBeoo0ECxAJf69iAaKZzTOvp8 qI5WaC1jRevpQdWLuGPyU14wjtMoyM9Ajv++Ce9rr9GArdu0spABkqPbInvAG+VWpjrW GFkgeYQWXzzUPH1cLPYt/X6xFMq87/DRjc9C3zhy+3rzrmaflg148dtx9RxLj1/oqZHp 22zA== X-Gm-Message-State: ANoB5pmJ8rCeJ2OvJ7cKn8fzqyedKEHrG8vOO33Az8DH9MfPOO+0e3/w tM8HZlL+3NRWpJqnD5WeYQs+5cyLqpDMHn6JTzw= X-Google-Smtp-Source: AA0mqf7rFJyLBAJebPLVpDAni+NI47evpyv959FWPXSaN9WvBxEdLrAHTCM4LtZGUdUeb7pJLVdzNHAEx8Q6kcL3cVE= X-Received: by 2002:a05:6808:3095:b0:35e:6db4:a117 with SMTP id bl21-20020a056808309500b0035e6db4a117mr946373oib.112.1671448385213; Mon, 19 Dec 2022 03:13:05 -0800 (PST) MIME-Version: 1.0 References: <3f62bac2-ac1b-5c55-2488-ede2389d35d2@netcologne.de> <19a6b738-ad34-d145-1202-d2c7c474b272@netcologne.de> <639E8CB3.4030109@gmail.com> <639FE88D.7090408@gmail.com> In-Reply-To: <639FE88D.7090408@gmail.com> From: NightStrike Date: Mon, 19 Dec 2022 06:13:01 -0500 Message-ID: Subject: Re: testsuite under wine To: jcb62281@gmail.com Cc: Thomas Koenig , "fortran@gcc.gnu.org" , gcc mailing list , dejagnu@gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sun, Dec 18, 2022 at 11:29 PM Jacob Bachmeyer wrote: > > NightStrike wrote: > > On Sat, Dec 17, 2022 at 10:44 PM Jacob Bachmeyer wrote: > > > >> [...] > >> This is either a testsuite problem or an environment problem. The GNU > >> Fortran I/O module certainly has interesting behavior here. Try setting > >> TERM=dumb in the environment while running the testsuite. If that fixes > >> the problem, it may be appropriate to add "set ::env(TERM) dumb" to the > >> tool init file for GNU Fortran. > >> > > > > Setting TERM doesn't help. Wine tries to emulate the windows console, > > which requires outputting this stuff. It does so any time there's a > > pty, and I believe that Deja creates a pty when running the tests. > > > > That is a bug in Wine: the escapes should be suppressed entirely if the > terminal does not support them---and the "dumb" terminal does not > support them. I think it's a paradigm difference. I'm just guessing here, but Wine runs in a terminal that doesn't know about TERM. It's mimicking the "cmd.exe" that you'd run on a native Windows system (I think... I'd welcome corrections from those more knowledgeable). In theory, the effect would be the same if I set up a remote target board to ssh to a windows system and get dropped into a cmd.exe shell (I used to run this way... it'd take about a week to run the whole testsuite. It sucked...) [...snip for now, I'm working on getting reasonable output back to you, including an example of a case that fails, and how it responds to your suggestion. Stay tuned...] > > For now, I modified Wine to kludge out the code that > > creates the console, and a long term solution needs to be on the Wine > > side. I was just hoping for a less dirty hack from the Deja side. > > > > I think that the long-term solution is that Wine should properly honor > the TERM environment variable and not produce escape codes that the > declared terminal does not support. Agreed, just trying to get by for now. > > Note that there are other problems, too. It seems that when Deja is > > matching against "\n", it doesn't handle the different line endings of > > Windows correctly in a cross environment. Is there a way that I can > > set how to interpret \n in a target-board file? This affects fortran > > and other language tests also. > > No---problems related to line endings are bugs in the testsuite. This > caveat is documented in *Note: (dejagnu)Writing a test case. The manual > explains: "Note that terminal settings may result in the insertion of > additional `\r' characters, usually translating `\n' to `\r\n'." > > At the terminal layer, POSIX can *also* use "\r\n" sequences, since some > terminals historically needed them, even though the standard line ending > *within* a POSIX system is "\n" by itself. Because a pty simply > presents the "terminal" side of the interface to the controlling > program, Expect can receive "\r\n" when the subprocess emits "\n"; the > translation is performed by the kernel terminal driver and DejaGnu > testsuites must be prepared to receive (and discard) excess carriage > returns in the general case. Here's one that tries to handle different line endings (most tests do not do this): gfortran.dg/parameter_array_dummy.f90 which uses: ! { dg-output " *1 aa(\n|\r\n|\r)" } ! { dg-output " *2 ab(\n|\r\n|\r)" } ! { dg-output " *3 aaab(\n|\r\n|\r)" } ! { dg-output " *4 abaa(\n|\r\n|\r)" } ! { dg-output " *5 ababab(\n|\r\n|\r)" } But this results in: FAIL: gfortran.dg/parameter_array_dummy.f90 -O0 output pattern test Output was: 1 aa^M^M 2 ab^M^M 3 aaab^M^M 4 abaa^M^M 5 ababab^M^M Should match: *1 aa( |^M |^M) *2 ab( |^M |^M) *3 aaab( |^M |^M) *4 abaa( |^M |^M) *5 ababab( |^M |^M) The problem being that we are getting "0x0d 0x0d 0x0a", or \r\r\n. (Other examples fail differently, for instance there's a Rust test that outputs \r\r\n\n... but let's start with this one).