haskell: Combine tests to reduce number of launches.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 30 Nov 2010 14:10:40 +0000 (14:10 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 30 Nov 2010 14:10:40 +0000 (14:10 +0000)
.gitignore
haskell/Guestfs010Basic.hs [moved from haskell/Guestfs050LVCreate.hs with 93% similarity]
haskell/Guestfs010Launch.hs [deleted file]
haskell/Makefile.am

index 21ddd26..ac540a2 100644 (file)
@@ -113,8 +113,7 @@ guestfsd-in-wine.log
 haskell/Bindtests
 haskell/Bindtests.hs
 haskell/Guestfs005Load
 haskell/Bindtests
 haskell/Bindtests.hs
 haskell/Guestfs005Load
-haskell/Guestfs010Launch
-haskell/Guestfs050LVCreate
+haskell/Guestfs010Basic
 haskell/Guestfs.hs
 *.hi
 html/guestfish.1.html
 haskell/Guestfs.hs
 *.hi
 html/guestfish.1.html
similarity index 93%
rename from haskell/Guestfs050LVCreate.hs
rename to haskell/Guestfs010Basic.hs
index 502f6b2..6454d69 100644 (file)
@@ -1,5 +1,5 @@
 {- libguestfs Haskell bindings
 {- libguestfs Haskell bindings
-   Copyright (C) 2009 Red Hat Inc.
+   Copyright (C) 2009-2010 Red Hat Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 -}
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 -}
 
-module Guestfs050LVCreate where
+module Guestfs010Basic where
 import qualified Guestfs
 import System.IO (openFile, hClose, hSetFileSize, IOMode(WriteMode))
 import System.Posix.Files (removeLink)
 import qualified Guestfs
 import System.IO (openFile, hClose, hSetFileSize, IOMode(WriteMode))
 import System.Posix.Files (removeLink)
@@ -36,6 +36,4 @@ main = do
 
   -- Guestfs.lvs g and check returned list
 
 
   -- Guestfs.lvs g and check returned list
 
-  Guestfs.sync g
-
   removeLink "test.img"
   removeLink "test.img"
diff --git a/haskell/Guestfs010Launch.hs b/haskell/Guestfs010Launch.hs
deleted file mode 100644 (file)
index 930d666..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-{- libguestfs Haskell bindings
-   Copyright (C) 2009 Red Hat Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--}
-
-module Guestfs010Launch where
-import qualified Guestfs
-import System.IO (openFile, hClose, hSetFileSize, IOMode(WriteMode))
-import System.Posix.Files (removeLink)
-
-main = do
-  g <- Guestfs.create
-  fd <- openFile "test.img" WriteMode
-  hSetFileSize fd (500 * 1024 * 1024)
-  hClose fd
-  Guestfs.add_drive g "test.img"
-  Guestfs.launch g
-  removeLink "test.img"
index 2524617..4406712 100644 (file)
@@ -32,13 +32,13 @@ TESTS_ENVIRONMENT = \
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
        $(VG)
 
        LIBGUESTFS_PATH=$(top_builddir)/appliance \
        $(VG)
 
-TESTS = run-bindtests Guestfs005Load Guestfs010Launch Guestfs050LVCreate
+TESTS = run-bindtests Guestfs005Load Guestfs010Basic
 
 check_DATA = Bindtests
 
 GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs
 
 
 check_DATA = Bindtests
 
 GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs
 
-all_targets = Bindtests Guestfs005Load Guestfs010Launch Guestfs050LVCreate
+all_targets = Bindtests Guestfs005Load Guestfs010Basic
 $(all_targets): $(top_builddir)/src/libguestfs.la
 
 all: $(all_targets)
 $(all_targets): $(top_builddir)/src/libguestfs.la
 
 all: $(all_targets)
@@ -52,12 +52,9 @@ Bindtests: Bindtests.hs Guestfs.o
 Guestfs005Load: Guestfs005Load.hs Guestfs.o
        $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
 
 Guestfs005Load: Guestfs005Load.hs Guestfs.o
        $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
 
-Guestfs010Launch: Guestfs010Launch.hs Guestfs.o
+Guestfs010Basic: Guestfs010Basic.hs Guestfs.o
        $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
 
        $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
 
-Guestfs050LVCreate: Guestfs050LVCreate.hs Guestfs.o
-       $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
-
-CLEANFILES = $(all_targets) *~ Guestfs.o
+CLEANFILES = $(all_targets) *~ *.hi *.o
 
 endif
 
 endif