bugmake - Bugs: bug #15941, features/default_names test...

 
 

bug #15941: features/default_names test creates makefiles in the wrong directory (tests); fails to cleanup

Submitter:  greg keranen <gkeranen>
Submitted:  Wed 01 Mar 2006 11:14:02 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.0 Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 06 Mar 2006 01:55:47 AM UTC, comment #1: 

As per my email on this subject:

Having the makefiles created in the root directory is not a bug.  Many of the tests do that.  Yes, it is bogus and somewhat of a misfeature that the test suite doesn't create a separate area to run the tests in, but that is a long-standing to-do list item for the test suite... one of many, actually.  If anyone is interested in fixing the test suite that would be great.

However, adding lots of complexity to one single test, the way the suggested replacement default_names does, to move things to another directory is not the direction I want to go.  The solution should be that the harness will create temporary directories and arrange for the tests to be invoked in that directory.

The only real bug here is that the test calls the error() function if the test fails; it shouldn't do that because, as you point out, that stops the tests immediately before it has a chance to clean up.  I removed those calls and the test should operate properly now.

Paul D. Smith <psmith>
Group administrator
Wed 01 Mar 2006 11:14:02 AM UTC, original submission:  

--- TEST ENVIRONMENT:
GNU make on CYGWIN_NT-5.1 x2 1.5.19(0.150/4/2) i686
GNU Make 3.81rc1

--- STEPS TO REPRODUCE:
1. Create condition for default_names to fail:
    Edit  tests/run_make_tests.pl, as follows - omitting CYGWIN_NT from 'W32' port_type assignment:

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

2. Run test   
[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
------------------------------------------------------------------------------

Clearing work...
Making work dirs...

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) :-(

[greg@x2 tests]$ ls
COPYING    README    run_make_tests          scripts
ChangeLog  makefile  run_make_tests.pl       test_driver.pl
NEWS       mkshadow  run_make_tests.pl.orig  work
[greg@x2 tests]$ cat makefile
THIRD: ; @echo It chose Makefile

--- ANALYSIS:

makefile is left behind in tests directory when test dies.
toplevel cannot cleanup since test files are not in correct directory (work)

Note that default_names is unusual in its need to create 2 or 3 makefiles, AND DELETE THEM in order to perform subsequent tests in the suite - must create its own makefile and cleanup too since it doesn't (cannot?) take advantage of the preferred top level routines to coordinate all this: for example, test_driver.pl creates makefiles with &get_tmpfile() and passes filename to make with explicit -f option. Obviously, default_names cannot use this technique.

--- PROPOSED FIX:
I have re-written default_names script to handle errors correctly, and creating makefiles under work directory, using absolute path from global vars: $pwd . $pathsep . $workpath

New default_names file is attached.

--- BUG REGRESSION OUTPUT:
I have tested this on Cygwin under the original 'abort' conditions (using 3.81rc1 run_make_tests.pl, prior to applying my fix for BUG #15937) and verified that this version correctly handles the error and leaves no makefiles behind.

I have also tested under success conditions (#15937 fix applied) and it works the same as previous version of the script.

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 #1758:  default_names added by gkeranen (3KiB - application/octet-stream - default_names file - fixed to handle errors correctly and cleanup)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 6 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 default_names, #3457

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code