diff --git a/test/build/atk-build.sh b/test/build/atk-build.sh
index df881cbef73379f119080ede42369672d201af3f..58d190aefa231a35daf7473a3eeb84a92788a286 100755
--- a/test/build/atk-build.sh
+++ b/test/build/atk-build.sh
@@ -10,3 +10,5 @@ cd atk-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf atk-*
diff --git a/test/build/glib-build.sh b/test/build/glib-build.sh
index 2100052bede48bf054de289dfc4d42e9a863fb0b..92736f7015ebac41e80329912151ecefeac27de6 100755
--- a/test/build/glib-build.sh
+++ b/test/build/glib-build.sh
@@ -8,3 +8,5 @@ cd glib-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf glib-*
diff --git a/test/build/gnet-build.sh b/test/build/gnet-build.sh
index ec614b4bfa1c3552cb9e1025ce58b4b7eee35b3e..9752994a11ecd36ea46d908faede84be4dac7e66 100755
--- a/test/build/gnet-build.sh
+++ b/test/build/gnet-build.sh
@@ -10,3 +10,5 @@ cd gnet-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf gnet-*
diff --git a/test/build/gtk+-build.sh b/test/build/gtk+-build.sh
index d2b3d694a92c1042974796edda281f5dac09e525..8451a2d4e1ba16ff5fb136c170498f9c4d70a3c5 100755
--- a/test/build/gtk+-build.sh
+++ b/test/build/gtk+-build.sh
@@ -10,3 +10,5 @@ cd gtk+-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf gtk+-*
diff --git a/test/build/gtkspell-build.sh b/test/build/gtkspell-build.sh
index d1e56943fabd6fea38b081316e2e56eefce2e31d..009e1133ccb2105115db90f41208f4ca3883cccf 100755
--- a/test/build/gtkspell-build.sh
+++ b/test/build/gtkspell-build.sh
@@ -11,3 +11,5 @@ cd gtkspell-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf gtkspell-*
diff --git a/test/build/pango-build.sh b/test/build/pango-build.sh
index fd43c274b51d8a79f71efb1144daa980d202120e..4ed76f76ab5b1cbc453e3d715ae511d25a3e932d 100755
--- a/test/build/pango-build.sh
+++ b/test/build/pango-build.sh
@@ -10,3 +10,5 @@ cd pango-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf pango-*
diff --git a/test/build/pkgconfig-build.sh b/test/build/pkgconfig-build.sh
index 522a05716b5cafc018f228c1512a741f5635d2bc..ff418056fdbeabe2c6407b04a8b9f9d38d09cc53 100755
--- a/test/build/pkgconfig-build.sh
+++ b/test/build/pkgconfig-build.sh
@@ -8,3 +8,5 @@ cd pkgconfig-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf pkgconfig-*
diff --git a/test/build/pspell-build.sh b/test/build/pspell-build.sh
index 588c2f1a09a8cd0834220323b9151cfd9b3fd57f..57fb1dcbd1ee7b69e09be4654151e06ef646171c 100755
--- a/test/build/pspell-build.sh
+++ b/test/build/pspell-build.sh
@@ -8,3 +8,5 @@ cd pspell-*
 ./configure --prefix=$top
 make
 make install
+cd ..
+rm -rf pspell-*