summaryrefslogtreecommitdiff
path: root/t/buildsystems/buildsystem_tests
diff options
context:
space:
mode:
authorModestas Vainius <modestas@vainius.eu>2009-06-12 19:57:35 +0300
committerModestas Vainius <modestas@vainius.eu>2009-06-13 17:03:26 +0300
commiteebf685de35be08519fa6282fd5eff4a5dc37229 (patch)
tree16abd796672083f8d0708351bbbb8c0138628ba8 /t/buildsystems/buildsystem_tests
parentb709661d78cf519739b7ed2bd2d69599c3c31459 (diff)
Drop special handling for build directory ./path.
Now build directory is always relative to the top directory (including default build directory) regardless what source directory is. However, if the build directory is not specified, it defaults to the source directory (aka in source building). Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Diffstat (limited to 't/buildsystems/buildsystem_tests')
-rwxr-xr-xt/buildsystems/buildsystem_tests41
1 files changed, 21 insertions, 20 deletions
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index a2b451a9..27d7b943 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -126,24 +126,24 @@ $bs = $BS_CLASS->new(builddir => undef, sourcedir => "autoconf");
%tmp = (
"get_sourcedir()" => "autoconf",
"get_sourcepath(a/b)" => "autoconf/a/b",
- "get_builddir()" => "autoconf/$default_builddir",
- "get_buildpath()" => "autoconf/$default_builddir",
- "get_buildpath(a/b)" => "autoconf/$default_builddir/a/b",
- "get_source_rel2builddir()" => "..",
- "get_source_rel2builddir(a/b)" => "../a/b",
- "get_build_rel2sourcedir()" => "$default_builddir",
- "get_build_rel2sourcedir(a/b)" => "$default_builddir/a/b",
+ "get_builddir()" => "$default_builddir",
+ "get_buildpath()" => "$default_builddir",
+ "get_buildpath(a/b)" => "$default_builddir/a/b",
+ "get_source_rel2builddir()" => "../autoconf",
+ "get_source_rel2builddir(a/b)" => "../autoconf/a/b",
+ "get_build_rel2sourcedir()" => "../$default_builddir",
+ "get_build_rel2sourcedir(a/b)" => "../$default_builddir/a/b",
);
test_buildsystem_paths_api($bs, "default builddir, sourcedir=autoconf", \%tmp);
-# Enforced out of source tree building
+# Enforce "hard" out of source tree building
# sourcedir=builddir=autoconf hence default builddir is implied
-$bs = $BS_CLASS->new(builddir => "./autoconf", sourcedir => "autoconf/");
+$bs = $BS_CLASS->new(builddir => "autoconf", sourcedir => "autoconf/");
$bs->enforce_out_of_source_building();
-test_buildsystem_paths_api($bs, "out of source enforced, sourcedir=autoconf/", \%tmp);
+test_buildsystem_paths_api($bs, "hard out of source enforced, sourcedir=builddir", \%tmp);
# sourcedir=autoconf (builddir should be dropped)
-$bs = $BS_CLASS->new(builddir => ".", sourcedir => "autoconf");
+$bs = $BS_CLASS->new(builddir => "autoconf", sourcedir => "autoconf");
%tmp = (
"get_sourcedir()" => "autoconf",
"get_sourcepath(a/b)" => "autoconf/a/b",
@@ -157,13 +157,18 @@ $bs = $BS_CLASS->new(builddir => ".", sourcedir => "autoconf");
);
test_buildsystem_paths_api($bs, "no builddir, sourcedir=autoconf", \%tmp);
+# Enforce "soft" out of source tree building when
+# sourcedir=builddir=autoconf hence builddir should be dropped.
+$bs->enforce_out_of_source_building("autoconf");
+test_buildsystem_paths_api($bs, "soft out of source enforced, sourcedir=builddir", \%tmp);
+
# builddir=bld/dir, sourcedir=autoconf. Should be the same as sourcedir=autoconf.
$bs = $BS_CLASS->new(builddir => "bld/dir", sourcedir => "autoconf");
$bs->enforce_in_source_building();
test_buildsystem_paths_api($bs, "in source enforced, sourcedir=autoconf", \%tmp);
-# builddir=../bld/dir (relative to the sourcedir)
-$bs = $BS_CLASS->new(builddir => "../bld/dir/", sourcedir => "autoconf");
+# builddir=../bld/dir (relative to the curdir)
+$bs = $BS_CLASS->new(builddir => "bld/dir/", sourcedir => "autoconf");
%tmp = (
"get_sourcedir()" => "autoconf",
"get_sourcepath(a/b)" => "autoconf/a/b",
@@ -177,10 +182,6 @@ $bs = $BS_CLASS->new(builddir => "../bld/dir/", sourcedir => "autoconf");
);
test_buildsystem_paths_api($bs, "builddir=../bld/dir, sourcedir=autoconf", \%tmp);
-# Builddir relative to the pwd (same path as above).
-$bs = $BS_CLASS->new(builddir => "./bld/dir", sourcedir => "autoconf");
-test_buildsystem_paths_api($bs, "builddir=./bld/dir, sourcedir=autoconf", \%tmp);
-
### Test if all buildsystems can be loaded
@bs = load_all_buildsystems([ $INC[0] ]);
@tmp = map { $_->NAME() } @bs;
@@ -220,7 +221,7 @@ $tmpdir = tempdir("tmp.XXXXXX");
$builddir = "$tmpdir/builddir";
mkdir $builddir;
%tmp = (
- builddir => 'builddir',
+ builddir => "$tmpdir/builddir",
sourcedir => $tmpdir
);
@@ -349,7 +350,7 @@ if (defined \$bs) {
EOF
}
-is_deeply( process_stdout("DH_AUTO_OPTIONS='--builddirectory=bld\\ dir --sourcedirectory autoconf' $^X -- -",
+is_deeply( process_stdout("DH_AUTO_OPTIONS='--builddirectory=autoconf/bld\\ dir --sourcedirectory autoconf' $^X -- -",
get_load_bs_source(undef, "configure")),
[ 'NAME=autoconf', 'builddir=autoconf/bld dir', 'makecmd=make', 'sourcedir=autoconf' ],
"dh_auto_options w/space, autoconf autoselection and sourcedir/builddir" );
@@ -375,7 +376,7 @@ sub dh_auto_do_autoconf {
if ($builddir) {
push @dh_auto_args, "-b", $builddir;
$dh_auto_str .= " -b $builddir";
- $buildpath .= "/$builddir";
+ $buildpath = $builddir;
}
my $do_dh_auto = sub {