Home | History | Annotate | Line # | Download | only in unit-tests
      1  1.4  rillig # $NetBSD: varmod-path.mk,v 1.4 2023/05/10 15:53:32 rillig Exp $
      2  1.1  rillig #
      3  1.2  rillig # Tests for the :P variable modifier, which looks up the path for a given
      4  1.2  rillig # target.
      5  1.3  rillig #
      6  1.3  rillig # The phony target does not have a corresponding path, therefore ... oops,
      7  1.3  rillig # as of 2020-08-23 it is nevertheless resolved to a path.  This is probably
      8  1.3  rillig # unintended.
      9  1.3  rillig #
     10  1.4  rillig # In this test, the real target is located in a subdirectory, and its full
     11  1.4  rillig # path is returned.  If it had been in the current directory, the difference
     12  1.4  rillig # between its path and its name would not be visible.
     13  1.3  rillig #
     14  1.4  rillig # The enoent target does not exist, therefore the plain name of the target
     15  1.4  rillig # is returned.
     16  1.3  rillig 
     17  1.3  rillig .MAIN: all
     18  1.3  rillig 
     19  1.3  rillig _!=	rm -rf varmod-path.subdir
     20  1.3  rillig _!=	mkdir varmod-path.subdir
     21  1.3  rillig _!=	> varmod-path.subdir/varmod-path.phony
     22  1.3  rillig _!=	> varmod-path.subdir/varmod-path.real
     23  1.3  rillig 
     24  1.4  rillig # To have an effect, this .PATH declaration must be processed after the
     25  1.4  rillig # directory has been created.
     26  1.3  rillig .PATH: varmod-path.subdir
     27  1.3  rillig 
     28  1.3  rillig varmod-path.phony: .PHONY
     29  1.3  rillig varmod-path.real:
     30  1.1  rillig 
     31  1.3  rillig all: varmod-path.phony varmod-path.real
     32  1.3  rillig 	@echo ${varmod-path.phony:P}
     33  1.3  rillig 	@echo ${varmod-path.real:P}
     34  1.3  rillig 	@echo ${varmod-path.enoent:P}
     35  1.1  rillig 
     36  1.3  rillig .END:
     37  1.3  rillig 	@rm -rf varmod-path.subdir
     38