Improve ProgramInfo and use it everywhere.
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 4 Jun 2012 09:03:50 +0000 (12:03 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 3 Jul 2012 23:25:56 +0000 (01:25 +0200)
commitea8524ad82d0decc49f2db4684ac0cd28cf77180
treee00fb4e92aafdb0e147f4757333c2e4230e1edb1
parent14fd0b7b4cfd55419675e09b26b8905fff90fe60
Improve ProgramInfo and use it everywhere.

- The ProgramInfo class now stores the full command line.
  Moved functionality to add quotes to arguments with spaces from
  gmx::test::CommandLine to ProgramInfo.
- ProgramInfo initialization is now protected by a mutex for
  completeness.
- oenv.c and statutil.c now use ProgramInfo internally to store/return
  the binary name and command line.  Removes duplicate implementations
  of this functionality.  Required changing the return values of
  ProgramInfo methods from std::string values to const references.
- Removed many unnecessary #include directives from these two files.
- Fixed warnings that were produced from these files when switching them
  to C++ compilation (one cppcheck warning suppressed for now).
- Add a temporary hack for Windows to try to make get_libdir() work for
  tests that are run through CTest.

Helps with #950.

Change-Id: I1bfd4231b8b7055d0a014b41be67a7c1c99e36b0
cmake/legacy_and_external.supp
src/gromacs/gmxlib/oenv.cpp [moved from src/gromacs/gmxlib/oenv.c with 72% similarity]
src/gromacs/gmxlib/pargs.c
src/gromacs/gmxlib/statutil.cpp [moved from src/gromacs/gmxlib/statutil.c with 83% similarity]
src/gromacs/legacyheaders/oenv.h
src/gromacs/legacyheaders/statutil.h
src/gromacs/legacyheaders/types/oenv.h
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/programinfo.cpp
src/gromacs/utility/programinfo.h
src/testutils/cmdlinetest.cpp