#                                                                    -*-perl-*-
$description = "Test the abspath functions.";

$details = "";

# Someone needs to rewrite this to be portable for Windows
#$port_type eq 'W32' and return -1;

run_make_test('
ifneq ($(realpath $(abspath .)),$(CURDIR))
  $(warning .: abs="$(abspath .)" real="$(realpath $(abspath .))" curdir="$(CURDIR)")
endif

ifneq ($(realpath $(abspath ./)),$(CURDIR))
  $(warning ./: abs="$(abspath ./)" real="$(realpath $(abspath ./))" curdir="$(CURDIR)")
endif

ifneq ($(realpath $(abspath .///)),$(CURDIR))
  $(warning .///: abs="$(abspath .///)" real="$(realpath $(abspath .///))" curdir="$(CURDIR)")
endif

ifneq ($(abspath C:/),C:/)
  $(warning C:/: abspath="$(abspath C:/)")
endif

ifneq ($(abspath C:///),C:/)
  $(warning C:///: abspath="$(abspath C:///)")
endif

ifneq ($(abspath C:/.),C:/)
  $(warning C:/.: abspath="$(abspath C:/.)")
endif

ifneq ($(abspath C:///.),C:/)
  $(warning C:///.: abspath="$(abspath C:///.)")
endif

ifneq ($(abspath C:/./),C:/)
  $(warning C:/./: abspath="$(abspath C:/./)")
endif

ifneq ($(abspath C:/.///),C:/)
  $(warning C:/.///: abspath="$(abspath C:/.///)")
endif

ifneq ($(abspath C:/..),C:/)
  $(warning C:/..: abspath="$(abspath C:/..)")
endif

ifneq ($(abspath C:///..),C:/)
  $(warning C:///..: abspath="$(abspath C:///..)")
endif

ifneq ($(abspath C:/../),C:/)
  $(warning C:/../: abspath="$(abspath C:/../)")
endif

ifneq ($(abspath C:/..///),C:/)
  $(warning C:/..///: abspath="$(abspath C:/..///)")
endif


ifneq ($(abspath C:/foo/bar/..),C:/foo)
  $(warning C:/foo/bar/..: abspath="$(abspath C:/foo/bar/..)")
endif

ifneq ($(abspath C:/foo/bar/../../../baz),C:/baz)
  $(warning C:/foo/bar/../../../baz: abspath="$(abspath C:/foo/bar/../../../baz)")
endif

ifneq ($(abspath C:/foo/bar/../ C:/..),C:/foo C:/)
  $(warning C:/foo/bar/../ C:/..: abspath="$(abspath C:/foo/bar/../ C:/..)")
endif


.PHONY: all
all: ; @:
',
'',
'');


# This tells the test driver that the perl test script executed properly.
1;
