Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3638448rwl; Sun, 2 Apr 2023 11:48:46 -0700 (PDT) X-Google-Smtp-Source: AKy350ack+tQVYG0/NKz027cjo+ZcZfniev1VeLCU5Wao3cqTty8NaxFW+cDnJQWV8rkRgCWBsPB X-Received: by 2002:a17:903:1249:b0:1a2:9ce6:6483 with SMTP id u9-20020a170903124900b001a29ce66483mr11864895plh.64.1680461326138; Sun, 02 Apr 2023 11:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680461326; cv=none; d=google.com; s=arc-20160816; b=LeNjmzD4dltEQ2GgRCZdAB5EXVeQEgx1WvUYnU8i0F3biMzJDDLj1RU5RqoqAmimcr gj9DrYYI5b3oxbA9+1Ov3OkQ6lBlJ16l5bXVeuDyCG0ViUdFhfcBme0Nul4Qutiv8W5t krhZqLwtT4v30pBeXb/loNw9smWhJRsA8aFQz3iweWfuuvnfs2xMLe5jZpqivybMI8sJ vRH9rkt3wz6CaTc/Q98NM4PfUuM+mEa4qbaqeg81f2AS519OBkPU8UARLgxqETjwBV0d C9a64lc8Q4eJWegX5idApSiOCA7xZVcf4/mBRMaDc58epQ8/55NLtaN7/4cjLTDDRUC+ Rtlg== 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; bh=iPx+FwDEqg2IISCN0weyefQKXOByXz6oxsxccJcdGMc=; b=rAy1AC8dRZjN1rKTFsLXOL8s9z6qRZ6XPUqIioMKKmDyxvWueuAxySsGLOwITsnr4l 7yj4wJD7NSKRT9D9RAhuWZ7IO5cXOWOcLa1llBeE/5uudkBbfBgpbdDE5kDA94cBGfuh g84iG3xxKmjiqMeite18XYAJoCn7WCzh5ShEIC8jeWVNZAdExXTQaOJNIbUzA7kwSUYE S45aEoihOuZCixqpQduESolijgDqs67+o2yvARfc5MmWafS3gE7BcRCYHDCdokGPTcQF X9ELvV9MAQj10ldSZNKK1ltZjFnDmWnOOvW5U4bns84D3fHfTAJ7YsDeFgN3kSQs3zPo S9kw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kf3-20020a17090305c300b001a22560151asi3866535plb.325.2023.04.02.11.48.34; Sun, 02 Apr 2023 11:48:46 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjDBSsU (ORCPT + 99 others); Sun, 2 Apr 2023 14:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjDBSsS (ORCPT ); Sun, 2 Apr 2023 14:48:18 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD10A61BF for ; Sun, 2 Apr 2023 11:48:17 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 332ImCG5012486; Sun, 2 Apr 2023 20:48:12 +0200 From: Willy Tarreau To: "Paul E. McKenney" Cc: linux@weissschuh.net, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 0/4] tools/nolibc: add testcases for vfprintf Date: Sun, 2 Apr 2023 20:48:02 +0200 Message-Id: <20230402184806.12440-1-w@1wt.eu> X-Mailer: git-send-email 2.17.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS 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 Hello Paul, Thomas added new tests for vfprintf(), which is a good idea because it was a new implementation, we use it a lot in the tests so we'd rather make sure it works! This required to implement support for memfd_create() that is used to collect the output into a buffer, as well as to complete a little bit the minimalistic FILE emulation with fileno(), fdopen(), fflush() and fclose(). The result is neat and works equally on glibc and nolibc. We just had to cheat on the pointer test because for NULL nolibc prints "0x0" while glibc prints "(nil)" so we check 0x1 instead to avoid this special case. Finally Thomas added a new target to the makefile to ease building the test against the default libc. This should help detect incompatibilities when new features are added. I've tested it locally with my libc and against all supported architectures (userland tests only), and all tests passed. This can be added to your dev tree for 6.5 on top of the previous series. Thanks! Willy Thomas Weißschuh (4): tools/nolibc: add libc-test binary tools/nolibc: add wrapper for memfd_create tools/nolibc: implement fd-based FILE streams tools/nolibc: add testcases for vfprintf tools/include/nolibc/stdio.h | 95 ++++++++++++++------ tools/include/nolibc/sys.h | 23 +++++ tools/testing/selftests/nolibc/.gitignore | 1 + tools/testing/selftests/nolibc/Makefile | 6 ++ tools/testing/selftests/nolibc/nolibc-test.c | 86 ++++++++++++++++++ 5 files changed, 184 insertions(+), 27 deletions(-) -- 2.17.5