diff options
author | aqua <aqua@iserlohn-fortress.net> | 2024-08-07 17:36:57 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2024-08-07 17:36:57 +0300 |
commit | dcd2f898af9d4efcb22417c19fa1b3abc8c548c5 (patch) | |
tree | 3ef0eaa4b9595bf90c733e8f196edd1c3f72c472 /tools/interface_generator/test | |
parent | Added interface_generator (diff) | |
download | kernel-dcd2f898af9d4efcb22417c19fa1b3abc8c548c5.tar.xz |
Added bazel rule for interface_generator
Diffstat (limited to 'tools/interface_generator/test')
-rw-r--r-- | tools/interface_generator/test/BUILD.bazel | 17 | ||||
-rw-r--r-- | tools/interface_generator/test/test_kstdio.cpp | 20 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tools/interface_generator/test/BUILD.bazel b/tools/interface_generator/test/BUILD.bazel new file mode 100644 index 0000000..5d6348d --- /dev/null +++ b/tools/interface_generator/test/BUILD.bazel @@ -0,0 +1,17 @@ +load("//:defs.bzl", "generate_interface") + +generate_interface( + name = "kstdio", + interface = "kstdio", + license = "//:LICENSE.md", +) + +cc_test( + name = "test_kstdio", + srcs = ["kstdio_mock.cpp", "test_kstdio.cpp"], + deps = [ + ":kstdio", + "@googletest//:gtest", + "@googletest//:gtest_main", + ], +) diff --git a/tools/interface_generator/test/test_kstdio.cpp b/tools/interface_generator/test/test_kstdio.cpp new file mode 100644 index 0000000..95540a4 --- /dev/null +++ b/tools/interface_generator/test/test_kstdio.cpp @@ -0,0 +1,20 @@ +#include "kstdio_mock.hpp" + +using ::testing::StrEq; + +class kstdioFixture : public ::testing::Test { +protected: + void + SetUp() + { + } + + kstdio_mock m_kstdio_mock; +}; + +TEST_F(kstdioFixture, printfCallsMock) +{ + EXPECT_CALL(m_kstdio_mock, printf(StrEq("hello world"))); + + kstdio_printf("hello world"); +} |