diff mbox

[10/11] selftests: futex: copy sub-dir test scripts for make O=dir run

Message ID de8bf636371f4318503fdf23fe51352941e739d7.1505257614.git.shuahkh@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shuah Khan Sept. 12, 2017, 11:53 p.m. UTC
For make O=dir run_tests to work, test scripts from sub-directories
need to be copied over to the object directory. Running tests from the
object directory is necessary to avoid making the source tree dirty.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/futex/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Bird, Tim Sept. 13, 2017, 6:15 p.m. UTC | #1
> -----Original Message-----
> From: Shuah on Tuesday, September 12, 2017 4:53 PM
> 
> For make O=dir run_tests to work, test scripts from sub-directories
> need to be copied over to the object directory. Running tests from the
> object directory is necessary to avoid making the source tree dirty.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  tools/testing/selftests/futex/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/futex/Makefile
> b/tools/testing/selftests/futex/Makefile
> index 7c647f619d63..9358cb210fd5 100644
> --- a/tools/testing/selftests/futex/Makefile
> +++ b/tools/testing/selftests/futex/Makefile
> @@ -11,10 +11,13 @@ all:
>  		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
>  		mkdir $$BUILD_TARGET  -p;	\
>  		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
> +		if [ -e $$DIR/$(TEST_PROGS) ]; then
> +			rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/;

Same issue with rsync here.  This could be a 'cp -a', if I'm not mistaken.

> +		fi
>  	done
> 
>  override define RUN_TESTS
> -	$(OUTPUT)/run.sh
> +	cd $(OUTPUT); ./run.sh
>  endef
> 
>  override define INSTALL_RULE
> --
> 2.11.0
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darren Hart Sept. 23, 2017, 12:36 a.m. UTC | #2
On Tue, Sep 12, 2017 at 05:53:03PM -0600, Shuah Khan wrote:
> For make O=dir run_tests to work, test scripts from sub-directories
> need to be copied over to the object directory. Running tests from the
> object directory is necessary to avoid making the source tree dirty.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
>  tools/testing/selftests/futex/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
> index 7c647f619d63..9358cb210fd5 100644
> --- a/tools/testing/selftests/futex/Makefile
> +++ b/tools/testing/selftests/futex/Makefile
> @@ -11,10 +11,13 @@ all:
>  		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
>  		mkdir $$BUILD_TARGET  -p;	\
>  		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
> +		if [ -e $$DIR/$(TEST_PROGS) ]; then
> +			rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/;

Hrm, I was going to raise a concern with adding an rsync dependency
here, but it is already used several times by lib.mk, so that isn't new.

Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
diff mbox

Patch

diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index 7c647f619d63..9358cb210fd5 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile
@@ -11,10 +11,13 @@  all:
 		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
 		mkdir $$BUILD_TARGET  -p;	\
 		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
+		if [ -e $$DIR/$(TEST_PROGS) ]; then
+			rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/;
+		fi
 	done
 
 override define RUN_TESTS
-	$(OUTPUT)/run.sh
+	cd $(OUTPUT); ./run.sh
 endef
 
 override define INSTALL_RULE