linux-sg2042/tools/testing/selftests/futex/functional
Shuah Khan 211929fd3f selftests: Fix test errors related to lib.mk khdr target
Commit b2d35fa5fc ("selftests: add headers_install to lib.mk") added
khdr target to run headers_install target from the main Makefile. The
logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize
variables and include files to run headers_install from the top level
Makefile. There are a few problems with this logic.

1. Exposes top_srcdir to all tests
2. Common logic impacts all tests
3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests
   add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in
   some cases, and STATIC_LIBS in other cases. This makes this framework
   confusing to use.

The common logic that runs for all tests even when KSFT_KHDR_INSTALL
isn't defined by the test. top_srcdir is initialized to a default value
when test doesn't initialize it. It works for all tests without a sub-dir
structure and tests with sub-dir structure fail to build.

e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf

../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
make: *** No rule to make target '../../../../scripts/subarch.include'.  Stop.

There is no reason to require all tests to define top_srcdir and there is
no need to require tests to add khdr dependency using adhoc changes to
TEST_* and other variables.

Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests
that have the dependency on headers_install.

Change common logic to include khdr target define and "all" target with
dependency on khdr when KSFT_KHDR_INSTALL is defined.

Only tests that have dependency on headers_install have to define just
the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to
specify khdr dependency in the test Makefiles.

Fixes: b2d35fa5fc ("selftests: add headers_install to lib.mk")
Cc: stable@vger.kernel.org
Signed-off-by: Shuah Khan <shuah@kernel.org>
2018-12-13 16:51:30 -07:00
..
.gitignore selftests/futex: Add .gitignore 2015-05-26 15:58:09 -06:00
Makefile selftests: Fix test errors related to lib.mk khdr target 2018-12-13 16:51:30 -07:00
futex_requeue_pi.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_requeue_pi_mismatched_ops.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_requeue_pi_signal_restart.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_wait_private_mapped_file.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_wait_timeout.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_wait_uninitialized_heap.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
futex_wait_wouldblock.c selftests: futex: convert test to use ksft TAP13 framework 2017-08-16 17:45:00 -06:00
run.sh selftests/futex: Check ANSI terminal color support 2016-10-11 07:38:36 -06:00