On 12/01/2014 08:52 PM, Mike Holmes wrote:
On 1 December 2014 at 12:05, Taras Kondratiuk
<[email protected] <mailto:[email protected]>> wrote:
+
+int main(void)
+{
+ int ret;
+
+ printf("\tODP API version: %s\n", odp_version_api_str());
+ printf("\tODP implementation version: %s\n",
odp_version_impl_str());
I don't think this will work long term.
I think that we need to view a test_suite as an odp application, and any
number of suites could be run in any order.
We dont want to focus on the batch mode main() because when we migrate
to a library there will not be a main when calling tests interactively
if so desired. I expect we will have a wrapper batch mode main() that
will call all the suites however so that "make check" still has
something to call.
I can't agree on the next points:
1. "test suite is an ODP application". It is *not*, because they are
executed as a part of a single application. According to a current
specification odp_global_init() is called only *once* per application.
If you really want to allow several global_init(), then this use case
should be mentioned in the specification. But you should understand,
that this may significantly complicate implementation. For example
linux-generic don't have odp_term_global() and it works fine because OS
takes care about resources. If we allow several odp_global_init()
calls, then implementation have to carefully clear resources by itself.
2. "when we migrate to a library there will not be a main()". There
will be main() which select either batch or interactive mode.
I think a suite_init should perform the global init and suite_finalize
should do a odp_finalize. To that end with a suite being generally
smallest unit of testing that can be run, it should also print up what
it is being run on - the prints above. I don't see a lot of use for
test_init because I don't think we want to be doing odp_global_init per
test although you could argue every test should be as independent as
possible.
Those printfs prints API and implementation versions which are
attributes of library, but not a testsuite. That's why they should be
print only once per test application start, but not on every testsuite
execution.
I know there is an argument that HW vs SW implementations change how
completely calling odp global finalize really creates a clean
environment for the next test, but to my mind if suites = odp_apps they
should work, OPNFV will require clean teardown without reboot.
That's the point where we disagree "suites = odp app". I expect a lot of
issues with vendor's SDKs, because this is not a normal usecase for them
to reinitialize environment in the same process. They may rely for
example on zero'ed static variables which will have some values on a
second init.
I'd like to get comments from Bala and Alex here.
With a good argument to keep odp calls in main I could be swayed but
right now I think it needs to be in the init and finalize function for a
suite.
Please see above why they can't be there.
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp