From patchwork Thu Jul 13 16:27:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Pagani X-Patchwork-Id: 120036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1963302vqm; Thu, 13 Jul 2023 10:06:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlHOX0MuvyiAdxOWJRnRBHG3tZskDie3ry6We8Z08qC8OKPWcz6tE05WS02l41ge4o+SgUsj X-Received: by 2002:a17:906:ad5:b0:992:345e:8319 with SMTP id z21-20020a1709060ad500b00992345e8319mr1641337ejf.58.1689267970891; Thu, 13 Jul 2023 10:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689267970; cv=none; d=google.com; s=arc-20160816; b=jdnMmabHEPzAUpj59zc+99O0dsED2FNljRIyKgZeItY+W5t91V7mehi755yVN4o9oe 0itnlh3JsFC8o7HRmy7bV25D9kxXYuNVVqsOiY12zCmLHwJuIGX9HKxNEk8FtLrW5+la rBvdMOZSM7R3HzME8zQvDcp0WuWc7TOTp49jjdYFWYuBFOYJBE0EMXQz858O9DhlaU24 tM3RphfgY8SyufcOF4j2iNyjFaiOZotHIzThPmOZi8teM9WqHmJPIH7HsOEIM2+IgUiz YiBBLq+XK7jlxwhmHoubmJi5DVy1iY4YNpOlALKr3VoCsTI5C1ckHhEGltAXRi51EOVu tk+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wWVveJ30j+awpC6r3B537VP9iS5QEq83jfrgh734Zoc=; fh=M37Ydd+BXMWH9O/XP+uN5l3PQrnD/ZjHRj9NyKzE96w=; b=f7uhhHUM2XQAYSGiT0JaBeA0s5UeET5BVrozN1yRHmOsmNB4spdYCbL3/Rczg87Pcs Url18Yk3x5hX375Ze8n6PIfzc7cZP0oU0O6Vqi8rvatzk5fRaA4fCt4W/yd4u9cIrUO7 z1G6fI21O0bRXair6T33DFXtCQipq8As44H4gJjosDsyJVLoFSMCG1PXQbhM8U1l+fdH MIyJT5lr2yJ8i5VhIWY8gm7Jb3IWwID3A0aiyZHCty+8JO2k8tUlKFHx61OJyxT8pF/U 9ipKrC4f0LPfQWFAp0UON+VoM19NrdyIyEF8ddbrLj7MJP+xP3ksJATdnJVY1TdV9etZ /Jeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cIJif7q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw27-20020a170906bcdb00b00992b75dedafsi7738593ejb.507.2023.07.13.10.05.37; Thu, 13 Jul 2023 10:06:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cIJif7q8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235243AbjGMQ3C (ORCPT + 99 others); Thu, 13 Jul 2023 12:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235222AbjGMQ26 (ORCPT ); Thu, 13 Jul 2023 12:28:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FBF02D40 for ; Thu, 13 Jul 2023 09:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689265689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wWVveJ30j+awpC6r3B537VP9iS5QEq83jfrgh734Zoc=; b=cIJif7q8EEYMJQi8b2sniU7ZABGeoH5QphxSg1h+D3iv67tv+1VtQU1ZDbUnVtfLGy6tv5 zxbHIkO9zINCuI98tekU+xp9dyu6XpzRUGSn8OU35Hd5H2gMMFKHFgL4skhlJmXP41BkWG W4LjWFBgDa/aLKvJ3A1kLcZGgIVoWik= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-568-q2m5ndA5NH6fTIsR1_sJyA-1; Thu, 13 Jul 2023 12:28:08 -0400 X-MC-Unique: q2m5ndA5NH6fTIsR1_sJyA-1 Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-56364632e59so1382607eaf.1 for ; Thu, 13 Jul 2023 09:28:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689265688; x=1691857688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wWVveJ30j+awpC6r3B537VP9iS5QEq83jfrgh734Zoc=; b=jKf3kKFeoi1PXjgIgEjnNM+8wuwnrZbsETR9XBxp5FZdaddQmDA7hLv25TX9BdBG9S uaVU6Xg3MO6nyyys/z/8u2xf1G/IOhqXcWGEqiVm21+gnEleTOI4aX+A+lvaDXGnBHhp LH+G8FHF7kY3L0IIadylsCvlhqBbzXDILwOVU76DK/EO2rX9Ap4qgM7K+Wk+dCTYXvOy 7fmwqqusQK+/UR/jOEaBy0K38mS9to19prwQWfCfZb8oHYAA3AFf1qdlWUOiZns5rRID Al45woA2PStWQQmeiQRQZHHB7d4MREcxyYZyQi7rpVaPcRquV2/0ZFZVeNVXhuCFDiGh KiYA== X-Gm-Message-State: ABy/qLZ5O6Oxz4u143yLCPJHu+JsPP2GBSfOyBGIU9jJokJa14Y3U/jd PN7tOg5TvJbRXpgG0nPNGNzvein5IoyyZlbv7d/91z3kh/Kfb5+Bel91yrOwYksBtKKqVBtOchv LxnwVWKMP96MS7tAMg45KK4M= X-Received: by 2002:a05:6358:5e0c:b0:12b:ed77:8b66 with SMTP id q12-20020a0563585e0c00b0012bed778b66mr2046491rwn.7.1689265687774; Thu, 13 Jul 2023 09:28:07 -0700 (PDT) X-Received: by 2002:a05:6358:5e0c:b0:12b:ed77:8b66 with SMTP id q12-20020a0563585e0c00b0012bed778b66mr2046469rwn.7.1689265687405; Thu, 13 Jul 2023 09:28:07 -0700 (PDT) Received: from klayman.redhat.com (net-2-34-24-242.cust.vodafonedsl.it. [2.34.24.242]) by smtp.gmail.com with ESMTPSA id u17-20020a0cf1d1000000b00637873ff0f3sm3206582qvl.15.2023.07.13.09.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 09:28:07 -0700 (PDT) From: Marco Pagani To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix Cc: Marco Pagani , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH v9 4/4] fpga: add configuration for the FPGA KUnit test suites. Date: Thu, 13 Jul 2023 18:27:31 +0200 Message-ID: <20230713162731.211669-5-marpagan@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230713162731.211669-1-marpagan@redhat.com> References: <20230713162731.211669-1-marpagan@redhat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771325851811667518 X-GMAIL-MSGID: 1771325851811667518 Add configuration for the KUnit test suites for the core components of the FPGA subsystem. Signed-off-by: Marco Pagani Acked-by: Xu Yilun --- drivers/fpga/Kconfig | 2 ++ drivers/fpga/Makefile | 3 +++ drivers/fpga/tests/.kunitconfig | 5 +++++ drivers/fpga/tests/Kconfig | 11 +++++++++++ drivers/fpga/tests/Makefile | 6 ++++++ 5 files changed, 27 insertions(+) create mode 100644 drivers/fpga/tests/.kunitconfig create mode 100644 drivers/fpga/tests/Kconfig create mode 100644 drivers/fpga/tests/Makefile diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 0a00763b9f28..2f689ac4ba3a 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -276,4 +276,6 @@ config FPGA_MGR_LATTICE_SYSCONFIG_SPI FPGA manager driver support for Lattice FPGAs programming over slave SPI sysCONFIG interface. +source "drivers/fpga/tests/Kconfig" + endif # FPGA diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile index 72e554b4d2f7..352a2612623e 100644 --- a/drivers/fpga/Makefile +++ b/drivers/fpga/Makefile @@ -55,3 +55,6 @@ obj-$(CONFIG_FPGA_DFL_NIOS_INTEL_PAC_N3000) += dfl-n3000-nios.o # Drivers for FPGAs which implement DFL obj-$(CONFIG_FPGA_DFL_PCI) += dfl-pci.o + +# KUnit tests +obj-$(CONFIG_FPGA_KUNIT_TESTS) += tests/ diff --git a/drivers/fpga/tests/.kunitconfig b/drivers/fpga/tests/.kunitconfig new file mode 100644 index 000000000000..a1c2a2974c39 --- /dev/null +++ b/drivers/fpga/tests/.kunitconfig @@ -0,0 +1,5 @@ +CONFIG_KUNIT=y +CONFIG_FPGA=y +CONFIG_FPGA_REGION=y +CONFIG_FPGA_BRIDGE=y +CONFIG_FPGA_KUNIT_TESTS=y diff --git a/drivers/fpga/tests/Kconfig b/drivers/fpga/tests/Kconfig new file mode 100644 index 000000000000..e4a64815f16d --- /dev/null +++ b/drivers/fpga/tests/Kconfig @@ -0,0 +1,11 @@ +config FPGA_KUNIT_TESTS + tristate "KUnit test for the FPGA subsystem" if !KUNIT_ALL_TESTS + depends on FPGA && FPGA_REGION && FPGA_BRIDGE && KUNIT=y + default KUNIT_ALL_TESTS + help + This builds unit tests for the FPGA subsystem + + For more information on KUnit and unit tests in general, + please refer to the KUnit documentation in Documentation/dev-tools/kunit/. + + If unsure, say N. diff --git a/drivers/fpga/tests/Makefile b/drivers/fpga/tests/Makefile new file mode 100644 index 000000000000..bb78215c645c --- /dev/null +++ b/drivers/fpga/tests/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Makefile for KUnit test suites for the FPGA subsystem +# + +obj-$(CONFIG_FPGA_KUNIT_TESTS) += fpga-mgr-test.o fpga-bridge-test.o fpga-region-test.o