Module Name: src Committed By: sjg Date: Fri Mar 22 16:36:46 UTC 2013
Modified Files: src/usr.bin/make/unit-tests: Makefile test.exp Added Files: src/usr.bin/make/unit-tests: export-env Log Message: Add unit-test for export-env and gmake export To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/export-env cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/unit-tests/test.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.35 src/usr.bin/make/unit-tests/Makefile:1.36 --- src/usr.bin/make/unit-tests/Makefile:1.35 Fri Nov 9 19:08:28 2012 +++ src/usr.bin/make/unit-tests/Makefile Fri Mar 22 16:36:46 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2012/11/09 19:08:28 sjg Exp $ +# $NetBSD: Makefile,v 1.36 2013/03/22 16:36:46 sjg Exp $ # # Unit tests for make(1) # The main targets are: @@ -24,6 +24,7 @@ SUBFILES= \ error \ export \ export-all \ + export-env \ doterror \ dotwait \ forloop \ Index: src/usr.bin/make/unit-tests/test.exp diff -u src/usr.bin/make/unit-tests/test.exp:1.41 src/usr.bin/make/unit-tests/test.exp:1.42 --- src/usr.bin/make/unit-tests/test.exp:1.41 Fri Nov 9 19:08:28 2012 +++ src/usr.bin/make/unit-tests/test.exp Fri Mar 22 16:36:46 2013 @@ -43,6 +43,14 @@ UT_OK=good UT_OKDIR=unit-tests UT_TEST=export-all UT_ZOO=hoopie +make: +UT_TEST=export-env +UT_ENV=not-exported +UT_EXP=not-exported +env: +UT_TEST=export-env +UT_ENV=exported +UT_EXP=exported At first, I am happy and now: sad Added files: Index: src/usr.bin/make/unit-tests/export-env diff -u /dev/null src/usr.bin/make/unit-tests/export-env:1.1 --- /dev/null Fri Mar 22 16:36:46 2013 +++ src/usr.bin/make/unit-tests/export-env Fri Mar 22 16:36:46 2013 @@ -0,0 +1,24 @@ +# $Id: export-env,v 1.1 2013/03/22 16:36:46 sjg Exp $ + +# our normal .export, subsequent changes affect the environment +UT_TEST=this +.export UT_TEST +UT_TEST:= ${.PARSEFILE} + +# not so with .export-env +UT_ENV=exported +.export-env UT_ENV +UT_ENV=not-exported + +# gmake style export goes further; affects nothing but the environment +UT_EXP=before-export +export UT_EXP=exported +UT_EXP=not-exported + +all: + @echo make:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=${$v};@} + @echo env:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=$${$v};@} + + + +