Files
mscclpp/test/unit/errors_tests.cc
copilot-swe-agent[bot] b59196b8a5 Integrate perf tests into unit_tests and add CI coverage step
- Add unit_tests_main.cc with main() function for unit_tests executable
- Create fifo_perf_tests.cu as PERF_TEST for unit_tests
- Add fifo_perf_tests.cu to unit_tests sources
- Fix errors_tests.cc to use ASSERT_TRUE for ErrorCode comparisons
- Fix core_tests.cc to use ASSERT_TRUE for TransportFlags comparisons
- Add Azure pipeline step for Debug build with coverage
- Add step to run mp_unit_tests --exclude-perf-tests with coverage

The perf tests are now part of unit_tests and can be filtered out
for coverage reporting. CI now includes Debug build with coverage
collection for non-performance tests.

Co-authored-by: chhwang <8018170+chhwang@users.noreply.github.com>
2026-02-11 02:35:46 +00:00

34 lines
1.2 KiB
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <mscclpp/errors.hpp>
#include "../framework.hpp"
// TODO: ErrorCode needs operator<< for EXPECT_EQ to work
// Using ASSERT_TRUE with manual comparisons as workaround
TEST(ErrorsTest, SystemError) {
mscclpp::Error error("test", mscclpp::ErrorCode::SystemError);
ASSERT_TRUE(error.getErrorCode() == mscclpp::ErrorCode::SystemError);
EXPECT_EQ(error.what(), std::string("test (mscclpp failure: SystemError)"));
}
TEST(ErrorsTest, InternalError) {
mscclpp::Error error("test", mscclpp::ErrorCode::InternalError);
ASSERT_TRUE(error.getErrorCode() == mscclpp::ErrorCode::InternalError);
EXPECT_EQ(error.what(), std::string("test (mscclpp failure: InternalError)"));
}
TEST(ErrorsTest, InvalidUsage) {
mscclpp::Error error("test", mscclpp::ErrorCode::InvalidUsage);
ASSERT_TRUE(error.getErrorCode() == mscclpp::ErrorCode::InvalidUsage);
EXPECT_EQ(error.what(), std::string("test (mscclpp failure: InvalidUsage)"));
}
TEST(ErrorsTest, Timeout) {
mscclpp::Error error("test", mscclpp::ErrorCode::Timeout);
ASSERT_TRUE(error.getErrorCode() == mscclpp::ErrorCode::Timeout);
EXPECT_EQ(error.what(), std::string("test (mscclpp failure: Timeout)"));
}