Replies: 2 comments 4 replies
-
One common approach assumes every executable has one source named the same as the test, and is run without arguments: tests = [
'foo',
'bar',
'baz',
]
foreach t: tests
exe = executable(t, t+'.c', dependencies: [commondep])
test(t, exe)
endforeach |
Beta Was this translation helpful? Give feedback.
2 replies
-
I don't see anything wrong with that. You may use the same name for the executable and the test if it fits for you. But there are cases where you may want to create different test targets from the same executable (passing different arguments to the executable for instance), and this is one reason why a distinct test name can be useful. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have hundreds of tests, and have ended up with this pattern:
However, this pattern requires me to choose 3 different names (variable, test name, exe name). In practice I really only think it should be necessary to name the executable. For the variable I just re-use the same name
t
everhwere, which I assume is ok, but feels awkward.I'm curious if there is a better pattern to use here?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions