test/make/TestMakeBase.gmk
changeset 44027 3a3050924db2
parent 42134 bbcdb49521b1
child 47217 72e3ae9a25eb
equal deleted inserted replaced
44026:a46c32199211 44027:3a3050924db2
     1 #
     1 #
     2 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
   177 	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value1 $(VARDEP_TARGET_FILE)
   177 	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value1 $(VARDEP_TARGET_FILE)
   178 	$(PRINTF) "Expecting value1: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
   178 	$(PRINTF) "Expecting value1: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
   179 	test "some string value1" = "`$(CAT) $(VARDEP_DIR)/target-file`"
   179 	test "some string value1" = "`$(CAT) $(VARDEP_DIR)/target-file`"
   180 	test -e $(VARDEP_FLAG_FILE)
   180 	test -e $(VARDEP_FLAG_FILE)
   181         #
   181         #
   182         # Make the target file again and verify that the value is updated with 
   182         # Make the target file again and verify that the value is updated with
   183         # the new value
   183         # the new value
   184         #
   184         #
   185 	$(SLEEP_ON_MAC)
   185 	$(SLEEP_ON_MAC)
   186 	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE)
   186 	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE)
   187 	$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
   187 	$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
   339     ../../baz/banan/kung, \
   339     ../../baz/banan/kung, \
   340     RelativePath, \
   340     RelativePath, \
   341 ))
   341 ))
   342 
   342 
   343 ################################################################################
   343 ################################################################################
       
   344 # Test ParseKeywordVariable
       
   345 
       
   346 KWBASE := APA=banan;GURKA=tomat;COUNT=1%202%203%204%205;SUM=1+2+3+4+5;MANY_WORDS=I have the best words.
       
   347 
       
   348 $(eval $(call ParseKeywordVariable, KWBASE, \
       
   349     KEYWORDS := APA GURKA SUM, \
       
   350     STRING_KEYWORDS := COUNT MANY_WORDS, \
       
   351 ))
       
   352 
       
   353 $(eval $(call assert-equals, \
       
   354     $(KWBASE_APA), \
       
   355     banan, \
       
   356     ParseKeywordVariable failed to parse APA, \
       
   357 ))
       
   358 
       
   359 $(eval $(call assert-equals, \
       
   360     $(KWBASE_COUNT), \
       
   361     1 2 3 4 5, \
       
   362     ParseKeywordVariable failed to parse COUNT, \
       
   363 ))
       
   364 
       
   365 $(eval $(call assert-equals, \
       
   366     $(KWBASE_SUM), \
       
   367     1+2+3+4+5, \
       
   368     ParseKeywordVariable failed to parse SUM, \
       
   369 ))
       
   370 
       
   371 $(eval $(call assert-equals, \
       
   372     $(KWBASE_MANY_WORDS), \
       
   373     I have the best words., \
       
   374     ParseKeywordVariable failed to parse MANY_WORDS, \
       
   375 ))
       
   376 
       
   377 # Simulate variable set from command line by using "override"
       
   378 override KWBASE_WEIRD_GURKA := paprika
       
   379 KWBASE_WEIRD := ;;APA=banan;;;GURKA=apelsin;APA=skansen;;
       
   380 
       
   381 $(eval $(call ParseKeywordVariable, KWBASE_WEIRD, \
       
   382     KEYWORDS := APA GURKA SUM, \
       
   383     STRING_KEYWORDS := COUNT, \
       
   384 ))
       
   385 
       
   386 $(eval $(call assert-equals, \
       
   387     $(KWBASE_WEIRD_APA), \
       
   388     skansen, \
       
   389     ParseKeywordVariable failed to overwrite APA, \
       
   390 ))
       
   391 
       
   392 $(eval $(call assert-equals, \
       
   393     $(KWBASE_WEIRD_GURKA), \
       
   394     paprika, \
       
   395     ParseKeywordVariable failed to preserve GURKA, \
       
   396 ))
       
   397 
       
   398 ################################################################################
   344 
   399 
   345 all: $(TEST_TARGETS)
   400 all: $(TEST_TARGETS)