From nobody Wed Mar 13 23:09:14 2024 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tw5n50bVBz5Dcm4 for ; Wed, 13 Mar 2024 23:09:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ua1-f54.google.com (mail-ua1-f54.google.com [209.85.222.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tw5n45n2lz44Mc for ; Wed, 13 Mar 2024 23:09:28 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ua1-f54.google.com with SMTP id a1e0cc1a2514c-7db44846716so128405241.2 for ; Wed, 13 Mar 2024 16:09:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710371367; x=1710976167; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rlsjKOjNKam5WhRrzLZJM4idtlhJdrODLYjJ7xkpq3g=; b=kT1ozdVV1/yG7E5CnIWvLOX91FYWg2w+141x6pybwV40JaZjHuHkXtuQfxNxjy/2F2 2O7tZ73xnrbMpOpzeaRBrNay8ji7xh7sxBHxO1j+N3U/RIvG1L97hXhiEahlbfLZ2rmp dod0BNOUQfdC1PV/sNf8/nQRnnwoVT8kQ6FsryCJkcwXip/tkuV8Zagt2EhKUkeM6mjf ofyXYxYEIAHz4L9SgA5Y4ZzjIYvbqqR9FCP24Ades0WWP9JJBrhg+gpiTq9XdCZ6PYUe al5qVBT6giHPpYOI1xJZgXRWnHVnyXM4RRLJqgdrpEW9z6xb95JNcU+AKVi5KcSoGNcG qIxQ== X-Gm-Message-State: AOJu0YwKN964HpPIMXMP8o+XkVN0Bxa85UX/F9gMa2dOqjupVF0Qw0Ji IYjsOzBIqjD5qNC6RWlFhasreglAa1GSXbRfNnUCHBgRU63qUzOWVK5apM5QuT9KJg98evI1Hzl htx3YHLF5ANurRds6/KcxMjLlimd8XOCn X-Google-Smtp-Source: AGHT+IECaVCYPaa6p/ncqGT2XgZodzt8/jxBZIByIwE7Uh+2gRpVyZjF9Ldg7CDmI6sclz7grtNb+E6vTW4JIZba7pM= X-Received: by 2002:a67:c00b:0:b0:474:ca20:fc9b with SMTP id v11-20020a67c00b000000b00474ca20fc9bmr430221vsi.0.1710371365896; Wed, 13 Mar 2024 16:09:25 -0700 (PDT) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Wed, 13 Mar 2024 17:09:14 -0600 Message-ID: Subject: Re: Running tests for a single program in src/bin, src/usr.bin, etc To: henrichhartzer@tuta.io Cc: Freebsd Stable Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Tw5n45n2lz44Mc You aren't the first person to request that. And such a feature would work well for most programs. But there are many exceptions. For example, some programs' tests need to read a file stored in a different program's test directory. For such reasons you're required to install the tests before running them. -Alan On Wed, Mar 13, 2024 at 4:40=E2=80=AFPM wrote: > > Hi Alan, > > That worked. Thank you! > > I do still think it would be nice to be able to run tests in isolation, l= ike `make test`. It seems like ideally you could test the individual binary= without installing it to the system, in case there are issues. > > -Henrich > > Mar 5, 2024, 14:06 by asomers@freebsd.org: > > > On Mon, Mar 4, 2024 at 5:55=E2=80=AFPM wrote: > > > >> > >> Hi everyone, > >> > >> Not sure if this is the best list for this. Maybe hackers@ would be be= tter? > >> > >> I wanted to tinker with utilities in /usr/src/bin and /usrsrc/usr.bin.= I noticed that rmdir exits 1 for usage, which is a pet peeve of mine. I up= dated it to exit 2 and then wanted to alter the tests to ensure it's exitin= g 2. > >> > >> At this point, I'm unsure of how to run tests for this single componen= t. Is there a way I can be in /usr/src/bin/rmdir and just run a succesful `= make test` (or equivalent) without some combination of `make install` + kyu= a out of /usr/tests? Seems like for self-contained tests, simple testing sh= ould be possible. > >> > >> I did find `make check`, but I'm having issues with checkdir sticking = around. > >> > >> Thank you! > >> > >> -Henrich > >> > > > > If you don't like the fact that checkdir disappears, then you'll have > > to do "make install". But you don't need to run Kyua on the entire > > test suite. You can do it just on a subdir, like this: > > > > sudo kyua test --kyuafile /usr/tests/bin/rmdir/Kyuafile > >