bugmake - Bugs: bug #15937, default_names test dies on Cygwin;...

 
 

bug #15937: default_names test dies on Cygwin; $port_type = 'UNIX'; should be 'W32'

Submitted by:  greg keranen <gkeranen>
Submitted on:  Wed 01 Mar 2006 04:01:54 AM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.0 Operating System:  MS Windows
Fixed Release:  3.81 Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 06 Mar 2006 02:27:22 AM UTC, comment #3: 

I've fixed this for now by making cygwin be W32.  I agree that the whole $port_type thing is overloaded.  It should be replaced by a hash, like %FEATURES, where each key is some feature that can be enabled/disabled: 8.3 filenames, case insensitive filenames, and symbolic link support are a few that pop immediately to mind.  Then this hash can be constructed properly by the harness based on the host type or whatever other criteria we like.

In fact the entire test suite, as has been mentioned, is in need of a comprehensive update and cleanup.  If anyone is interested in undertaking this please contact me to discuss the details: I have definite requirements for any enhancement.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 03 Mar 2006 02:39:06 AM UTC, comment #2: 

Agent Zhang wrote:

>>   if ($CASE_SENSITIVE) {

[...]

>The essence is: any platforms which are case-insensitive to file names should

be taken into account. So there won't be any bug reports when other
Cygwin-like monsters born out in the future. :=)

I agree completely.
I didn't really want to tread into 'deep water', questioning the semantics of $port_type but it really should be done - at least for the sake of consistency of the test suite, it should be DOCUMENTED: what is the supposed meaning of $port_type?

In the case of this test, Agent's idea of a new global $CASE_SENSITIVE is a better way to go than $port_type.

Would Paul or Eli care to provide any guidance on how to address the more general question of $port_type semantics? Should we create a bug for separate discussion of that issue? Or perhaps create a new document as a placeholder for a definitive statement on coding standards and semantics for the test suite?

Thanks.

greg keranen <gkeranen>
Thu 02 Mar 2006 08:06:35 AM UTC, comment #1: 

> default_names attempts to avoid testing with only makefile
> and Makefile present on case-insensitive file systems
> (DOS/WIN32 platforms) by using the test:
> if ($port_type eq 'UNIX')
>
> Unfortunately, Cygwin was set to 'UNIX' (the default
> assignment) and failed the test.


Yeah! This is the only failing test on my Cygwin build of GNU make 3.81rc1. To be honest, I noticed this problem in features/default_names when I was porting GNU make 3.81beta4's test suit to my project a few weeks ago.

> --- SOLUTION:
>
> Modify tests/run_make_tests.pl, as follows:
>
> # This is probably not specific enough.
> #
> if ($osname =~ /Windows/i || $osname =~ /MINGW32/i || $osname =~ /CYGWIN_NT/i) {
> $port_type = 'W32';
> }


I disagree.

IMHO, your patch is not general enough. My personal fix is as following:

>   $me = $0;
>   $me =~ s/[a-z]+/uc($&)/ge or
>   $me =~ s/[A-Z]+/lc($&)/ge;
>   $CASE_SENSITIVE = not -f $me;
>   ...
>   if ($CASE_SENSITIVE) {
>        # blah blah blah...
>   }


I'm not sure if very old perl interpreters support the special variable `$0'. In case that you know the path of your test script in advance, you can modify the code given above without using `$0':

>   $path = 'scripts/features';
>   $me = "$path/default_names";
>   ...


The essence is: any platforms which are case-insensitive to file names should be taken into account. So there won't be any bug reports when other Cygwin-like monsters born out in the future. :=)

Agent

Agent Zhang <agent>
Wed 01 Mar 2006 04:01:54 AM UTC, original submission:  

--- STEPS TO REPRODUCE:

[greg@x2 tests]$ ./run_make_tests features/default_names
------------------------------------------------------------------------------
    Running tests for GNU make on CYGWIN_NT-5.1 x2 1.5.19(0.150/4/2) i686
                               GNU Make 3.81rc1
------------------------------------------------------------------------------
[...]
features/default_names ..................................

      • Test died (features/default_names): test_driver.pl: 453: abort at test_drive

r.pl line 638.

1 Test in 1 Category Failed (See .diff files in work dir for details) :-(

--- CONTENTS OF FILE: default_names.diff.1

      • work/features/default_names.base.1 Mon Feb 27 20:51:06 2006

--- work/features/default_names.log.1 Mon Feb 27 20:51:06 2006
***************

      • 1 ****

! It chose makefile
--- 1 ----
! It chose Makefile

--- ANALYSIS:

tests/scripts/features/default_names is supposed to test if make can correctly execute GNUmakefile, makefile or Makefile, in the correct order, when present. It does this by creating multiple makefiles and compares expected with actual output.

default_names attempts to avoid testing with only makefile and Makefile present on case-insensitive file systems (DOS/WIN32 platforms) by using the test: 
    if ($port_type eq 'UNIX')

Unfortunately, Cygwin was set to 'UNIX' (the default assignment) and failed the test.

$port_type is set in tests/run_make_tests.pl, as follows:

   # This is probably not specific enough.
   #
   if ($osname =~ /Windows/i || $osname =~ /MINGW32/i) {
     $port_type = 'W32';
   }

Debug output shows:
    OS name = `CYGWIN_NT-5.1 x2 1.5.19(0.150/4/2) i686'
    Port type: UNIX

Unlike MinGW, Cygwin is not assigned the port_type 'W32' and, therefore default_names fails trying to create a file 'Makefile' which already exists, as 'makefile'.

Assuming these environments are similar enough, as far as the make test suite is concerned, it seems that we should simply assign Cygwin the same port_type value as MinGW.

--- SOLUTION:

Modify tests/run_make_tests.pl, as follows:

   # This is probably not specific enough.
   #
   if ($osname =~ /Windows/i || $osname =~ /MINGW32/i || $osname =~ /CYGWIN_NT/i) {
     $port_type = 'W32';
   }

--- BUG REGRESSION OUTPUT:

[greg@x2 tests]$ ./run_make_tests features/default_names
[...]
features/default_names .................................. ok     (2 passed)

2 Tests in 1 Category Complete ... No Failures :-)

--- IMPACT OF CHANGE ON OTHER TESTS:   

No impact was found.
Currently, the only other tests which use $port_type variable are:

    tests/scripts/functions/foreach
    test/scripts/options/symlinks

Results of these tests are exactly the same before and after change of $port_type logic in run_make_tests.pl

RESULTS:
options/symlinks ........................................ ok     (0 passed)
[...]
functions/foreach ....................................... ok     (4 passed)

greg keranen <gkeranen>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #1756:  run_make_tests.pl added by gkeranen (10KiB - application/octet-stream - run_make_tests.pl - fixed applied)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

 

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 => 3.81
2006-03-06 psmith StatusNone => Fixed
    Assigned toNone => psmith
    Open/ClosedOpen => Closed
    Fixed ReleaseNone => 4.0
2006-03-01 gkeranen Attached File- => Added run_make_tests.pl, #3455
    Carbon-Copy- => Added psmith@gnu.org

Back to the top


Powered by Savane 3.5