test_deprecations.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --
  2. -- tests/api/test_table_kind.lua
  3. -- Tests the table API value type.
  4. -- Copyright (c) 2012-2014 Jason Perkins and the Premake project
  5. --
  6. local p = premake
  7. local suite = test.declare("api_deprecations")
  8. local api = p.api
  9. function suite.setup()
  10. workspace("MyWorkspace")
  11. configurations { "Debug", "Release" }
  12. end
  13. function suite.setsNewValue_whenOldValueIsRemovedViaWildcard_inSubConfig()
  14. local prj = project "MyProject"
  15. filter { "configurations:Debug" }
  16. flags { "Symbols" }
  17. filter { "*" }
  18. removeflags { "*" }
  19. -- test output.
  20. local cfg = test.getconfig(prj, "Debug", platform)
  21. test.isequal("Default", cfg.Symbols)
  22. end
  23. function suite.setsNewValue_whenOldValueIsRemovedInOtherConfig_inSubConfig()
  24. local prj = project "MyProject"
  25. flags { "Symbols" }
  26. filter { "configurations:Release" }
  27. removeflags { "*" }
  28. -- test output.
  29. test.isequal("On", test.getconfig(prj, "Debug", platform).Symbols)
  30. test.isequal("Default", test.getconfig(prj, "Release", platform).Symbols)
  31. end
  32. function suite.dontRemoveFlagIfSetThroughNewApi()
  33. local prj = project "MyProject"
  34. floatingpoint "Fast"
  35. removeflags "*"
  36. -- test output.
  37. local cfg = test.getconfig(prj, "Debug", platform)
  38. test.isequal("Fast", cfg.floatingpoint)
  39. end
  40. function suite.setsNewValue_whenOldValueFromParentIsRemovedInOtherConfig_inSubConfig()
  41. flags { "Symbols" }
  42. local prj = project "MyProject"
  43. filter { "configurations:Release" }
  44. removeflags { "*" }
  45. -- test output.
  46. test.isequal("On", test.getconfig(prj, "Debug", platform).Symbols)
  47. test.isequal("Default", test.getconfig(prj, "Release", platform).Symbols)
  48. end