Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121964 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83774 invoked from network); 8 Dec 2023 16:08:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Dec 2023 16:08:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F34CC18004E for ; Fri, 8 Dec 2023 08:09:08 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 8 Dec 2023 08:09:08 -0800 (PST) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a1db6c63028so255640866b.2 for ; Fri, 08 Dec 2023 08:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702051734; x=1702656534; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=4dscO/YDwT8E++cd/SlZBI4iabUvKTArlscPO79WKwU=; b=VK0VnG294hbD6Ki7z+O40nWLeVq73DcCTMahgOZn8+qUtO91nX7+IVd9AEWavoLBSF lo/XbzAd3xE0jyHYB8k+Be6nXR8UUsi08aZvVuf103Ayx5dVn4F7KmPsSKP0cXE8NKSu 1vJG1+iSsLlJBqOTKj4DqVaJPKPNDEZbvYb90AII+l6G539ozAW4MsEiLeFc08KZlI8V OdJsZI++4eSfCJ2AyOMZy5EWsR4TVIE+Ww9oWEnitTGH7TWdHvgM12Q6D7xa8BU9Ngot qq0cPR/MG6a7KK7eXuvY3AxT1/ueOXJijWwLI29svsLbNglMX7QD/vfxgLlwIUQLd4/V HaeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702051734; x=1702656534; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4dscO/YDwT8E++cd/SlZBI4iabUvKTArlscPO79WKwU=; b=oowD86FnBzCnOmocKV8M6wTBSmLF3bRMlbxfn6wGuIRFdGkUa9HXLwkMxj1z9R/Hl6 RKJgzlOVVd040+YMxkETX9QxmW7wvBgcMkeBiFdrKVtgWjqr2aR3XoS0ezIn1bvq5SM1 kazfLlNZDQkTwgVWyPwMMUV9ZSeQ4CNNxPsTYv09RtPZbdIQF6tFnjzuMRN9p5cWkBsy IN7qgL4uHGvrNJw/clDmI+ZCY5Qlq2eLNBOLzXIvwFgTf+luRZtSs83A2r/0b9Q/nx9u w2KXzbrRWFV1/TKIvez0jHZLRaytM8XKvWMXDpZQwosVI1LStcN2cElMJANak9RZEQvz fCpQ== X-Gm-Message-State: AOJu0Yyb2q6m+ibz9QLsvY7FxKf6xEsA6U11LdBJWCXooKs6E00/Lzl7 ZvMhqMBt6t9De3cOD9uiaBP5RE8naQU= X-Google-Smtp-Source: AGHT+IGoYuuKRwckR9klAhKyL89QQQmj1jfk9R6afmcwX5ecPO7hppzozgbxzjfa0Lo25HwGzxeLmA== X-Received: by 2002:a17:907:7d8c:b0:a1f:6295:4fbb with SMTP id oz12-20020a1709077d8c00b00a1f62954fbbmr158050ejc.68.1702051733637; Fri, 08 Dec 2023 08:08:53 -0800 (PST) Received: from ?IPV6:2a02:1811:cc83:ee50:280e:1e36:3a00:824? (ptr-dtfv08akcem5xburtic.18120a2.ip6.access.telenet.be. [2a02:1811:cc83:ee50:280e:1e36:3a00:824]) by smtp.gmail.com with ESMTPSA id vx12-20020a170907a78c00b00a1ddb5a2f7esm1168470ejc.60.2023.12.08.08.08.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Dec 2023 08:08:53 -0800 (PST) Message-ID: <1a8b451a-1d4c-4c2b-9d1c-aefd2fd51e49@gmail.com> Date: Fri, 8 Dec 2023 17:08:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: internals@lists.php.net References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP test coverage From: dossche.niels@gmail.com (Niels Dossche) Hi On 08/12/2023 17:04, Vinicius Dias wrote: >> The code coverage report can be found at https://app.codecov.io/github/php/php-src > > Ah, perfect. Thank you for sharing. I will take a closer look after > work, but something seems weird to me. Here[1] you see that > ctype_alpha seems to be uncovered, but here[2] we can see that it's > tested. > > [1]: https://app.codecov.io/github/php/php-src/blob/master/ext%2Fctype%2Fctype.c#L112 > [2]: https://github.com/php/php-src/blob/master/ext/ctype/tests/ctype_alpha_basic.phpt You'll see this kind of stuff with macros. The coverage report shows "partially covered" code as uncovered due to a limitation. In this particular example, the parameter parsing code failure isn't tested, so it marks the whole macro as untested. You'll see this many times in the PHP codebase. Also for example for RETURN_THROWS: because that macro performs an assertion it's always in red because the assertion isn't hit in our testing (and that's a good thing because if it were hit then it means there's a bug). Kind regards Niels > > >> I will have a look, the page overall looks like it could need some love ;-) >> In the meantime if you are interested in writing tests, I once wrote a blog post about that topic at https://dev.to/realflowcontrol/growing-the-php-core-one-test-at-a-time-4g4k > Ah, that's great. Thank you for that! :-D >