| 20 | std::cout << #m << ": " << info.m << " " << unit << "\n" |
| 21 | |
| 22 | int testSystemInformation(int, char*[]) |
| 23 | { |
| 24 | std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation |
| 25 | |
| 26 | kwsys::SystemInformation info; |
| 27 | info.RunCPUCheck(); |
| 28 | info.RunOSCheck(); |
| 29 | info.RunMemoryCheck(); |
| 30 | printMethod(info, GetOSName); |
| 31 | printMethod(info, GetOSIsLinux); |
| 32 | printMethod(info, GetOSIsApple); |
| 33 | printMethod(info, GetOSIsWindows); |
| 34 | printMethod(info, GetHostname); |
| 35 | printMethod(info, GetFullyQualifiedDomainName); |
| 36 | printMethod(info, GetOSRelease); |
| 37 | printMethod(info, GetOSVersion); |
| 38 | printMethod(info, GetOSPlatform); |
| 39 | printMethod(info, Is64Bits); |
| 40 | printMethod(info, GetVendorString); |
| 41 | printMethod(info, GetVendorID); |
| 42 | printMethod(info, GetTypeID); |
| 43 | printMethod(info, GetFamilyID); |
| 44 | printMethod(info, GetModelID); |
| 45 | printMethod(info, GetExtendedProcessorName); |
| 46 | printMethod(info, GetSteppingCode); |
| 47 | printMethod(info, GetProcessorSerialNumber); |
| 48 | printMethod2(info, GetProcessorCacheSize, "KB"); |
| 49 | printMethod(info, GetLogicalProcessorsPerPhysical); |
| 50 | printMethod2(info, GetProcessorClockFrequency, "MHz"); |
| 51 | printMethod(info, GetNumberOfLogicalCPU); |
| 52 | printMethod(info, GetNumberOfPhysicalCPU); |
| 53 | printMethod(info, DoesCPUSupportCPUID); |
| 54 | printMethod(info, GetProcessorAPICID); |
| 55 | printMethod2(info, GetTotalVirtualMemory, "MB"); |
| 56 | printMethod2(info, GetAvailableVirtualMemory, "MB"); |
| 57 | printMethod2(info, GetTotalPhysicalMemory, "MB"); |
| 58 | printMethod2(info, GetAvailablePhysicalMemory, "MB"); |
| 59 | printMethod3(info, GetHostMemoryTotal(), "KiB"); |
| 60 | printMethod3(info, GetHostMemoryAvailable("KWSHL"), "KiB"); |
| 61 | printMethod3(info, GetProcMemoryAvailable("KWSHL", "KWSPL"), "KiB"); |
| 62 | printMethod3(info, GetHostMemoryUsed(), "KiB"); |
| 63 | printMethod3(info, GetProcMemoryUsed(), "KiB"); |
| 64 | printMethod(info, GetLoadAverage); |
| 65 | |
| 66 | for (long int i = 0; i <= 31; i++) { |
| 67 | if (info.DoesCPUSupportFeature(static_cast<long int>(1) << i)) { |
| 68 | std::cout << "CPU feature " << i << "\n"; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /* test stack trace |
| 73 | */ |
| 74 | std::cout << "Program Stack:" << std::endl |
| 75 | << kwsys::SystemInformation::GetProgramStack(0, 0) << std::endl |
| 76 | << std::endl; |
| 77 | |
| 78 | /* test segv handler |
| 79 | info.SetStackTraceOnError(1); |
nothing calls this directly
no test coverage detected
searching dependent graphs…