summaryrefslogtreecommitdiffstats
path: root/testSystemInformation.cxx
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2012-10-16 21:12:23 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-31 20:43:34 (GMT)
commit7ae44db4b9a1b3b26f2d670135fc00324e24f348 (patch)
treec4ce9f6df920f1b4e947376d01cb4f0e03fe7829 /testSystemInformation.cxx
parent5d0de36d2b2f420ab58841bbcd47c45fcdc4486e (diff)
downloadCMake-7ae44db4b9a1b3b26f2d670135fc00324e24f348.zip
CMake-7ae44db4b9a1b3b26f2d670135fc00324e24f348.tar.gz
CMake-7ae44db4b9a1b3b26f2d670135fc00324e24f348.tar.bz2
KWSys 2012-10-16 (b7a97ac3)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ b7a97ac3 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' bab53989..b7a97ac3 Brad King (3): f9db7eab SystemInformation: Fix helper definition order a1e83e42 SystemInformation: Expose helper functions only where needed b7a97ac3 SystemInformation: Drop unused LoadLines on OS X Burlen Loring (1): 6072e63b SystemInformation: support for resource limits Sean McBride (2): a536d833 ProcessUNIX: Suppress warning about uninteresting return code 00852081 SystemInformation: Fix sloppy use of sysctlbyname() API Change-Id: Iae8af129a021435ef4e6daef255e312c99d7b773
Diffstat (limited to 'testSystemInformation.cxx')
-rw-r--r--testSystemInformation.cxx34
1 files changed, 30 insertions, 4 deletions
diff --git a/testSystemInformation.cxx b/testSystemInformation.cxx
index b3afc9d..41fcf38 100644
--- a/testSystemInformation.cxx
+++ b/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);