Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support oneliner interface for kernel targets #6

Closed
wants to merge 2 commits into from
Closed

Conversation

danobi
Copy link
Owner

@danobi danobi commented May 12, 2023

Before, you were required to create a vmtest.toml config file.

Now, you can run it all via command line like so:

$ vmtest -k ./bzImage-v6.2 "uname -r"
=> bzImage-v6.2
===> Booting
===> Setting up VM
===> Running command
6.2.0

With golang:

$ GOTMPDIR=. go test -exec "vmtest -k bzImage-v6.2 -- "
=> bzImage-v6.2
===> Booting
===> Setting up VM
===> Running command
--- FAIL: TestAdd (0.00s)
    lib_test.go:11: oops!
FAIL
Command failed with exit code: 1
exit status 1
FAIL    example.com/test        2.636s

With rust:

$ cat .cargo/config
[target.x86_64-unknown-linux-gnu]
runner = "vmtest -k bzImage-v6.2 -- "

$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.00s
     Running unittests src/lib.rs (target/debug/deps/rust_vmtest-46fef259e1fcd180)
=> bzImage-v6.2
===> Booting
===> Setting up VM
===> Running command

running 1 test
test tests::it_works ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests rust-vmtest

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

This closes #3.

The one-liner interface is more likely to be used for ad-hoc commands.
So showing the output of the command is likely useful.
@danobi
Copy link
Owner Author

danobi commented May 16, 2023

Merged

@danobi danobi closed this May 16, 2023
@danobi danobi deleted the oneliner branch November 2, 2023 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proposal: use vmtest as go test runner
1 participant