Bug 82327 - FAIL: glcpp/tests/glcpp-test-cr-lf
Summary: FAIL: glcpp/tests/glcpp-test-cr-lf
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: Carl Worth
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-08 04:48 UTC by Vinson Lee
Modified: 2014-09-02 04:37 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2014-08-08 04:48:29 UTC
mesa: 89d92fc00e52ac0f9d5bb1edf81660ab93816f1b (master 10.3.0-devel)

================================================
   Mesa 10.3.0-devel: src/glsl/test-suite.log
================================================

# TOTAL: 6
# PASS:  5
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: glcpp/tests/glcpp-test-cr-lf
==================================

===== Testing with \r line terminators (old Mac format) =====
144/144 tests returned correct results
PASS
===== Testing with \r\n line terminators (DOS format) =====
9/144 tests returned correct results
FAIL
===== Testing with \n\r (bizarre, but allowed by GLSL spec.) =====
105/144 tests returned correct results
FAIL

1/3 tests returned correct results
Comment 1 Ian Romanick 2014-08-08 18:08:50 UTC
Hm... we may want to disable some of these tests on non-Linux platforms.  Since we're playing around with the line endings (and assuming they "start" in a certain state), there are a few things that could go wrong.

Carl, what do you think?
Comment 2 Vinson Lee 2014-08-12 19:26:50 UTC
mesa: ab66b196699b80cc32cf00fa7cd794cfa992cf3c (master 10.3.0-devel)

glcpp-test-cr-lf fails on FreeBSD.
Comment 3 Ian Romanick 2014-08-14 01:43:47 UTC
Those tests make heavy use of sed and tr.  Is there some difference between the versions on those platforms?  What sed and tr (or other commands used in those tests) exist on OS X and FreeBSD?
Comment 4 Carl Worth 2014-08-14 16:26:39 UTC
Hi folks,

Sorry for being silent on this bug until now. (My spam filters were being a bit too aggressive and throwing away bugzilla email.)

I'll look into these issues and come up with a fix soon.

-Carl
Comment 5 Carl Worth 2014-08-18 23:38:58 UTC
Patch sent to mesa-dev:

http://lists.freedesktop.org/archives/mesa-dev/2014-August/066111.html

Testing and feedback will be most appreciated.

-Carl

(I wrote this and tested on Mac OS X and also verified there is no regression
on Linux. I have not tested any of this on FreeBSD.)
Comment 6 Vinson Lee 2014-09-02 04:37:43 UTC
commit f90b7e0f2bee56af22edeebfea292ab960ce0628
Author: Carl Worth <cworth@cworth.org>
Date:   Mon Aug 18 16:26:34 2014 -0700

    glcpp: Fix glcpp-test-cr-lf "make check" test for Mac OS X
    
    There were two problems with the way this script used sed on OS X:
    
      1. The OS X sed doesn't interpret "\r" in a replacement list as a
         carriage-return character, (instead it was inserting a literal
         'r' character).
    
         We fix this by putting an actual ^M character into the source of
         the script, (rather than a two-character escape sequence hoping
         for sed to do the right thing).
    
      2. When generating the test files with LF-CR ("\n\r") newlines, the
         OS X sed was adding an undesired final newline ("\n") at the end
         of the file. We avoid this by first using sed to add the ^M
         before the newlines, then using tr to swap the \r and \n
         characters. This way, sed never sees any lines ending with
         anything but \n, so it doesn't get confused and doesn't add any
         bogus extra newlines.
    
    Tested-by: Vinson Lee <vlee@freedesktop.org>
    
    Vinson's testing confirmed that this patch fixes FreeBSD as well.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.