Bug 277539 - Fix bitrot in tools/test
Summary: Fix bitrot in tools/test
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Hartmut Brandt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 20:41 UTC by John F. Carr
Modified: 2024-11-26 00:08 UTC (History)
1 user (show)

See Also:


Attachments
Fix compilation of some tools/test programs (2.50 KB, patch)
2024-03-06 20:41 UTC, John F. Carr
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2024-03-06 20:41:02 UTC
Created attachment 248986 [details]
Fix compilation of some tools/test programs

The attached patch fixes compilation of tools/test/bsnmp, tools/test/malloc, and tools/test/net on recent versions of FreeBSD.

Most of the changes pacify the compiler.  The malloc test calls sbrk() which does not exist on arm64 and does not provide any useful information on amd64.  I made sbrk() a weak symbol.
Comment 1 Gleb Smirnoff freebsd_committer freebsd_triage 2024-03-07 20:36:03 UTC
Thanks for submission, John!  Do you have any possibility to convert
the tests to the atf(7) framework, so they can be moved into the
standard tests/ subdirectory, that is in the root of FreeBSD sources?
If this is done, the tests will be constantly built as part of
buildworld as well as the project CI will routinely run the tests
and report any regressions.  That will make them way more valuable
than tests that are just stored in the sources.
Comment 2 John F. Carr 2024-03-09 23:55:19 UTC
After struggling with converting tools/test/bsnmp into a proper test I decided it was a job for somebody who understands and enjoys using share/Mk.
Comment 3 Gleb Smirnoff freebsd_committer freebsd_triage 2024-03-15 03:12:23 UTC
Hartmut, can you please take a look if we can connect the bnsmp tests
into our standard CI?  Feel free to put the bug back to the pool if you
don't have time.  However, any insight from you on the topic will be
valuable - please share.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-10-14 08:24:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=bc7afab6a1fa4294df0b8d7d461bd0bdc542fbfe

commit bc7afab6a1fa4294df0b8d7d461bd0bdc542fbfe
Author:     Hartmut Brandt <harti@FreeBSD.org>
AuthorDate: 2024-10-14 08:16:03 +0000
Commit:     Hartmut Brandt <harti@FreeBSD.org>
CommitDate: 2024-10-14 08:23:18 +0000

    Fix compilation of bsnmp tests.

    PR:             277539
    Submitted by:   John F. Carr

 tools/test/bsnmp/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 5 hartmut.brandt 2024-10-14 08:27:04 UTC
I have added the compilation fix for the bsnmp tests but don't know how integrated the tests with atf short of duplicating them and use the atf-c++ stuff instead of the catch2 macros. These tests reside in the contrib/bsnmp directory and are not local.