flavors 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # -*-perl-*-
  2. $description = "Test various flavors of make variable setting.";
  3. $details = "";
  4. open(MAKEFILE, "> $makefile");
  5. # The Contents of the MAKEFILE ...
  6. print MAKEFILE <<'EOF';
  7. foo = $(bar)
  8. bar = ${ugh}
  9. ugh = Hello
  10. all: multi ; @echo $(foo)
  11. multi: ; $(multi)
  12. x := foo
  13. y := $(x) bar
  14. x := later
  15. nullstring :=
  16. space := $(nullstring) $(nullstring)
  17. next: ; @echo $x$(space)$y
  18. define multi
  19. @echo hi
  20. @echo there
  21. endef
  22. ifdef BOGUS
  23. define
  24. @echo error
  25. endef
  26. endif
  27. EOF
  28. # END of Contents of MAKEFILE
  29. close(MAKEFILE);
  30. # TEST #1
  31. # -------
  32. &run_make_with_options($makefile, "", &get_logfile);
  33. $answer = "hi\nthere\nHello\n";
  34. &compare_output($answer, &get_logfile(1));
  35. # TEST #2
  36. # -------
  37. &run_make_with_options($makefile, "next", &get_logfile);
  38. $answer = "later foo bar\n";
  39. &compare_output($answer, &get_logfile(1));
  40. # TEST #3
  41. # -------
  42. &run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512);
  43. $answer = "$makefile:23: *** empty variable name. Stop.\n";
  44. &compare_output($answer, &get_logfile(1));
  45. 1;