-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathtest_premake.py
46 lines (38 loc) · 1.68 KB
/
test_premake.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import textwrap
from conan.test.utils.tools import TestClient
def test_premake_args():
c = TestClient()
conanfile = textwrap.dedent("""
from conan import ConanFile
from conan.tools.premake import Premake
class Pkg(ConanFile):
settings = "os", "compiler", "build_type", "arch"
def run(self, cmd, *args, **kwargs):
self.output.info(f"Running {cmd}!!")
def build(self):
premake = Premake(self)
premake.luafile = "myproject.lua"
premake.arguments = {"myarg": "myvalue"}
premake.configure()
""")
c.save({"conanfile.py": conanfile})
c.run("build . -s compiler=msvc -s compiler.version=193 -s compiler.runtime=dynamic")
assert "conanfile.py: Running premake5 --file=myproject.lua vs2022 --myarg=myvalue!!" in c.out
def test_premake_compile():
c = TestClient()
conanfile = textwrap.dedent("""
from conan import ConanFile
from conan.tools.premake import Premake
class Pkg(ConanFile):
settings = "os", "compiler", "build_type", "arch"
def run(self, cmd, *args, **kwargs):
self.output.info(f"Running {cmd}!!")
def build(self):
premake = Premake(self)
premake.luafile = "myproject.lua"
premake.arguments = {"myarg": "myvalue"}
premake.configure()
""")
c.save({"conanfile.py": conanfile})
c.run("build . -s compiler=msvc -s compiler.version=193 -s compiler.runtime=dynamic")
assert "conanfile.py: Running premake5 --file=myproject.lua vs2022 --myarg=myvalue!!" in c.out