1# Copyright (c) 2021 Teslabs Engineering S.L.
2# Copyright (c) 2022 Gerson Fernando Budke
3# SPDX-License-Identifier: Apache-2.0
4
5from sampinctrl import main
6
7
8def test_main(data, tmp_path):
9    """Test that pinctrl headers are generated correctly."""
10
11    main(data, tmp_path)
12
13    FILES = (
14        "samad-pinctrl.h",
15        "samae-pinctrl.h",
16        "samaf-pinctrl.h",
17        "sambe-pinctrl.h",
18        "sambf-pinctrl.h",
19        "samcf-pinctrl.h",
20    )
21
22    for file in FILES:
23        ref_file = data / file
24        gen_file = tmp_path / file
25
26        assert gen_file.exists()
27
28        with open(ref_file) as ref, open(gen_file) as gen:
29            assert ref.read() == gen.read()
30