mirror of
https://github.com/mirror/make.git
synced 2025-03-04 23:01:01 +08:00
* tests/test_driver.pl: Remember error for "running" a directory.
* tests/scripts/features/errors: Check errors "running" a directory.
This commit is contained in:
parent
02a4c2913a
commit
57b13c8020
@ -73,4 +73,23 @@ if ($ERR_nonexe_file) {
|
||||
unlink($noexe);
|
||||
}
|
||||
|
||||
# Try failing by "running" a directory
|
||||
|
||||
if ($ERR_exe_dir) {
|
||||
mkdir('sd', 0775);
|
||||
|
||||
run_make_test(q!
|
||||
PATH := .
|
||||
all: ; sd
|
||||
!,
|
||||
'', "sd\n#MAKE#: sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#;3: all] Error 127", 512);
|
||||
|
||||
run_make_test(q!
|
||||
all: ; ./sd
|
||||
!,
|
||||
'', "./sd\n#MAKE#: ./sd: $ERR_exe_dir\n#MAKE#: *** [#MAKEFILE#;2: all] Error 127", 512);
|
||||
|
||||
rmdir('sd');
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -69,6 +69,7 @@ $ERR_no_such_file = undef;
|
||||
$ERR_read_only_file = undef;
|
||||
$ERR_unreadable_file = undef;
|
||||
$ERR_noexe_file = undef;
|
||||
$ERR_exe_dir = undef;
|
||||
|
||||
if (open(my $F, '<', 'file.none')) {
|
||||
print "Opened non-existent file! Skipping related tests.\n";
|
||||
@ -94,6 +95,13 @@ if ($? == 0) {
|
||||
$ERR_nonexe_file = "$!";
|
||||
}
|
||||
|
||||
$_ = `./.`;
|
||||
if ($? == 0) {
|
||||
print "Executed directory! Skipping related tests.\n";
|
||||
} else {
|
||||
$ERR_exe_dir = "$!";
|
||||
}
|
||||
|
||||
chmod(0000, 'file.out');
|
||||
if (open(my $F, '<', 'file.out')) {
|
||||
print "Opened unreadable file! Skipping related tests.\n";
|
||||
|
Loading…
Reference in New Issue
Block a user