Skip to content

allow -out with odin test for easier test debugging #2035

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

Closed
IanLilleyT opened this issue Sep 8, 2022 · 2 comments · Fixed by #5202
Closed

allow -out with odin test for easier test debugging #2035

IanLilleyT opened this issue Sep 8, 2022 · 2 comments · Fixed by #5202
Labels

Comments

@IanLilleyT
Copy link
Contributor

Summary

When debugging tests I have to point the debugger at

{root}/source/.exe (the default test executable location)

instead of a more sane custom path like

{root}/test.exe

Allowing -out with odin test would make this possible, but I'm not sure if it's in the spirit of odin test, seeing that it was disallowed in the original commit (2bd0fd9). The fix is to remove &~ Command_test from here:

add_flag(&build_flags, BuildFlag_OutFile, str_lit("out"), BuildFlagParam_String, Command__does_build &~ Command_test);

Side note, one awkward thing about debugging tests is they get run twice: first when calling odin test, which builds and runs the test executable, and again when debugging. To get around this there would need to be a odin test-build and odin test-run similar to odin build and odin run. Right now it's not a big deal and there's benefits to having a cleaner CLI with just odin test. Anyway, that's a separate matter.

Report

Odin: dev-2022-09:0bc660c7
OS:   Windows 11 Professional (version: 21H2), build 22000.856
CPU:  Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
RAM:  32605 MiB
@Kelimion
Copy link
Member

Kelimion commented Sep 8, 2022

I'd prefer odin test <package> -build-only to splitting it up into two verbs, odin test-build & odin test-run. Too much noise for a rare use case.

@Kelimion
Copy link
Member

Kelimion commented Sep 8, 2022

And while we're at it, we could add a odin test <package> -keep-test-executable to keep the executable after running the test, with it being deleted by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants