2004-12-01 03:51:24 +08:00
|
|
|
# -*-perl-*-
|
|
|
|
$description = "Test the realpath functions.";
|
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
# Check the local directory's realpath
|
2004-12-01 03:51:24 +08:00
|
|
|
run_make_test('
|
|
|
|
ifneq ($(realpath .),$(CURDIR))
|
2017-04-18 03:37:57 +08:00
|
|
|
$(warning $(realpath .) != $(CURDIR))
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(realpath ./),$(CURDIR))
|
2017-04-18 03:37:57 +08:00
|
|
|
$(warning $(realpath ./) != $(CURDIR))
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(realpath .///),$(CURDIR))
|
2017-04-18 03:37:57 +08:00
|
|
|
$(warning $(realpath .///) != $(CURDIR))
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
.PHONY: all
|
|
|
|
all: ; @:
|
|
|
|
',
|
|
|
|
'', '');
|
2004-12-01 03:51:24 +08:00
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
# Find the realpath to the root of the partition
|
|
|
|
create_file('root.mk', 'all:;$(info $(realpath /))');
|
|
|
|
my $root = `$make_path -sf root.mk`;
|
|
|
|
unlink('root.mk');
|
|
|
|
chomp $root;
|
|
|
|
|
|
|
|
my $tst = '
|
|
|
|
ifneq ($(realpath /.),#ROOT#)
|
|
|
|
$(warning $(realpath /.) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath /./),#ROOT#)
|
|
|
|
$(warning $(realpath /./) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath /.///),#ROOT#)
|
|
|
|
$(warning $(realpath /.///) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath /..),#ROOT#)
|
|
|
|
$(warning $(realpath /..) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath /../),#ROOT#)
|
|
|
|
$(warning $(realpath /../) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath /..///),#ROOT#)
|
|
|
|
$(warning $(realpath /..///) != #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath . /..),$(CURDIR) #ROOT#)
|
|
|
|
$(warning $(realpath . /..) != $(CURDIR) #ROOT#)
|
2004-12-01 03:51:24 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: ; @:
|
2017-04-18 03:37:57 +08:00
|
|
|
';
|
|
|
|
$tst =~ s/#ROOT#/$root/g;
|
|
|
|
run_make_test($tst, '', '');
|
2006-04-01 14:36:40 +08:00
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
# On Windows platforms "//" means something special. So, don't do these tests
|
|
|
|
# there.
|
2006-04-01 14:36:40 +08:00
|
|
|
|
|
|
|
if ($port_type ne 'W32') {
|
2017-04-18 03:37:57 +08:00
|
|
|
$tst = '
|
|
|
|
ifneq ($(realpath ///),#ROOT#)
|
|
|
|
$(warning $(realpath ///) != #ROOT#)
|
2006-04-01 14:36:40 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath ///.),#ROOT#)
|
|
|
|
$(warning $(realpath ///.) != #ROOT#)
|
2006-04-01 14:36:40 +08:00
|
|
|
endif
|
|
|
|
|
2017-04-18 03:37:57 +08:00
|
|
|
ifneq ($(realpath ///..),#ROOT#)
|
|
|
|
$(warning $(realpath ///..) != #ROOT#)
|
2006-04-01 14:36:40 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all
|
2017-04-18 03:37:57 +08:00
|
|
|
all: ; @:';
|
|
|
|
$tst =~ s/#ROOT#/$root/g;
|
|
|
|
|
|
|
|
run_make_test($tst, '', '');
|
2006-04-01 14:36:40 +08:00
|
|
|
}
|
2004-12-01 03:51:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
# This tells the test driver that the perl test script executed properly.
|
|
|
|
1;
|