tests: cleanup object-locking test

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>
This commit is contained in:
Martin Kletzander 2014-02-13 15:20:04 +01:00
parent ef8f4761f2
commit db272ebf9d
3 changed files with 13 additions and 15 deletions

6
.gitignore vendored
View File

@ -149,9 +149,9 @@
/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

View 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

View 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 (