selftests: futex: copy sub-dir test scripts for make O=dir run
authorShuah Khan <shuahkh@osg.samsung.com>
Tue, 12 Sep 2017 01:11:07 +0000 (19:11 -0600)
committerShuah Khan <shuahkh@osg.samsung.com>
Mon, 25 Sep 2017 16:08:49 +0000 (10:08 -0600)
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>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/futex/Makefile

index 7c647f619d63faf3eff4c135c1b302565b7f78d5..9358cb210fd54f08ea790fec28c55627faa09691 100644 (file)
@@ -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