[Pkg-libvirt-commits] [libguestfs] 04/156: test-charset-fidelity: allow to skip testing specific FSes

Hilko Bengen bengen at moszumanska.debian.org
Sat Aug 30 08:25:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 12e9151fb047ebdfb6d564a693a5c63bb5e410f9
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Wed May 7 15:45:07 2014 +0200

    test-charset-fidelity: allow to skip testing specific FSes
    
    Allow to skip testing the filesystem "foo" if the environment variable
    SKIP_TEST_CHARSET_FIDELITY_foo=1 is set. This way it possible to not
    test one or more filesystems without disabling the test altogether.
    
    (cherry picked from commit a651990fb12e2cc972e8a984378ec3d57bdce27c)
---
 tests/charsets/test-charset-fidelity.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/charsets/test-charset-fidelity.c b/tests/charsets/test-charset-fidelity.c
index c669b9d..d149a3f 100644
--- a/tests/charsets/test-charset-fidelity.c
+++ b/tests/charsets/test-charset-fidelity.c
@@ -33,6 +33,8 @@
 #include "guestfs.h"
 #include "guestfs-internal-frontend.h"
 
+static const char ourenvvar[] = "SKIP_TEST_CHARSET_FIDELITY";
+
 struct filesystem {
   const char *fs_name;          /* Name of filesystem. */
   int fs_case_insensitive;      /* True if filesystem is case insensitive. */
@@ -78,7 +80,7 @@ main (int argc, char *argv[])
   struct filesystem *fs;
 
   /* Allow this test to be skipped. */
-  str = getenv ("SKIP_TEST_CHARSET_FIDELITY");
+  str = getenv (ourenvvar);
   if (str && STREQ (str, "1")) {
     printf ("%s: test skipped because environment variable is set.\n",
             program_name);
@@ -113,6 +115,8 @@ static void
 test_filesystem (guestfs_h *g, const struct filesystem *fs)
 {
   const char *feature[] = { fs->fs_feature, NULL };
+  char envvar[sizeof (ourenvvar) + 20];
+  char *str;
 
   if (fs->fs_feature && !guestfs_feature_available (g, (char **) feature)) {
     printf ("skipped test of %s because %s feature not available\n",
@@ -120,6 +124,14 @@ test_filesystem (guestfs_h *g, const struct filesystem *fs)
     return;
   }
 
+  snprintf (envvar, sizeof envvar, "%s_%s", ourenvvar, fs->fs_name);
+  str = getenv (envvar);
+  if (str && STREQ (str, "1")) {
+    printf ("skipped test of %s because environment variable is set\n",
+            fs->fs_name);
+    return;
+  }
+
   printf ("testing charset fidelity on %s\n", fs->fs_name);
 
   make_filesystem (g, fs);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list