2004-11-30 19:51:24 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
$description = "Test the abspath functions.";
|
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
2017-04-17 19:37:57 +00:00
|
|
|
# Someone needs to rewrite this to be portable for Windows
|
|
|
|
$port_type eq 'W32' and return -1;
|
|
|
|
|
2004-11-30 19:51:24 +00:00
|
|
|
run_make_test('
|
|
|
|
ifneq ($(realpath $(abspath .)),$(CURDIR))
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning .: abs="$(abspath .)" real="$(realpath $(abspath .))" curdir="$(CURDIR)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(realpath $(abspath ./)),$(CURDIR))
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning ./: abs="$(abspath ./)" real="$(realpath $(abspath ./))" curdir="$(CURDIR)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(realpath $(abspath .///)),$(CURDIR))
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning .///: abs="$(abspath .///)" real="$(realpath $(abspath .///))" curdir="$(CURDIR)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /: abspath="$(abspath /)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath ///),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning ///: abspath="$(abspath ///)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /.),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /.: abspath="$(abspath /.)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath ///.),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning ///.: abspath="$(abspath ///.)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /./),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /./: abspath="$(abspath /./)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /.///),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /.///: abspath="$(abspath /.///)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /..),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /..: abspath="$(abspath /..)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath ///..),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning ///..: abspath="$(abspath ///..)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /../),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /../: abspath="$(abspath /../)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /..///),/)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /..///: abspath="$(abspath /..///)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(abspath /foo/bar/..),/foo)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /foo/bar/..: abspath="$(abspath /foo/bar/..)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /foo/bar/../../../baz),/baz)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /foo/bar/../../../baz: abspath="$(abspath /foo/bar/../../../baz)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(abspath /foo/bar/../ /..),/foo /)
|
2005-08-29 14:11:00 +00:00
|
|
|
$(warning /foo/bar/../ /..: abspath="$(abspath /foo/bar/../ /..)")
|
2004-11-30 19:51:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: ; @:
|
|
|
|
',
|
|
|
|
'',
|
|
|
|
'');
|
|
|
|
|
|
|
|
|
|
|
|
# This tells the test driver that the perl test script executed properly.
|
|
|
|
1;
|