mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-11 17:00:22 +00:00
- Removes the GTest dependency, replacing it with a minimal custom framework (`test/framework.*`) that covers only what the tests actually use — a unified `TEST()` macro with SFINAE-based fixture auto-detection, `EXPECT_*`/`ASSERT_*` assertions, environments, and setup/teardown. - `--exclude-perf-tests` flag and substring-based negative filtering - `MSCCLPP_ENABLE_COVERAGE` CMake option with gcov/lcov; CI uploads to Codecov - Merges standalone `test/perf/` into main test targets - Refactors Azure pipelines to reduce redundancies & make more readable --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Changho Hwang <changhohwang@microsoft.com>
26 lines
603 B
C++
26 lines
603 B
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
#include <mscclpp/errors.hpp>
|
|
#include <mscclpp/utils.hpp>
|
|
#include <thread>
|
|
|
|
#include "../framework.hpp"
|
|
|
|
TEST(UtilsTest, getHostName) {
|
|
std::string hostname1 = mscclpp::getHostName(1024, '.');
|
|
EXPECT_FALSE(hostname1.empty());
|
|
EXPECT_LE(hostname1.size(), 1024);
|
|
|
|
EXPECT_EQ(mscclpp::getHostName(1024, hostname1[0]).size(), 0);
|
|
|
|
std::string hostname2;
|
|
|
|
std::thread th([&hostname2]() { hostname2 = mscclpp::getHostName(1024, '.'); });
|
|
|
|
ASSERT_TRUE(th.joinable());
|
|
th.join();
|
|
|
|
EXPECT_EQ(hostname1, hostname2);
|
|
}
|