public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ivan Orlov <ivan.orlov0322@gmail.com>
To: brendan.higgins@linux.dev, davidgow@google.com, rmoar@google.com
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] kunit: assert: export non-static functions
Date: Tue,  4 Jun 2024 13:32:03 +0100	[thread overview]
Message-ID: <20240604123204.10412-5-ivan.orlov0322@gmail.com> (raw)
In-Reply-To: <20240604123204.10412-1-ivan.orlov0322@gmail.com>

Export non-static functions from the assert.c file into the KUnit
namespace in order to be able to access them from the tests if
they are compiled as modules.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
---
 lib/kunit/assert.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/kunit/assert.c b/lib/kunit/assert.c
index 867aa5c4bccf..f394e4b8482f 100644
--- a/lib/kunit/assert.c
+++ b/lib/kunit/assert.c
@@ -38,6 +38,7 @@ void kunit_assert_print_msg(const struct va_format *message,
 	if (message->fmt)
 		string_stream_add(stream, "\n%pV", message);
 }
+EXPORT_SYMBOL_IF_KUNIT(kunit_assert_print_msg);
 
 void kunit_fail_assert_format(const struct kunit_assert *assert,
 			      const struct va_format *message,
@@ -112,6 +113,7 @@ VISIBLE_IF_KUNIT bool is_literal(const char *text, long long value)
 
 	return ret;
 }
+EXPORT_SYMBOL_IF_KUNIT(is_literal);
 
 void kunit_binary_assert_format(const struct kunit_assert *assert,
 				const struct va_format *message,
@@ -180,6 +182,7 @@ VISIBLE_IF_KUNIT bool is_str_literal(const char *text, const char *value)
 
 	return strncmp(text + 1, value, len - 2) == 0;
 }
+EXPORT_SYMBOL_IF_KUNIT(is_str_literal);
 
 void kunit_binary_str_assert_format(const struct kunit_assert *assert,
 				    const struct va_format *message,
@@ -232,6 +235,7 @@ void kunit_assert_hexdump(struct string_stream *stream,
 			string_stream_add(stream, " %02x ", buf1[i]);
 	}
 }
+EXPORT_SYMBOL_IF_KUNIT(kunit_assert_hexdump);
 
 void kunit_mem_assert_format(const struct kunit_assert *assert,
 			     const struct va_format *message,
-- 
2.34.1


  parent reply	other threads:[~2024-06-04 12:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 12:31 [PATCH 0/5] Reorganize string-stream and assert tests Ivan Orlov
2024-06-04 12:32 ` [PATCH 1/5] kunit: string-stream: export non-static functions Ivan Orlov
2024-06-08  9:20   ` David Gow
2024-06-09 19:01     ` Ivan Orlov
2024-06-04 12:32 ` [PATCH 2/5] kunit: kunit-test: Remove stub for log tests Ivan Orlov
2024-06-08  9:20   ` David Gow
2024-06-04 12:32 ` [PATCH 3/5] kunit: string-stream-test: Make it a separate module Ivan Orlov
2024-06-08  9:20   ` David Gow
2024-06-04 12:32 ` Ivan Orlov [this message]
2024-06-08  9:20   ` [PATCH 4/5] kunit: assert: export non-static functions David Gow
2024-06-09 19:05     ` Ivan Orlov
2024-06-04 12:32 ` [PATCH 5/5] kunit: Merge assertion test into kunit-test.c Ivan Orlov
2024-06-08  9:20   ` David Gow
2024-06-11 13:10     ` Ivan Orlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240604123204.10412-5-ivan.orlov0322@gmail.com \
    --to=ivan.orlov0322@gmail.com \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rmoar@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox