Exemple #1
0
def test_skip_target_from_codegen():
    parser = argparse.ArgumentParser()
    generate_target_args(parser)
    parsed, left = parser.parse_known_args([
        "--target=cmsis-nn, c", "--target-cmsis-nn-from_device=1",
        "--target-c-mcpu=cortex-m55"
    ])
    assert left == ["--target-cmsis-nn-from_device=1"]
    assert reconstruct_target_args(parsed) == {"c": {"mcpu": "cortex-m55"}}
Exemple #2
0
def test_include_known_codegen():
    parser = argparse.ArgumentParser()
    generate_target_args(parser)
    parsed, _ = parser.parse_known_args([
        "--target=cmsis-nn,c", "--target-cmsis-nn-mcpu=cortex-m55",
        "--target-c-mcpu=cortex-m55"
    ])
    assert reconstruct_target_args(parsed) == {
        "c": {
            "mcpu": "cortex-m55"
        },
        "cmsis-nn": {
            "mcpu": "cortex-m55"
        },
    }
Exemple #3
0
def test_mapping_target_args():
    parser = argparse.ArgumentParser()
    generate_target_args(parser)
    parsed, _ = parser.parse_known_args(
        ["--target=llvm", "--target-llvm-mcpu=cortex-m3"])
    assert reconstruct_target_args(parsed) == {"llvm": {"mcpu": "cortex-m3"}}