Received: by 10.223.176.5 with SMTP id f5csp1232351wra; Wed, 7 Feb 2018 15:20:11 -0800 (PST) X-Google-Smtp-Source: AH8x2263jFGgeHj8YcZfXeJS/hK1ZXtTN1d0IFko71BKuYG05Pv1gCKpyM3GvcC5Lk1tnPhhI5o3 X-Received: by 10.101.77.67 with SMTP id j3mr3869692pgt.76.1518045611101; Wed, 07 Feb 2018 15:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518045611; cv=none; d=google.com; s=arc-20160816; b=XvJ1RtfbzgnxqnJH5vwWbAI4Kx8h786RojSy6yzmHlwKmLjThgdzDXPvEQSWbogQ7N PRl+MWgJTXChoMjfFiSctQUvgXvLthu9mbWobrduoR3aS7UnR/TQ32MoXBMccK5v9RjR 2/UVkGg8mf/49h+MHZnHyCd7TuJJEhXE4qyUk2SP6ISEY9i8VSqShkL3RcMlV+Af2W0G I6MqyO8r29QQmJshc71/6qWQGQI4sxGtLrgjWu8WVHmDZRmNG/B1L3c149S3qffHjCn4 qnGlbTk4D4N7L6LaYTTFBwmuVFmALuRValkkQlx8Mzo6kyB+/n71WQ96hp6WNZTOCe++ FHkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Me79yCN9fyYlNZ/sjShi+YsQ+C24E6mfK/ORJ1jriqM=; b=WK7y3LkxmZPhmV+0R/B+OvkyOlmiabQbCvAJFuIbks94YZqPOEwPg+FR3t2ZGJWn68 O2Q5yVZOKb+PoUXkId0vtHdYJIqWJcPfnzd7viQbACVLnNuJ4UyLvdCxDlRPaSJZOdA1 PC73ur1eqRhDqSbqkRJyA7kcT1EcSyy+NqjqktTs2ltj7J83s0fj77oEegDsn8YTEk5R MVmvsV0644SJTqhZr/Zx4nNAsSnvwKfckDlMFimq9mkH0IlhrrkfZKNzp7sygbSVnCgn 0oPdRhTOjCX1j6EYKa/sY/laLeHtsDrU1LfUEejC3mPdQR9jsMdueS/Dae4aZW2bfRaR AerQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JQLRVBPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si1799334pfc.274.2018.02.07.15.19.57; Wed, 07 Feb 2018 15:20:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JQLRVBPs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751269AbeBGXTS (ORCPT + 99 others); Wed, 7 Feb 2018 18:19:18 -0500 Received: from mail-ua0-f193.google.com ([209.85.217.193]:38863 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbeBGXTQ (ORCPT ); Wed, 7 Feb 2018 18:19:16 -0500 Received: by mail-ua0-f193.google.com with SMTP id e25so1716810uan.5; Wed, 07 Feb 2018 15:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Me79yCN9fyYlNZ/sjShi+YsQ+C24E6mfK/ORJ1jriqM=; b=JQLRVBPsi09Pg5dycjp9jLlnwLIxyyqzV2fcOK6fY56enq3N3OiLvRJ+xXqQo14g7D qnjBZgeCbhANDeZOMiVyLNjy8ZqFrZCEl+0KtLDhqcQlT9CmSIZa/++BEURm17ZhbiEV UuT0JbTYvQy9ZBMgdw573dskEMYkbAomCt8m0uEohw34ry5Howjihbgn0f/kYeTnCJua vhvy4YIKcNRRVcCVTmjhUhk9WoMbHFSGBlOxUyOgGeTRMONGlwZ/rxaQCjDKp7VbJUUi Tf0ZVkipxHBs47DKZW8sMKVxAEEjEVj6mYY1epfZxGAW4f76BjhRJe96tMQM/AQ6bATi 1KVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Me79yCN9fyYlNZ/sjShi+YsQ+C24E6mfK/ORJ1jriqM=; b=pUL/d+PzYcObun1ehIgOCvyKiFZFNB1zrkAoMSQd6WTXKPZAgX933hViewEDIygQ9F oJo6/zB6kKWF8nGf+aW3rFGgWyBIqHhK/XFIWZrIRRTqRp9rU+PcHRr4fVMWcL/g8yIJ XkKPos9giDIu2AHHz5cMWub4GiMwSf0Ru5Vzgvn/OnUy/UnY7oISmawQPm5STanB197O e8DfCwcr4EbCNSH+IgsELlzcayVpyoaBziXhGZKa0GSi7otBcLqs4nOoM7nlRNK4j/3B KsTl0NX6BiW3NEbHgjr7P4V2GWkj5kLIhJ18jlKxD7FRoVtoBIC1jitFa8a55kVwACBp 4zIw== X-Gm-Message-State: APf1xPAdXSXTt+fblteRlLnmmSls1JznPrRN6mjOD0GjwYwz/Z59i+39 J/jkkTKZkgkBWwSVRVOwJn4T1RWTsFw5wD3nJkfR9i5Boz0= X-Received: by 10.176.25.65 with SMTP id u1mr6930206uag.108.1518045555191; Wed, 07 Feb 2018 15:19:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 15:19:14 -0800 (PST) In-Reply-To: <20180206093803.GC31558@kroah.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <20180206093803.GC31558@kroah.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 00:19:14 +0100 Message-ID: Subject: Re: [PATCH 00/14] Add Kconfig unit tests To: Greg Kroah-Hartman Cc: Masahiro Yamada , Linux Kbuild mailing list , Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Sam Ravnborg , Michal Marek , Linus Torvalds , "Luis R. Rodriguez" , Tony Luck , Borislav Petkov , Linux Kernel Mailing List , Thomas Gleixner , Heinrich Schuchardt , Yaakov Selkowitz , linux-ia64@vger.kernel.org, Fenghua Yu , Marc Herbert Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 6, 2018 at 10:38 AM, Greg Kroah-Hartman wrote: > On Tue, Feb 06, 2018 at 09:34:40AM +0900, Masahiro Yamada wrote: >> I am applying various patches to Kconfig these days. >> >> However, I fear regressions. I have been thinking of unit-tests. >> >> There are various cryptic parts in Kconfig and corner cases where >> it is difficult to notice breakage. If unit-tests cover those, >> I will be able to apply changes more confidently. >> >> So, here is the trial. >> >> After fixing some problems, I will add a basic test framework. >> This is based on pytest. Also, this is written in Python 3. >> Python 2 will return in 2020. So, I believe new python tools should be >> written in Python 3. >> >> This is my Python 3 and pytest versions. >> >> $ python3 --version >> Python 3.5.2 >> $ python3 -m pytest --version >> This is pytest version 3.4.0, imported from /home/masahiro/.local/lib/python3.5/site-packages/pytest.py >> >> If I use old pytest version, some parts did not work as expected. >> If this does not work for you, please consider using newer pytest. >> >> I will brush up the code more and add more test cases to do a better job. >> Before proceeding more, I'd like to get consensus for this approach. >> If you have an idea for better implementation, comments are appreciated. > > Personally I think this is great stuff. I too have never wanted to > touch Kconfig stuff due to the complexity, and having unit tests like > this is a great idea to help ensure that things do not break. > > Your first 5 patches should be queued up for the next merge window, no > problem (see my comments on the 6th). As for the rest, I don't have any > objection to them, and using python3 over python2 is a good idea. And > anyone who wants to do Kconfig work can easily install the needed > packages, it's not required by any "normal" kernel developer. > > Anyway, nice job, it's great to see this happening, no objection from me > at all! > > greg k-h Yeah, breaking Kconfig is a sure way to feel the wrath. The only reason I feel somewhat confident modifying Kconfig is that the Kconfiglib test suite happens to work as a regression test for the C implementation as well. It compares the .config files produced by the two implementations for all defconfig files and for all{no,yes,def}config, for all ARCHes, meaning any changes to the output of the C tools get flagged as well (with a diff). Having some "native" tests is great as well. I'm a big fan of automatic testing. :) In case you want to run the Kconfiglib test suite at any point, here's how to do it (in the kernel root): $ git clone git://github.com/ulfalizer/Kconfiglib.git $ git am Kconfiglib/makefile.patch $ python Kconfiglib/testsuite.py speedy Cheers, Ulf