View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009949CMakeCMakepublic2009-11-22 06:492009-11-30 11:21
ReporterModestas Vainius 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformamd64OSDebian GNU/LinuxOS Versionsid
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0009949: Test suite failures: depends on the existance of $HOME
DescriptionTest kwsys.testRegistry (and "file registry" support in general on UNIX) fails when $HOME is not writable/existent. This makes me wonder why cmake needs to store anything in $HOME, why build directory or /tmp is not enough? Does cmake use "registry" to store some settings on UNIX? If so, I'm not really impressed with this design decision... FWIW, in my opinion, cmake should not store any settings in $HOME at all...

The other test failing is FindPackageTest. It wants to write to $HOME/.cmake/packages/CMakeTestExportPackage/someuniqueid (registry again?). I fail to see the need to pollute $HOME with test case stuff...
Steps To ReproduceHOME=/nonexistent make test
Additional InformationVerbose test suite failures can be found in the build logs of the cmake 2.8.0 package on Debian (link below). Debian buildds set HOME to non-existent directory.

http://experimental.debian.net/fetch.php?pkg=cmake&arch=armel&ver=2.8.0-2&stamp=1258878700&file=log&as=raw [^]
(scroll down)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0018519)
Brad King (manager)
2009-11-22 10:49

The KWSys one tests some functionality of the KWSys library. The library is included in several applications which write ~/.myapprc files. I don't remember for sure off the top of my head, but I think cmake-gui saves recently used build tree and source tree locations there.

The FindPackageTest one tests the export(PACKAGE) command feature. The idea is that some project that can be used from its build tree can run export(PACKAGE) with some arguments to register the build tree location as associated with that package. Then another project can do find_package() and magically locate the build tree. This is intended to make it easy to build a series of dependent projects without having to tell each one's build tree where its dependencies were built.

Both of these features are valid uses of $HOME, IMO. Many applications keep inter-session information there. However, I agree that the test suite should not need $HOME. Perhaps these tests can be fixed to point ENV{HOME} at somewhere in the test tree.
(0018525)
Modestas Vainius (reporter)
2009-11-22 11:17

Ok, makes sense somewhat. But please divert HOME somewhere in the build tree then. Tests are not real usage of cmake and should be isolated from the environment in order not to pollute or use anything from it by accident.
(0018549)
Brad King (manager)
2009-11-23 14:25

Fake $HOME to isolate tests from user
/cvsroot/CMake/CMake/Tests/EnforceConfig.cmake.in,v <-- Tests/EnforceConfig.cmake.in
new revision: 1.2; previous revision: 1.1
(0018550)
Brad King (manager)
2009-11-23 14:25

After the above-mentioned commit I can run tests without touching my real $HOME. All the modifications end up in the fake home dir created for testing in the build tree.

I'll schedule this for 2.8.1.
(0018572)
Brad King (manager)
2009-11-24 13:26

Some tests require configuration files in the home directory, like .cvspass. We need additional changes to put these files in the fake home directory.
(0018573)
Brad King (manager)
2009-11-24 13:26

Improve fake $HOME test isolation code
/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- Tests/CMakeLists.txt
new revision: 1.157; previous revision: 1.156
/cvsroot/CMake/CMake/Tests/EnforceConfig.cmake.in,v <-- Tests/EnforceConfig.cmake.in
new revision: 1.3; previous revision: 1.2
(0018618)
Brad King (manager)
2009-11-30 11:20

Okay, with the previously mentioned commit tests seem to work everywhere with the fake $HOME.

 Issue History
Date Modified Username Field Change
2009-11-22 06:49 Modestas Vainius New Issue
2009-11-22 09:21 Bill Hoffman Status new => assigned
2009-11-22 09:21 Bill Hoffman Assigned To => Brad King
2009-11-22 10:49 Brad King Note Added: 0018519
2009-11-22 11:17 Modestas Vainius Note Added: 0018525
2009-11-23 14:25 Brad King Note Added: 0018549
2009-11-23 14:25 Brad King Note Added: 0018550
2009-11-23 14:25 Brad King Status assigned => closed
2009-11-23 14:25 Brad King Resolution open => fixed
2009-11-24 13:26 Brad King Note Added: 0018572
2009-11-24 13:26 Brad King Status closed => feedback
2009-11-24 13:26 Brad King Resolution fixed => reopened
2009-11-24 13:26 Brad King Note Added: 0018573
2009-11-30 11:20 Brad King Note Added: 0018618
2009-11-30 11:20 Brad King Status feedback => closed
2009-11-30 11:21 Brad King Resolution reopened => fixed


Copyright © 2000 - 2018 MantisBT Team