Commit 8fd24d7f authored by Vagrant Cascadian's avatar Vagrant Cascadian

Add tests for .dtb files.

Gbp-Dch: ignore
parent 1d850311
......@@ -19,6 +19,7 @@ Build-Depends:
dh-python (>= 2.20160818~),
docx2txt <!nocheck>,
dpkg-dev (>= 1.17.14),
device-tree-compiler <!nocheck>,
enjarify <!nocheck>,
fontforge-extras <!nocheck>,
fp-utils <!nocheck>,
......
......@@ -93,6 +93,18 @@ Copyright: 2007-2014 OpenWrt.org
2010 Vertical Communications
License: GPL-2
Files: tests/data/devicetree*.dtb
Copyright:
2015 Nikolaus Schaller <hns@goldelico.com>
2012 Texas Instruments Incorporated - http:www.ti.com/
2011 Texas Instruments Incorporated - http:www.ti.com/
2013 Linaro, Ltd.
2015 Sakari Ailus
2011 Texas Instruments Incorporated - http:www.ti.com/
2017 Texas Instruments Incorporated - http:www.ti.com/
2009-2010 Texas Instruments / 2009 Nokia
License: GPL-2
Files: debian/*
Copyright: 2014-2015 Jérémy Bobbio <lunar@debian.org>
License: GPL-3+
......
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016 Emanuel Bronshtein <e3amn2l@gmx.com>
# Copyright © 2017 Vagrant Cascadian <vagrant@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# diffoscope is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import pytest
import subprocess
from diffoscope.config import Config
from diffoscope.comparators.dtb import DeviceTreeFile
from diffoscope.comparators.missing_file import MissingFile
from utils.data import load_fixture, get_data
from utils.tools import skip_unless_tools_exist
# Generated by: dtc --in-format=dts --out-format=dtb --out=devicetree1.dtb devicetree1.dts
dtb1 = load_fixture('devicetree1.dtb')
# Generated by: dtc --in-format=dts --out-format=dtb --out=devicetree2.dtb devicetree2.dts
dtb2 = load_fixture('devicetree2.dtb')
def test_identification(dtb1):
assert isinstance(dtb1, DeviceTreeFile)
def test_no_differences(dtb1):
difference = dtb1.compare(dtb1)
assert difference is None
@pytest.fixture
def differences(dtb1, dtb2):
return dtb1.compare(dtb2).details
@skip_unless_tools_exist('fdtdump')
def test_diff(differences):
expected_diff = get_data('devicetree_expected_diff')
assert differences[0].unified_diff == expected_diff
@skip_unless_tools_exist('fdtdump')
def test_compare_non_existing(monkeypatch, dtb1):
monkeypatch.setattr(Config(), 'new_file', True)
difference = dtb1.compare(MissingFile('/nonexisting', dtb1))
assert difference.source2 == '/nonexisting'
assert len(difference.details) > 0
@@ -1,18 +1,18 @@
/dts-v1/;
// magic: 0xd00dfeed
-// totalsize: 0x10aa4 (68260)
+// totalsize: 0x10ae3 (68323)
// off_dt_struct: 0x38
-// off_dt_strings: 0x10234
+// off_dt_strings: 0x10264
// off_mem_rsvmap: 0x28
// version: 17
// last_comp_version: 16
// boot_cpuid_phys: 0x0
-// size_dt_strings: 0x870
-// size_dt_struct: 0x101fc
+// size_dt_strings: 0x87f
+// size_dt_struct: 0x1022c
/ {
compatible = "openpandora,omap3-pandora-1ghz", "ti,omap36xx", "ti,omap3";
interrupt-parent = <0x00000001>;
#address-cells = <0x00000001>;
#size-cells = <0x00000001>;
model = "Pandora Handheld Console 1GHz";
@@ -82,14 +82,15 @@
#size-cells = <0x00000001>;
ranges = <0x00000000 0x00002000 0x00002000>;
pinmux@30 {
compatible = "ti,omap3-padconf", "pinctrl-single";
reg = <0x00000030 0x00000238>;
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
+ #pinctrl-cells = <0x00000001>;
#interrupt-cells = <0x00000001>;
interrupt-controller;
pinctrl-single,register-width = <0x00000010>;
pinctrl-single,function-mask = <0x0000ff1f>;
linux,phandle = <0x000000e4>;
phandle = <0x000000e4>;
pinmux_mmc1_pins {
@@ -240,14 +241,15 @@
clockdomains {
};
pinmux@a00 {
compatible = "ti,omap3-padconf", "pinctrl-single";
reg = <0x00000a00 0x0000005c>;
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
+ #pinctrl-cells = <0x00000001>;
#interrupt-cells = <0x00000001>;
interrupt-controller;
pinctrl-single,register-width = <0x00000010>;
pinctrl-single,function-mask = <0x0000ff1f>;
pinmux_twl4030_vpins {
pinctrl-single,pins = <0x00000000 0x00000100 0x00000002 0x00000100 0x00000006 0x00000000 0x00000018 0x00000000>;
linux,phandle = <0x000000e7>;
@@ -3500,14 +3502,15 @@
ti,abb_info = <0x000f7314 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00124f80 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x001437c8 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x0014fb18 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000>;
};
pinmux@480025a0 {
compatible = "ti,omap3-padconf", "pinctrl-single";
reg = <0x480025a0 0x0000005c>;
#address-cells = <0x00000001>;
#size-cells = <0x00000000>;
+ #pinctrl-cells = <0x00000001>;
#interrupt-cells = <0x00000001>;
interrupt-controller;
pinctrl-single,register-width = <0x00000010>;
pinctrl-single,function-mask = <0x0000ff1f>;
pinctrl-names = "default";
pinctrl-0 = <0x00000106 0x00000107>;
pinmux_hsusb2_2_pins {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment