test_premake.lua 676 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --
  2. -- tests/test_premake.lua
  3. -- Automated test suite for the Premake support functions.
  4. -- Copyright (c) 2008-2015 Jason Perkins and the Premake project
  5. --
  6. local suite = test.declare("premake")
  7. local p = premake
  8. --
  9. -- Setup
  10. --
  11. local wks, prj
  12. function suite.setup()
  13. wks = test.createWorkspace()
  14. location "MyLocation"
  15. prj = p.workspace.getproject(wks, 1)
  16. end
  17. --
  18. -- generate() tests
  19. --
  20. function suite.generate_OpensCorrectFile()
  21. p.generate(prj, ".prj", function () end)
  22. test.openedfile(path.join(os.getcwd(), "MyLocation/MyProject.prj"))
  23. end
  24. function suite.generate_ClosesFile()
  25. p.generate(prj, ".prj", function () end)
  26. test.closedfile(true)
  27. end