build/pymake/tests/justprint-native.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/pymake/tests/justprint-native.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +## $(TOUCH) and $(RM) are native commands in pymake.
     1.5 +## Test that pymake --just-print just prints them.
     1.6 +
     1.7 +ifndef TOUCH
     1.8 +TOUCH = touch
     1.9 +endif
    1.10 +
    1.11 +all: 
    1.12 +	$(RM) justprint-native-file1.txt
    1.13 +	$(TOUCH) justprint-native-file2.txt
    1.14 +	$(MAKE) --just-print -f $(TESTPATH)/justprint-native.mk justprint_target > justprint.log
    1.15 +#       make --just-print shouldn't have actually done anything.
    1.16 +	test ! -f justprint-native-file1.txt
    1.17 +	test -f justprint-native-file2.txt
    1.18 +#	but it should have printed each command
    1.19 +	grep -q 'touch justprint-native-file1.txt' justprint.log
    1.20 +	grep -q 'rm -f justprint-native-file2.txt' justprint.log
    1.21 +	grep -q 'this string is "unlikely to appear in the log by chance"' justprint.log
    1.22 +#	tidy up
    1.23 +	$(RM) justprint-native-file2.txt
    1.24 +	@echo TEST-PASS
    1.25 +
    1.26 +justprint_target:
    1.27 +	$(TOUCH) justprint-native-file1.txt
    1.28 +	$(RM) justprint-native-file2.txt
    1.29 +	this string is "unlikely to appear in the log by chance"
    1.30 +
    1.31 +.PHONY: justprint_target

mercurial