tests: fix parser test with config file
authorMichael Wallner <mike@php.net>
Tue, 14 Jan 2020 14:18:51 +0000 (15:18 +0100)
committerMichael Wallner <mike@php.net>
Tue, 14 Jan 2020 14:18:51 +0000 (15:18 +0100)
configure.ac
libtest/include.am
support/example.cnf [deleted file]
support/example.cnf.in [new file with mode: 0644]
tests/libmemcached-1.0/parser.cc

index e4b57e5d6aa17c7ba7017a7af7efb2d24570082d..265ae8993ca5c2e06e3944148870682367b4a3c1 100644 (file)
@@ -380,6 +380,7 @@ AC_CONFIG_FILES([Makefile
                  libmemcached-1.0/configure.h
                  support/libmemcached.pc
                  support/libmemcached.spec
+                 support/example.cnf
                  ])
 AC_OUTPUT
 
index 77d199df11522647c4cacb4972d1df61a9dc01ed..a16154b0d7605440282c49271bf1bafe02171173 100644 (file)
@@ -183,6 +183,13 @@ endif
 TMP_DIR := tmp_chroot/etc tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
 
 BUILT_SOURCES+= $(TMP_DIR)
+BUILT_SOURCES+= tmp_chroot/support
+
+tmp_chroot/support: | tmp_chroot
+       @cp -R support tmp_chroot
+
+tmp_chroot:
+       @$(mkdir_p) $@
 
 $(TMP_DIR):
        @$(mkdir_p) $(TMP_DIR)
diff --git a/support/example.cnf b/support/example.cnf
deleted file mode 100644 (file)
index 70efaf1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# http://en.wikipedia.org/wiki/Consistent_hashing
---distribution=consistent
-
-# Store one additional copy on each node.
---number-of-replicas=2
---namespace="my_foo"
---server=localhost:11211
---server=localhost:11212
---server=localhost:11213
---verify-key
diff --git a/support/example.cnf.in b/support/example.cnf.in
new file mode 100644 (file)
index 0000000..70efaf1
--- /dev/null
@@ -0,0 +1,10 @@
+# http://en.wikipedia.org/wiki/Consistent_hashing
+--distribution=consistent
+
+# Store one additional copy on each node.
+--number-of-replicas=2
+--namespace="my_foo"
+--server=localhost:11211
+--server=localhost:11212
+--server=localhost:11213
+--verify-key
index d2be9a17208c044d4c67e89c8315e39349634ee7..064c5cfb9fc69f8d205c5d5cdc902497963871c4 100644 (file)
@@ -356,7 +356,7 @@ test_return_t libmemcached_check_configuration_with_filename_test(memcached_st*)
                     libmemcached_check_configuration(test_literal_param("--CONFIGURE-FILE=\"support/example.cnf\""), buffer, sizeof(buffer)),
                     buffer);
 
-  test_compare_hint(MEMCACHED_SUCCESS,
+  test_compare_hint(MEMCACHED_PARSE_ERROR,
                     libmemcached_check_configuration(test_literal_param("--CONFIGURE-FILE=support/example.cnf"), buffer, sizeof(buffer)),
                     buffer);