From patchwork Thu Mar 4 13:50:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1447335 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PnzyK6Dc; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Drsnp42npz9sSC for ; Fri, 5 Mar 2021 00:55:26 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ABC198287F; Thu, 4 Mar 2021 14:52:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PnzyK6Dc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45CD1827AB; Thu, 4 Mar 2021 14:52:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 417458278B for ; Thu, 4 Mar 2021 14:52:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x32a.google.com with SMTP id r19so27307187otk.2 for ; Thu, 04 Mar 2021 05:52:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hqf4jp5c4caIzAef7xvlL5BJbLnbEU9rf+DBcbhaKvw=; b=PnzyK6DcP0JFyg1uISPj6Ayal/B0EbZwu6nl2CNCrPcwNSx4OAuZPIldmiHj07tNdP oqaPhnXAnCOJQ/3kYgMU+Qn6zZEzPE9FUkTwXdKLRTTo9cK3Awsx8sloNxHrNCgDb7W9 e4488Vq9FQNdgegEfOWKNV99DcyZjiZA+PB5o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hqf4jp5c4caIzAef7xvlL5BJbLnbEU9rf+DBcbhaKvw=; b=JCLRGB874rKJ+rmoC+xuoW2YvLolGrxznZ40B9F7gqPEc3sfMbDzUUellF46LZlGUw Aus++zV13+8I8/6EyjrDeMcAUjYOiLO3wXhfsQxyAApKJnADeJjyM9gBLd1PeVzfqWIk 2O9Vs8kEynJACkeFcyzMg2ijv23lzV2CiuqPxQqCjKZY4rqWwH0209k/DZf1D2SLTTh0 vMPQ5ZyX+zIBMSlSc2Fk8hP9pkM0PZ7RmK/NwCxSYBHdIndWIDI+S3ScYB0C+TI/yYs9 HXCz+0XMQcEztL9XyMBdnGkbU8WyNrQdO0O29Q+kHL3WDqk4PhcZBswzjefgddwPXJMT Hl6A== X-Gm-Message-State: AOAM5334tIumfEfMC+geMFVqi7M0mMasvUU+JwRTcttIMT2LHdu+D3kn d/fd1/hjOo/Yhl8iHhVbeeJUi8DwdPiUsSnf X-Google-Smtp-Source: ABdhPJxm7IE345pNk9woUAIu9AcOmD+2tW0t/WK/jpuFg3UuFtm9Ph3oUCJatUA6+Xn6QgnT1Ntx9w== X-Received: by 2002:a9d:4c82:: with SMTP id m2mr3664873otf.101.1614865919932; Thu, 04 Mar 2021 05:51:59 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id x10sm4029465otp.19.2021.03.04.05.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 05:51:59 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Stephen Warren , Stephen Warren , Simon Glass Subject: [PATCH v4 18/42] test: Move console silencing to test_pre_run() Date: Thu, 4 Mar 2021 06:50:54 -0700 Message-Id: <20210304135118.643277-18-sjg@chromium.org> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog In-Reply-To: <20210304135118.643277-1-sjg@chromium.org> References: <20210304135118.643277-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean We already have a function for silencing the console during tests. Use this from test_pre_run() and drop this code from the driver model tests. Signed-off-by: Simon Glass --- (no changes since v1) test/dm/test-dm.c | 4 ---- test/test-main.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/dm/test-dm.c b/test/dm/test-dm.c index d1d83e34782..fdd35f663e4 100644 --- a/test/dm/test-dm.c +++ b/test/dm/test-dm.c @@ -66,7 +66,6 @@ static int dm_test_destroy(struct unit_test_state *uts) static int dm_do_test(struct unit_test_state *uts, struct unit_test *test, bool of_live) { - struct sandbox_state *state = state_get_current(); const char *fname = strrchr(test->file, '/') + 1; printf("Test: %s: %s%s\n", test->name, fname, @@ -75,13 +74,10 @@ static int dm_do_test(struct unit_test_state *uts, struct unit_test *test, ut_assertok(test_pre_run(uts, test)); - if (!state->show_test_output) - gd->flags |= GD_FLG_SILENT; test->func(uts); ut_assertok(test_post_run(uts, test)); - gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD); state_set_skip_delays(false); ut_assertok(dm_test_destroy(uts)); diff --git a/test/test-main.c b/test/test-main.c index db0d82e36c3..e273777b6e2 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -50,13 +50,14 @@ int test_pre_run(struct unit_test_state *uts, struct unit_test *test) return -EAGAIN; } } + ut_silence_console(uts); return 0; } int test_post_run(struct unit_test_state *uts, struct unit_test *test) { - gd->flags &= ~GD_FLG_RECORD; + ut_unsilence_console(uts); return 0; }