[libcamera-devel,v3,6/6] tests: Remove IPA_MODULE_PATH environment variable

Message ID 20200220165704.23600-7-kieran.bingham@ideasonboard.com
State Superseded
Headers show
Series
  • Support loading IPAs from the build tree
Related show

Commit Message

Kieran Bingham Feb. 20, 2020, 4:57 p.m. UTC
The tests declare a hard-coded LIBCAMERA_IPA_MODULE_PATH to allow tests
to run from the test-suite.

This requires tests to be run only from the root of the build directory,
otherwise (for example, by running in their local directory) they will
not be able to correctly locate the IPA modules.

Now that the build path for the IPA manager is determined at runtime we
can remove the redundant setting of the LIBCAMERA_IPA_MODULE_PATH for
tests.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 test/libtest/test.cpp | 4 ----
 1 file changed, 4 deletions(-)

Comments

Laurent Pinchart Feb. 20, 2020, 9:26 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Thu, Feb 20, 2020 at 04:57:04PM +0000, Kieran Bingham wrote:
> The tests declare a hard-coded LIBCAMERA_IPA_MODULE_PATH to allow tests
> to run from the test-suite.
> 
> This requires tests to be run only from the root of the build directory,
> otherwise (for example, by running in their local directory) they will
> not be able to correctly locate the IPA modules.
> 
> Now that the build path for the IPA manager is determined at runtime we
> can remove the redundant setting of the LIBCAMERA_IPA_MODULE_PATH for
> tests.

\o/

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  test/libtest/test.cpp | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
> index 333d2160e276..6cd3fbe6df06 100644
> --- a/test/libtest/test.cpp
> +++ b/test/libtest/test.cpp
> @@ -21,10 +21,6 @@ int Test::execute()
>  {
>  	int ret;
>  
> -	ret = setenv("LIBCAMERA_IPA_MODULE_PATH", "src/ipa", 1);
> -	if (ret)
> -		return errno;
> -
>  	ret = setenv("LIBCAMERA_IPA_PROXY_PATH", "src/libcamera/proxy/worker", 1);
>  	if (ret)
>  		return errno;

Will we need to do the same for the proxy path ? :-)
Kieran Bingham Feb. 21, 2020, 12:40 p.m. UTC | #2
On 20/02/2020 21:26, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Thu, Feb 20, 2020 at 04:57:04PM +0000, Kieran Bingham wrote:
>> The tests declare a hard-coded LIBCAMERA_IPA_MODULE_PATH to allow tests
>> to run from the test-suite.
>>
>> This requires tests to be run only from the root of the build directory,
>> otherwise (for example, by running in their local directory) they will
>> not be able to correctly locate the IPA modules.
>>
>> Now that the build path for the IPA manager is determined at runtime we
>> can remove the redundant setting of the LIBCAMERA_IPA_MODULE_PATH for
>> tests.
> 
> \o/
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>> ---
>>  test/libtest/test.cpp | 4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
>> index 333d2160e276..6cd3fbe6df06 100644
>> --- a/test/libtest/test.cpp
>> +++ b/test/libtest/test.cpp
>> @@ -21,10 +21,6 @@ int Test::execute()
>>  {
>>  	int ret;
>>  
>> -	ret = setenv("LIBCAMERA_IPA_MODULE_PATH", "src/ipa", 1);
>> -	if (ret)
>> -		return errno;
>> -
>>  	ret = setenv("LIBCAMERA_IPA_PROXY_PATH", "src/libcamera/proxy/worker", 1);
>>  	if (ret)
>>  		return errno;
> 
> Will we need to do the same for the proxy path ? :-)


Yes, but I haven't touched that yet until we can get the 'method' done
right.

I had considered leaving this as a task for any new comer or workshop
too ...
Laurent Pinchart Feb. 21, 2020, 1:04 p.m. UTC | #3
Hi Kieran,

On Fri, Feb 21, 2020 at 12:40:12PM +0000, Kieran Bingham wrote:
> On 20/02/2020 21:26, Laurent Pinchart wrote:
> > On Thu, Feb 20, 2020 at 04:57:04PM +0000, Kieran Bingham wrote:
> >> The tests declare a hard-coded LIBCAMERA_IPA_MODULE_PATH to allow tests
> >> to run from the test-suite.
> >>
> >> This requires tests to be run only from the root of the build directory,
> >> otherwise (for example, by running in their local directory) they will
> >> not be able to correctly locate the IPA modules.
> >>
> >> Now that the build path for the IPA manager is determined at runtime we
> >> can remove the redundant setting of the LIBCAMERA_IPA_MODULE_PATH for
> >> tests.
> > 
> > \o/
> > 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> >> ---
> >>  test/libtest/test.cpp | 4 ----
> >>  1 file changed, 4 deletions(-)
> >>
> >> diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
> >> index 333d2160e276..6cd3fbe6df06 100644
> >> --- a/test/libtest/test.cpp
> >> +++ b/test/libtest/test.cpp
> >> @@ -21,10 +21,6 @@ int Test::execute()
> >>  {
> >>  	int ret;
> >>  
> >> -	ret = setenv("LIBCAMERA_IPA_MODULE_PATH", "src/ipa", 1);
> >> -	if (ret)
> >> -		return errno;
> >> -
> >>  	ret = setenv("LIBCAMERA_IPA_PROXY_PATH", "src/libcamera/proxy/worker", 1);
> >>  	if (ret)
> >>  		return errno;
> > 
> > Will we need to do the same for the proxy path ? :-)
> 
> Yes, but I haven't touched that yet until we can get the 'method' done
> right.
> 
> I had considered leaving this as a task for any new comer or workshop
> too ...

Works for me. Please just make sure to record it.

Patch

diff --git a/test/libtest/test.cpp b/test/libtest/test.cpp
index 333d2160e276..6cd3fbe6df06 100644
--- a/test/libtest/test.cpp
+++ b/test/libtest/test.cpp
@@ -21,10 +21,6 @@  int Test::execute()
 {
 	int ret;
 
-	ret = setenv("LIBCAMERA_IPA_MODULE_PATH", "src/ipa", 1);
-	if (ret)
-		return errno;
-
 	ret = setenv("LIBCAMERA_IPA_PROXY_PATH", "src/libcamera/proxy/worker", 1);
 	if (ret)
 		return errno;