Add C++ methods for accessing binary name etc.
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 14 May 2012 09:29:05 +0000 (12:29 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 16 May 2012 17:34:16 +0000 (20:34 +0300)
commitcff032090eccdafe0d0806ede79ccf30841a88be
tree7d6401850508484f04acfba7c5c80747429d51a2
parent62abb67d3e0be28714212f8885b396d8b3823961
Add C++ methods for accessing binary name etc.

- Add a ProgramInfo class that can be used to access global information
  about binary name etc. Move some path manipulation code from
  CommandLineModuleManager to the new class, resolving a TODO item.
- Make initialization methods of this class also call the relevant
  methods in statutil.h.
- Call the new initialization methods in unit tests and in g_ana.
- Use the new method for accessing program names in C++ code.
- Fix ShortProgram() such that it does not segfault if
  set_program_name() has not been called (not needed after the above
  changes, but still better this way).
- Add statutil.c methods that use global storage to valgrind suppression
  list.

Change-Id: I74c906aa5188d2dc4f0e1f6edab89e36393724f3
13 files changed:
cmake/legacy_and_external.supp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlinemodulemanager.h
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlinetest.h
src/gromacs/gmxlib/statutil.c
src/gromacs/utility/errorformat.cpp
src/gromacs/utility/programinfo.cpp [new file with mode: 0644]
src/gromacs/utility/programinfo.h [new file with mode: 0644]
src/programs/g_ana/g_ana.cpp
src/testutils/CMakeLists.txt
src/testutils/testoptions.cpp
src/testutils/unittest_main.cpp