mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-04 03:13:48 +00:00
48 lines
1.4 KiB
Text
48 lines
1.4 KiB
Text
|
# -*-perl-*-
|
||
|
|
||
|
$description = "Test the -L option.";
|
||
|
|
||
|
$details = "Verify that symlink handling with and without -L works properly.";
|
||
|
|
||
|
# Only run these tests if the system sypports symlinks
|
||
|
if (eval { symlink("",""); 1 }) {
|
||
|
|
||
|
# Set up a symlink sym -> dep
|
||
|
# We'll make both dep and targ older than sym
|
||
|
$pwd =~ m%/([^/]+)$%;
|
||
|
$dirnm = $1;
|
||
|
&utouch(-10, 'dep');
|
||
|
&utouch(-5, 'targ');
|
||
|
symlink("../$dirnm/dep", 'sym');
|
||
|
|
||
|
# Without -L, nothing should happen
|
||
|
# With -L, it should update targ
|
||
|
run_make_test('targ: sym ; @echo make $@ from $<', '',
|
||
|
"#MAKE#: `targ' is up to date.");
|
||
|
run_make_test(undef, '-L', "make targ from sym");
|
||
|
|
||
|
# Now update dep; in all cases targ should be out of date.
|
||
|
&touch('dep');
|
||
|
run_make_test(undef, '', "make targ from sym");
|
||
|
run_make_test(undef, '-L', "make targ from sym");
|
||
|
|
||
|
# Now update targ; in all cases targ should be up to date.
|
||
|
&touch('targ');
|
||
|
run_make_test(undef, '', "#MAKE#: `targ' is up to date.");
|
||
|
run_make_test(undef, '-L', "#MAKE#: `targ' is up to date.");
|
||
|
|
||
|
# Add in a new link between sym and dep. Be sure it's newer than targ.
|
||
|
sleep(1);
|
||
|
rename('dep', 'dep1');
|
||
|
symlink('dep1', 'dep');
|
||
|
|
||
|
# Without -L, nothing should happen
|
||
|
# With -L, it should update targ
|
||
|
run_make_test(undef, '', "#MAKE#: `targ' is up to date.");
|
||
|
run_make_test(undef, '-L', "make targ from sym");
|
||
|
|
||
|
rmfiles('targ', 'dep', 'sym', 'dep1');
|
||
|
}
|
||
|
|
||
|
1;
|