diff options
author | Brad King <brad.king@kitware.com> | 2012-10-31 20:44:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-10-31 20:44:00 (GMT) |
commit | 17fb60bb13643a0f79c815688c317f56c551ae58 (patch) | |
tree | 33710b20819640040b4cd91186dca3ac853a520d /Source/kwsys/testSystemInformation.cxx | |
parent | 97c98876b715dd954b4ce744a1a86d1d14e6ab9d (diff) | |
parent | 7ae44db4b9a1b3b26f2d670135fc00324e24f348 (diff) | |
download | CMake-17fb60bb13643a0f79c815688c317f56c551ae58.zip CMake-17fb60bb13643a0f79c815688c317f56c551ae58.tar.gz CMake-17fb60bb13643a0f79c815688c317f56c551ae58.tar.bz2 |
Merge branch 'upstream-kwsys' into import-KWSys-subtree
Diffstat (limited to 'Source/kwsys/testSystemInformation.cxx')
-rw-r--r-- | Source/kwsys/testSystemInformation.cxx | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/Source/kwsys/testSystemInformation.cxx b/Source/kwsys/testSystemInformation.cxx index b3afc9d..41fcf38 100644 --- a/Source/kwsys/testSystemInformation.cxx +++ b/Source/kwsys/testSystemInformation.cxx @@ -13,8 +13,6 @@ #include KWSYS_HEADER(SystemInformation.hxx) #include KWSYS_HEADER(ios/iostream) - - // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 @@ -22,12 +20,31 @@ # include "kwsys_ios_iostream.h.in" #endif -#define printMethod(inof, m) kwsys_ios::cout << #m << ": " \ +#if defined(KWSYS_USE_LONG_LONG) +# if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG) +# define iostreamLongLong(x) (x) +# else +# define iostreamLongLong(x) ((long)x) +# endif +#elif defined(KWSYS_USE___INT64) +# if defined(KWSYS_IOS_HAS_OSTREAM___INT64) +# define iostreamLongLong(x) (x) +# else +# define iostreamLongLong(x) ((long)x) +# endif +#else +# error "No Long Long" +#endif + +#define printMethod(info, m) kwsys_ios::cout << #m << ": " \ << info.m() << "\n" -#define printMethod2(inof, m, unit) kwsys_ios::cout << #m << ": " \ +#define printMethod2(info, m, unit) kwsys_ios::cout << #m << ": " \ << info.m() << " " << unit << "\n" +#define printMethod3(info, m, unit) kwsys_ios::cout << #m << ": " \ +<< iostreamLongLong(info.m) << " " << unit << "\n" + int testSystemInformation(int, char*[]) { kwsys::SystemInformation info; @@ -35,7 +52,11 @@ int testSystemInformation(int, char*[]) info.RunOSCheck(); info.RunMemoryCheck(); printMethod(info, GetOSName); + printMethod(info, GetOSIsLinux); + printMethod(info, GetOSIsApple); + printMethod(info, GetOSIsWindows); printMethod(info, GetHostname); + printMethod(info, GetFullyQualifiedDomainName); printMethod(info, GetOSRelease); printMethod(info, GetOSVersion); printMethod(info, GetOSPlatform); @@ -58,6 +79,11 @@ int testSystemInformation(int, char*[]) printMethod2(info, GetAvailableVirtualMemory, "MB"); printMethod2(info, GetTotalPhysicalMemory, "MB"); printMethod2(info, GetAvailablePhysicalMemory, "MB"); + printMethod3(info, GetHostMemoryTotal(), "KiB"); + printMethod3(info, GetHostMemoryAvailable("KWSHL"), "KiB"); + printMethod3(info, GetProcMemoryAvailable("KWSHL","KWSPL"), "KiB"); + printMethod3(info, GetHostMemoryUsed(), "KiB"); + printMethod3(info, GetProcMemoryUsed(), "KiB"); //int GetProcessorCacheXSize(long int); // bool DoesCPUSupportFeature(long int); |