Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp297009iob; Wed, 18 May 2022 02:23:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK/0vh/Qc+xp/nNRkQek2FNck3d/OwsZryJULQjLITYV1e5TESOZbHh3qF1FtcW1NOaZFy X-Received: by 2002:a17:902:c2d0:b0:15a:2344:f8a4 with SMTP id c16-20020a170902c2d000b0015a2344f8a4mr26519390pla.28.1652865787806; Wed, 18 May 2022 02:23:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652865787; cv=none; d=google.com; s=arc-20160816; b=M80Z0TvGv/W92EZfNklKW0ibiQdG/tMj44rWBgDwtCWpaNxVW459N+tyv8MZaYcGKC b0AFLYl28nZ1loKsfYVBxLHT9Qe4v7Jsiprwq8bq6vtLBJ/Jn737LOAokK1L+bDkyous gmDz/gsNgACdh1CB8lVs/q2o/hYZKqni0cgozMWvvJtqH0WhqJHoAg+APzJvlQzNHkee QnwInzgrBzgxr6sJBqpALV53TeHXsxBD3CunHAvRE3UzV2qVl0PU0i7yRByxJNkwb2i7 dlCEGuObIZomhgOEGb3filJLUG4SJ9xl/5Iv7P6dsvKAp31DJSxQXsHnmXpoB6mcgEo8 9quw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0H3ez84jEonbzy0mdM2EDH8r0E6ZOe4oW41UM7xBLbE=; b=rJN4YrBCQEvGbbHQ9ATiXt3im08OnSZFJDfiLXEz7bJDQ8hzyQM745ndVD3RF1coEc aNgKVROArYy7wXh3jhtZbRcvq0eI+ddYOQnqDdkZ9d8W0SVUH1Wjz/HEqjrgWTP1RNko xT9abdXcF4aoXbq/CjFb/x7Kl29PcWXnYIrFNQYzp0o8br11EYPevDck0OLf6M48NSM9 jFdb8uIvHCaH+9DB1iU5Tgm9/4t3AZBnVPFdOYIwwjC4DujrrMN/GNoTksGJ2N75fM5y binrZRErX+wrQFG0chkt0EWKOCiaorkEP33Gf1IyanpeI0rF92KgySz/Jg/W4oK4SwnL lRKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LGWlx/5U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k133-20020a636f8b000000b003c142fc5ca4si1942196pgc.336.2022.05.18.02.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:23:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="LGWlx/5U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA98D23140; Wed, 18 May 2022 02:18:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233986AbiERJSl (ORCPT + 99 others); Wed, 18 May 2022 05:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233953AbiERJSf (ORCPT ); Wed, 18 May 2022 05:18:35 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1F21E3C2 for ; Wed, 18 May 2022 02:18:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 4497BCE1F4A for ; Wed, 18 May 2022 09:18:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E842C385AA; Wed, 18 May 2022 09:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652865511; bh=k+5bOoeP4HkT97sUXYxNDGu/Mgf1f/Xo/QI4gKpyZ8Q=; h=From:To:Cc:Subject:Date:From; b=LGWlx/5Uae5jMpB1EOF4pSpgE6Fqgc/nCVt+KzblLaxq2Volbi/4UUY/6bvIryHhJ R9BZreIFsvvf3qCayzZ+TLESM5NppAVLbkd0dzyaNnQ7X8HnLqtmHYBGJHTYqM7+ej S3X+AO0i/z+WqY2y+A3oG/34Zi6ta47AtETFzIwdUG8flmYjX3rBdQ2C477m1v4mXo wah9VXooUkD3jqP+q6SxUzPWkQFg98PbtrMED5h89OsT2h5PmON1fqn2ae6Zia/aEF a7ek7g7p5OfocUnqwh3EK+6c1qznifhqmPwgVvp2RwhP+2T9unBneyzqoGYWKT2wv0 jdTgvx89tUIfw== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, tzungbi@kernel.org, dianders@chromium.org Subject: [PATCH 0/4] platform/chrome: cros_ec_proto: add initial Kunit tests Date: Wed, 18 May 2022 17:18:10 +0800 Message-Id: <20220518091814.2028579-1-tzungbi@kernel.org> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 The series adds some early Kunit tests for ChromeOS EC protocol. The 2nd patch is a refactor. The 3rd patch updates code comment. The 1st and 4th patches add Kunit tests. Use the following example commands to run the Kunit tests: $ ./tools/testing/kunit/kunit.py run \ --arch=x86_64 \ --kconfig_add CONFIG_CHROME_PLATFORMS=y \ --kconfig_add CONFIG_CROS_EC=y \ cros_ec* $ ./tools/testing/kunit/kunit.py run \ --arch=arm64 --cross_compile aarch64-linux-gnu- \ --kconfig_add CONFIG_CHROME_PLATFORMS=y \ --kconfig_add CONFIG_CROS_EC=y \ cros_ec* Tzung-Bi Shih (4): platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_prepare_tx() platform/chrome: cros_ec_proto: factor legacy out from cros_ec_prepare_tx() platform/chrome: cros_ec_proto: update cros_ec_check_result() comment platform/chrome: cros_ec_proto: add Kunit tests for cros_ec_check_result() drivers/platform/chrome/Kconfig | 9 + drivers/platform/chrome/Makefile | 3 + drivers/platform/chrome/cros_ec_proto.c | 58 ++--- drivers/platform/chrome/cros_ec_proto_test.c | 214 +++++++++++++++++++ 4 files changed, 259 insertions(+), 25 deletions(-) create mode 100644 drivers/platform/chrome/cros_ec_proto_test.c base-commit: a0e7d2f65fa706a106dae4b52a7cfe48e0ddfdff -- 2.36.0.550.gb090851708-goog