Exemplo n.º 1
0
def test_target():
    tgt = Target("foo.d")
    assert tgt.jsonify() == {
        "type": "fixed",
        "command": {},
        "outputs": ["foo.d"],
        "dependencies": {"type": "fixed", "targets": []},
        "implicits": {"type": "fixed", "targets": []},
    }

    json = dumps(tgt.jsonify())
    assert loads(json) == tgt.jsonify()
Exemplo n.º 2
0
def test_link_foo():
    mainObj = Target("main.o", "dmd -I$project/src -c $in -of$out", Target("src/main.d"))
    assert mainObj.jsonify() == {
        "type": "fixed",
        "command": {"type": "shell", "cmd": "dmd -I$project/src -c $in -of$out"},
        "outputs": ["main.o"],
        "dependencies": {
            "type": "fixed",
            "targets": [
                {
                    "type": "fixed",
                    "command": {},
                    "outputs": ["src/main.d"],
                    "dependencies": {"type": "fixed", "targets": []},
                    "implicits": {"type": "fixed", "targets": []},
                }
            ],
        },
        "implicits": {"type": "fixed", "targets": []},
    }