]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: cleanup object-locking test
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Feb 2014 14:20:04 +0000 (15:20 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 18 Mar 2014 09:20:49 +0000 (10:20 +0100)
When ran, cil is throwing out some errors and warnings for obsolete
'or' unused variables and wrong module name (it should not contain a
hyphen; hence the rename).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
.gitignore
tests/Makefile.am
tests/objectlocking.ml [moved from tests/object-locking.ml with 98% similarity]

index 027c2032466c313984fe361e2287d27d7d10ff9f..0513a339a391b0f3ebd21c097102480ab3819454 100644 (file)
 /tests/*test
 !/tests/*schematest
 !/tests/virt-aa-helper-test
-/tests/object-locking
-/tests/object-locking-files.txt
-/tests/object-locking.cm[ix]
+/tests/objectlocking
+/tests/objectlocking-files.txt
+/tests/objectlocking.cm[ix]
 /tests/reconnect
 /tests/ssh
 /tests/test_conf
index 17454694029e15369f5fa7370da043a4c339b8ed..f80e7ad3209dcd763aaf34714c3b66c929b6c2e1 100644 (file)
@@ -228,7 +228,7 @@ test_programs += vmwarevertest
 endif WITH_VMWARE
 
 if WITH_CIL
-test_programs += object-locking
+test_programs += objectlocking
 endif WITH_CIL
 
 if WITH_YAJL
@@ -1016,21 +1016,21 @@ CILOPTINCS =
 CILOPTPACKAGES = -package unix,str,cil
 CILOPTLIBS = -linkpkg
 
-object_locking_SOURCES = object-locking.ml
+object_locking_SOURCES = objectlocking.ml
 
 %.cmx: %.ml
        ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) -c $<
 
-object-locking: object-locking.cmx object-locking-files.txt
+objectlocking: objectlocking.cmx objectlocking-files.txt
        ocamlfind ocamlopt $(CILOPTFLAGS) $(CILOPTINCS) $(CILOPTPACKAGES) \
          $(CILOPTLIBS) $< -o $@
 
-object-locking-files.txt:
+objectlocking-files.txt:
        find $(top_builddir)/src/ -name '*.i' > $@
 
 else ! WITH_CIL
-EXTRA_DIST += object-locking.ml
+EXTRA_DIST += objectlocking.ml
 endif ! WITH_CIL
 
 CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \
-       object-locking-files.txt
+       objectlocking-files.txt
similarity index 98%
rename from tests/object-locking.ml
rename to tests/objectlocking.ml
index 009b8f8f453e663504ba1f79fb309c545864b80b..247673190ee21f5f61f113b3bdbcad8ba328883c 100644 (file)
@@ -1,7 +1,7 @@
 (*
  * Analyse libvirt driver API methods for mutex locking mistakes
  *
- * Copyright (C) 2008-2010, 2012 Red Hat, Inc.
+ * Copyright (C) 2008-2010, 2012, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -623,7 +623,7 @@ module L = DF.ForwardsDataFlow(Locking)
 
 let () =
   (* Read the list of files from "libvirt-files". *)
-  let files = input_file "object-locking-files.txt" in
+  let files = input_file "objectlocking-files.txt" in
 
   (* Load & parse each input file. *)
   let files =
@@ -645,7 +645,6 @@ let () =
   let driverVars = List.filter (
     function
     | GVar (varinfo, initinfo, loc) -> (* global variable *)
-      let name = varinfo.vname in
       if isDriverTable varinfo then
         true
       else
@@ -656,7 +655,6 @@ let () =
   let driverVarFuncs = List.map (
     function
     | GVar (varinfo, initinfo, loc) -> (* global variable *)
-      let name = varinfo.vname in
       if isDriverTable varinfo then
         getDriverFuncNames initinfo
       else
@@ -752,7 +750,7 @@ let () =
                                    IH.find Locking.stmtStartData st.sid in
                           let leakDrivers = not (VS.is_empty ld) in
                           let leakObjects = not (VS.is_empty lo) in
-                          leakDrivers or leakObjects
+                          leakDrivers || leakObjects
                      ) exitPoints in
 
          let mistakes = List.filter (
@@ -767,7 +765,7 @@ let () =
 
                           let deadLocked = (List.length dead) > 0 in
 
-                          lockDriverOrdering or lockObjectOrdering or useDriverUnlocked or useObjectUnlocked or deadLocked
+                          lockDriverOrdering || lockObjectOrdering || useDriverUnlocked || useObjectUnlocked || deadLocked
                      ) fundec.sallstmts in
 
          if (List.length leaks) > 0 || (List.length mistakes) > 0 then (