Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jgsogo committed Mar 1, 2023
1 parent 859706d commit c236928
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package_add_test_with_libs(unittest-quir-dialect

if (QSSC_WITH_MOCK_TARGET)
package_add_test_with_libs(unittest-qss-compiler
HAL/TargetRegistryTest.cpp
HAL/TargetSystemRegistryTest.cpp
# add other source files with test cases here

LIBRARIES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===- TargetRegistryTest.cpp -----------------------------------*- C++ -*-===//
//===- TargetSystemRegistryTest.cpp -----------------------------*- C++ -*-===//
//
// (C) Copyright IBM 2022.
//
Expand All @@ -9,30 +9,30 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// This file implements test cases for TargetRegistry.
/// This file implements test cases for TargetSystemRegistry.
///
//===----------------------------------------------------------------------===//

#include "gtest/gtest.h"

#include "HAL/TargetRegistry.h"
#include "HAL/TargetSystemRegistry.h"

namespace {

TEST(TargetRegistry, LookupMockTarget) {
TEST(TargetSystemRegistry, LookupMockTarget) {
// As a compiler developer, I want to register and lookup targets by name.

const char *mockName = "mock";

EXPECT_TRUE(qssc::hal::registry::targetExists(mockName));
EXPECT_TRUE(qssc::hal::registry::TargetSystemRegistry::pluginExists(mockName));

auto targetInfoOpt = qssc::hal::registry::lookupTargetInfo(mockName);
auto targetInfoOpt = qssc::hal::registry::TargetSystemRegistry::lookupPluginInfo(mockName);
EXPECT_TRUE(targetInfoOpt.hasValue());

auto *targetInfo = targetInfoOpt.getValue();

ASSERT_NE(targetInfo, nullptr);
EXPECT_EQ(targetInfo->getTargetName(), mockName);
EXPECT_EQ(targetInfo->getName(), mockName);
}

} // anonymous namespace

0 comments on commit c236928

Please sign in to comment.