summaryrefslogtreecommitdiff
path: root/t/buildsystems/buildsystem_tests
diff options
context:
space:
mode:
Diffstat (limited to 't/buildsystems/buildsystem_tests')
-rwxr-xr-xt/buildsystems/buildsystem_tests34
1 files changed, 32 insertions, 2 deletions
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index c432d3e..7e9b4bf 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use Test::More tests => 230;
+use Test::More tests => 236;
use strict;
use warnings;
@@ -338,6 +338,36 @@ test_autoselection("cmake",
test => "makefile", install => "makefile", clean => "makefile" }, %tmp);
cleandir $tmpdir;
+### Test Buildsystem::rmdir_builddir()
+sub do_rmdir_builddir {
+ my $builddir=shift;
+ my $system;
+ $system = $BS_CLASS->new(builddir => $builddir, sourcedir => $tmpdir);
+ $system->mkdir_builddir();
+ $system->rmdir_builddir();
+}
+
+$builddir = "$tmpdir/builddir";
+do_rmdir_builddir($builddir);
+ok ( ! -e $builddir, "testing rmdir_builddir() 1: builddir parent '$builddir' deleted" );
+ok ( -d $tmpdir, "testing rmdir_builddir() 1: sourcedir '$tmpdir' remains" );
+
+$builddir = "$tmpdir/bld";
+do_rmdir_builddir("$builddir/dir");
+ok ( ! -e $builddir, "testing rmdir_builddir() 2: builddir parent '$builddir' deleted" );
+ok ( -d $tmpdir, "testing rmdir_builddir() 2: sourcedir '$tmpdir' remains" );
+
+$builddir = "$tmpdir/bld";
+mkdir "$builddir";
+touch "$builddir/afile";
+mkdir "$builddir/dir";
+touch "$builddir/dir/afile2";
+do_rmdir_builddir("$builddir/dir");
+ok ( ! -e "$builddir/dir", "testing rmdir_builddir() 3: builddir '$builddir/dir' not empty, but deleted" );
+ok ( -d $builddir, "testing rmdir_builddir() 3: builddir parent '$builddir' not empty, remains" );
+
+cleandir $tmpdir;
+
### Test buildsystems_init() and commandline/env argument handling
sub get_load_bs_source {
my ($system, $step)=@_;
@@ -433,7 +463,7 @@ sub dh_auto_do_autoconf {
dh_auto_do_autoconf('autoconf');
dh_auto_do_autoconf('autoconf', 'bld/dir', configure_args => [ "--extra-autoconf-configure-arg" ]);
-ok ( ! -e 'autoconf/bld', "autoconf/bld got deleted too" );
+ok ( ! -e 'bld', "bld got deleted too" );
END {
system("rm", "-rf", $tmpdir);