31#include <jau/test/catch2_ext.hpp>
38TEST_CASE(
"Test 00 Platform Info - os_and_arch",
"[endian][abi][cpu][os]" ) {
42TEST_CASE(
"Test 01 OS CPU ABI ENDIAN - os_and_arch",
"[endian][abi][cpu][os]" ) {
48 std::cout <<
"CpuInfo: " << cpu.
toString() << std::endl;
50 std::cout <<
"- os_type: " << jau::os::to_string(os) << std::endl;
51 std::cout <<
"- abi_type: " << jau::os::to_string(abi) << std::endl;
52 std::cout <<
"- os_and_arch " << os_and_arch << std::endl << std::endl;
55 REQUIRE( std::string::npos == os_and_arch.find(
"undef") );
64 std::cout <<
"User-Current: " << uinfo.
toString() << std::endl;
66 REQUIRE(
true == uinfo.
isValid() );
71 std::cout <<
"User 'root': " << uinfo.
toString() << std::endl;
Singleton CpuInfo caching all jau::cpu information.
static const CpuInfo & get() noexcept
Returns reference to const singleton instance.
cpu_family_t family
cpu_family_t derived from Architectures predefined compiler macros.
std::string toString(std::string &sb, bool details_only=false) const noexcept
User account information of the underlying OS.
bool isValid() const noexcept
std::string toString() const noexcept
constexpr bool is_defined_endian(const endian_t &v) noexcept
Evaluates true if the given endian is defined, i.e.
constexpr bool is_little_or_big_endian() noexcept
Evaluates true if platform is running in little or big endian mode, i.e.
endian_t
Endian identifier, indicating endianess of all scalar types.
@ native
Identifier for native platform type, one of the above.
std::string get_os_and_arch() noexcept
Returns this hosts's common name, see get_os_and_arch()
constexpr bool is_defined_os_type(const os_type_t v) noexcept
Evaluates true if the given os_type is defined, i.e.
std::string get_platform_info() noexcept
os_type_t
OS type bits and unique IDs.
abi_type_t get_abi_type() noexcept
constexpr bool is_generic_wasm() noexcept
Evaluates true if platform os_type::native contains os_type::GenWasm.
@ native
Identifier for native OS type, one of the above.
TEST_CASE("Test 00 Platform Info - os_and_arch", "[endian][abi][cpu][os]")