From 65f724614c1e8a2a4d7b76c6dc26eaf514c83975 Mon Sep 17 00:00:00 2001
From: Magnus Edenhill <magnus@edenhill.se>
Date: Tue, 13 Feb 2018 20:44:46 +0100
Subject: [PATCH] tests: skip tests on Win32 that rely on kafka-topics.sh

---
 tests/0011-produce_batch.c | 3 ++-
 tests/0026-consume_pause.c | 3 ++-
 tests/0048-partitioner.c   | 3 ++-
 tests/test.c               | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/0011-produce_batch.c b/tests/0011-produce_batch.c
index 1796d0a2..5c550a83 100644
--- a/tests/0011-produce_batch.c
+++ b/tests/0011-produce_batch.c
@@ -545,6 +545,7 @@ int main_0011_produce_batch (int argc, char **argv) {
         test_message_partitioner_wo_per_message_flag();
         test_single_partition();
         test_partitioner();
-        test_per_message_partition_flag();
+        if (test_can_create_topics(1))
+                test_per_message_partition_flag();
         return 0;
 }
diff --git a/tests/0026-consume_pause.c b/tests/0026-consume_pause.c
index eeb2ba80..697e0f92 100644
--- a/tests/0026-consume_pause.c
+++ b/tests/0026-consume_pause.c
@@ -221,7 +221,8 @@ static int consume_pause (void) {
 int main_0026_consume_pause (int argc, char **argv) {
         int fails = 0;
 
-        fails += consume_pause();
+        if (test_can_create_topics(1))
+                fails += consume_pause();
 
         if (fails > 0)
                 TEST_FAIL("See %d previous error(s)\n", fails);
diff --git a/tests/0048-partitioner.c b/tests/0048-partitioner.c
index 601cb4ef..46a05117 100644
--- a/tests/0048-partitioner.c
+++ b/tests/0048-partitioner.c
@@ -281,7 +281,8 @@ static void do_test_partitioners (void) {
 }
 
 int main_0048_partitioner (int argc, char **argv) {
-        do_test_partitioners();
+        if (test_can_create_topics(0))
+                do_test_partitioners();
 	do_test_failed_partitioning();
 	return 0;
 }
diff --git a/tests/test.c b/tests/test.c
index 9cff714e..98aa8c74 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -3468,7 +3468,7 @@ void test_report_add (struct test *test, const char *fmt, ...) {
 int test_can_create_topics (int skip) {
 #ifdef _MSC_VER
 	if (skip)
-		TEST_SKIP("Cannot create topics on Win32");
+		TEST_SKIP("Cannot create topics on Win32\n");
 	return 0;
 #else
 
-- 
2.42.0.windows.2

