testSystemInformation.cxx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "kwsysPrivate.h"
  2. #include KWSYS_HEADER(SystemInformation.hxx)
  3. #include KWSYS_HEADER(ios/iostream)
  4. // Work-around CMake dependency scanning limitation. This must
  5. // duplicate the above list of headers.
  6. #if 0
  7. # include "SystemInformation.hxx.in"
  8. # include "kwsys_ios_iostream.h.in"
  9. #endif
  10. #define printMethod(inof, m) kwsys_ios::cout << #m << ": " \
  11. << info.m() << "\n"
  12. int testSystemInformation(int, char*[])
  13. {
  14. kwsys::SystemInformation info;
  15. printMethod(info, GetVendorString);
  16. info.RunCPUCheck();
  17. info.RunOSCheck();
  18. info.RunMemoryCheck();
  19. printMethod(info, GetVendorString);
  20. printMethod(info, GetVendorID);
  21. printMethod(info, GetTypeID);
  22. printMethod(info, GetFamilyID);
  23. printMethod(info, GetModelID);
  24. printMethod(info, GetExtendedProcessorName);
  25. printMethod(info, GetProcessorSerialNumber);
  26. printMethod(info, GetProcessorCacheSize);
  27. printMethod(info, GetLogicalProcessorsPerPhysical);
  28. printMethod(info, GetProcessorClockFrequency);
  29. printMethod(info, GetProcessorAPICID);
  30. printMethod(info, GetOSName);
  31. printMethod(info, GetHostname);
  32. printMethod(info, GetOSRelease);
  33. printMethod(info, GetOSVersion);
  34. printMethod(info, GetOSPlatform);
  35. printMethod(info, Is64Bits);
  36. printMethod(info, GetNumberOfLogicalCPU);
  37. printMethod(info, GetNumberOfPhysicalCPU);
  38. printMethod(info, DoesCPUSupportCPUID);
  39. printMethod(info, GetTotalVirtualMemory);
  40. printMethod(info, GetAvailableVirtualMemory);
  41. printMethod(info, GetTotalPhysicalMemory);
  42. printMethod(info, GetAvailablePhysicalMemory);
  43. //int GetProcessorCacheXSize(long int);
  44. // bool DoesCPUSupportFeature(long int);
  45. return 0;
  46. }