Page MenuHomeFreeBSD

Add atf-lua, a lua analog to atf-sh(1) and atf-sh(3)
Needs ReviewPublic

Authored by kevans on Oct 24 2020, 3:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 9:36 PM
Unknown Object (File)
Sat, Apr 27, 10:12 PM
Unknown Object (File)
Mar 15 2024, 4:28 PM
Unknown Object (File)
Mar 10 2024, 1:58 PM
Unknown Object (File)
Mar 7 2024, 7:07 PM
Unknown Object (File)
Mar 7 2024, 6:25 PM
Unknown Object (File)
Jan 26 2024, 2:06 PM
Unknown Object (File)
Jan 26 2024, 1:04 PM

Details

Reviewers
cem
freqlabs
Group Reviewers
manpages
Summary

This allows us to write tests in lua and hook them up to the existing kyua infrastructure. The atf-lua(3) library attempts to resemble atf-sh(3) to some extent, but takes advantage of some lua features to improve the test-writing experience.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 34367

Event Timeline

Fix the build against my lua54 branch -- LUA_ERRGCMM has been removed because they will not be a thing anymore.

Would it be better to go to https://github.com/freebsd/atf first then merge to contrib?

Would it be better to go to https://github.com/freebsd/atf first then merge to contrib?

I wasn't sure which offers a better review interface, but FreeBSD/atf is indeed the intended first stop.

I've pushed an updated version @ https://github.com/freebsd/atf/pull/9 that sorts out some header and lua compatibility issues, along with adding the build glue for standalone atf.

Thanks for working on this! Hopefully this means fewer atf-sh tests in the future. Tests written in shell are unnecessarily slow and massively increase CI time on emulated platforms such as QEMU (and even more so on CHERI QEMU since we have to emulate tagged memory).

contrib/atf/atf-lua/integration_test.sh
1

This copyright notice seems wrong?

Also how much effort would it be to rewrite these tests in atf-c/atf-c++. I spent a lot of time trying to speed up CI on CheriBSD and the biggest overhead seems to be all the processes spawned by tests written in shell instead of a real programming language.

contrib/atf/atf-lua/integration_test.sh
1

It was mostly verbatim stolen from the atf-sh integration_test with a couple bits filed off and a couple bits added, so I just left the copyright intact.

It should be nearly trivial to rewrite these atf-sh tests in atf-c or atf-c++ (I'm inclined to go atf-c personally), they're mostly exec()ing the test helper and inspecting some combination of stdout/stderr/exit status.

Ok from the man page perspective. Did you checked the man pages via igor and mandoc -Tlint?

contrib/atf/atf-lua/atf-lua.1
4

2020

contrib/atf/atf-lua/atf-lua.3
4

2020

Sorry, I'm going to actually abandon this soon-ish... instead of hacking it into atf, I've added support for luaunit and imported it locally.

rpokala added inline comments.
contrib/atf/atf-lua/atf-lua.1
5

Nuke the "All rights reserved." from all the files.