1# Copyright (c) 2024 Microchip 2# SPDX-License-Identifier: Apache-2.0 3 4from pic32cxsgpinctrl import main 5 6 7def test_main(data, tmp_path): 8 """Test that pinctrl headers are generated correctly.""" 9 10 main(data, tmp_path) 11 12 FILES = ( 13 "pic32cx1025sg41064-pinctrl.h", 14 "pic32cx1025sg41080-pinctrl.h", 15 "pic32cx1025sg41100-pinctrl.h", 16 "pic32cx1025sg41128-pinctrl.h", 17 "pic32cx1025sg60100-pinctrl.h", 18 "pic32cx1025sg60128-pinctrl.h", 19 "pic32cx1025sg61100-pinctrl.h", 20 "pic32cx1025sg61128-pinctrl.h", 21 ) 22 23 for file in FILES: 24 ref_file = data / file 25 gen_file = tmp_path / file 26 27 assert gen_file.exists() 28 29 with open(ref_file) as ref, open(gen_file) as gen: 30 assert ref.read() == gen.read() 31