diff mbox

[i-g-t,2/2] tests: use standard install prefix for programs, scripts and data

Message ID 1428501387-9043-2-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood April 8, 2015, 1:56 p.m. UTC
Use the pkglibexec and pkgdata prefixes rather than setting bindir and
datadir. This also removes the extra 'tests' directory from within the
package libexec and data directories.

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tests/Makefile.am      | 15 +++++++++++----
 tests/Makefile.sources | 15 ---------------
 2 files changed, 11 insertions(+), 19 deletions(-)

Comments

Joonas Lahtinen April 9, 2015, 6:45 a.m. UTC | #1
On ke, 2015-04-08 at 14:56 +0100, Thomas Wood wrote:
> Use the pkglibexec and pkgdata prefixes rather than setting bindir and
> datadir. This also removes the extra 'tests' directory from within the
> package libexec and data directories.
> 
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> ---
>  tests/Makefile.am      | 15 +++++++++++----
>  tests/Makefile.sources | 15 ---------------
>  2 files changed, 11 insertions(+), 19 deletions(-)
> 
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index d6de373..dc864f4 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -27,18 +27,25 @@ multi-tests.txt: Makefile.sources
>  	@echo ${multi_kernel_tests} >> $@
>  	@echo END TESTLIST >> $@
>  
> -igt_tests_bin_PROGRAMS += \
> +noinst_PROGRAMS = \
> +	$(HANG) \
> +	$(TESTS_testsuite) \
> +	$(NULL)
> +
> +pkglibexec_PROGRAMS = \
> +	gem_alive \
> +	gem_stress \
>  	$(TESTS_progs) \
>  	$(TESTS_progs_M) \
>  	$(NULL)

Reasoning for the tests directory was that if the tests just sit under
pkglibexec, they might be mistaken for tools (as the i-g-t package name
suggests) by packagers or really anybody.

If it's so important not to have the tests directory, I'd rather suffix
all the programs with "_test" during build. It would cause some
cascading changes too, so why do you want to get rid of the tests
directory in the first place?

>  
> -dist_igt_tests_bin_SCRIPTS = \
> +dist_pkglibexec_SCRIPTS = \
>  	$(TESTS_scripts) \
>  	$(TESTS_scripts_M) \
>  	$(scripts) \
>  	$(NULL)
>  

This one was giving me complaints with automake 1.14.1 that SCRIPTS
don't belong straight to pkglibexec, so this would have to be kept
indirect like it is, be it with tests directory or not.

> -dist_igt_tests_data_DATA = \
> +dist_pkgdata_DATA = \
>  	$(IMAGES) \
>  	$(NULL)
>  
> @@ -52,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
>  	-I$(srcdir)/../lib \
>  	-include "$(srcdir)/../lib/check-ndebug.h" \
>  	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
> -	-DIGT_DATADIR=\""$(igt_tests_datadir)"\" \
> +	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
>  	$(LIBUNWIND_CFLAGS) \
>  	$(NULL)
>  
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 59a06e9..4bf11bf 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -1,18 +1,3 @@
> -igt_tests_bindir = $(pkglibexecdir)/tests
> -igt_tests_datadir = $(pkgdatadir)/tests
> -
> -noinst_PROGRAMS = \
> -	$(HANG) \
> -	$(TESTS_testsuite) \
> -	$(NULL)
> -
> -igt_tests_bin_PROGRAMS = \
> -	gem_alive \
> -	gem_stress \
> -	$(TESTS_progs) \
> -	$(TESTS_progs_M) \
> -	$(NULL)
> -
>  NOUVEAU_TESTS_M = \
>  	prime_nv_api \
>  	prime_nv_pcopy \
Daniel Vetter April 9, 2015, 12:21 p.m. UTC | #2
On Thu, Apr 09, 2015 at 09:45:13AM +0300, Joonas Lahtinen wrote:
> On ke, 2015-04-08 at 14:56 +0100, Thomas Wood wrote:
> > Use the pkglibexec and pkgdata prefixes rather than setting bindir and
> > datadir. This also removes the extra 'tests' directory from within the
> > package libexec and data directories.
> > 
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> > ---
> >  tests/Makefile.am      | 15 +++++++++++----
> >  tests/Makefile.sources | 15 ---------------
> >  2 files changed, 11 insertions(+), 19 deletions(-)
> > 
> > diff --git a/tests/Makefile.am b/tests/Makefile.am
> > index d6de373..dc864f4 100644
> > --- a/tests/Makefile.am
> > +++ b/tests/Makefile.am
> > @@ -27,18 +27,25 @@ multi-tests.txt: Makefile.sources
> >  	@echo ${multi_kernel_tests} >> $@
> >  	@echo END TESTLIST >> $@
> >  
> > -igt_tests_bin_PROGRAMS += \
> > +noinst_PROGRAMS = \
> > +	$(HANG) \
> > +	$(TESTS_testsuite) \
> > +	$(NULL)
> > +
> > +pkglibexec_PROGRAMS = \
> > +	gem_alive \
> > +	gem_stress \
> >  	$(TESTS_progs) \
> >  	$(TESTS_progs_M) \
> >  	$(NULL)
> 
> Reasoning for the tests directory was that if the tests just sit under
> pkglibexec, they might be mistaken for tools (as the i-g-t package name
> suggests) by packagers or really anybody.
> 
> If it's so important not to have the tests directory, I'd rather suffix
> all the programs with "_test" during build. It would cause some
> cascading changes too, so why do you want to get rid of the tests
> directory in the first place?

Imo libexec is a sufficient hint that this is internal stuff that we don't
need to add a prefix or subdir.
-Daniel
Thomas Wood April 9, 2015, 3:56 p.m. UTC | #3
On 9 April 2015 at 07:45, Joonas Lahtinen
<joonas.lahtinen@linux.intel.com> wrote:
> On ke, 2015-04-08 at 14:56 +0100, Thomas Wood wrote:
>> Use the pkglibexec and pkgdata prefixes rather than setting bindir and
>> datadir. This also removes the extra 'tests' directory from within the
>> package libexec and data directories.
>>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
>> ---
>>  tests/Makefile.am      | 15 +++++++++++----
>>  tests/Makefile.sources | 15 ---------------
>>  2 files changed, 11 insertions(+), 19 deletions(-)
>>
>> diff --git a/tests/Makefile.am b/tests/Makefile.am
>> index d6de373..dc864f4 100644
>> --- a/tests/Makefile.am
>> +++ b/tests/Makefile.am
>> @@ -27,18 +27,25 @@ multi-tests.txt: Makefile.sources
>>       @echo ${multi_kernel_tests} >> $@
>>       @echo END TESTLIST >> $@
>>
>> -igt_tests_bin_PROGRAMS += \
>> +noinst_PROGRAMS = \
>> +     $(HANG) \
>> +     $(TESTS_testsuite) \
>> +     $(NULL)
>> +
>> +pkglibexec_PROGRAMS = \
>> +     gem_alive \
>> +     gem_stress \
>>       $(TESTS_progs) \
>>       $(TESTS_progs_M) \
>>       $(NULL)
>
> Reasoning for the tests directory was that if the tests just sit under
> pkglibexec, they might be mistaken for tools (as the i-g-t package name
> suggests) by packagers or really anybody.

I think pklibexec is sufficient since user tools ought to be install
in bin anyway. The test list should also be installed in pkgdatadir to
identify the test binaries.

>
> If it's so important not to have the tests directory, I'd rather suffix
> all the programs with "_test" during build. It would cause some
> cascading changes too, so why do you want to get rid of the tests
> directory in the first place?
>
>>
>> -dist_igt_tests_bin_SCRIPTS = \
>> +dist_pkglibexec_SCRIPTS = \
>>       $(TESTS_scripts) \
>>       $(TESTS_scripts_M) \
>>       $(scripts) \
>>       $(NULL)
>>
>
> This one was giving me complaints with automake 1.14.1 that SCRIPTS
> don't belong straight to pkglibexec, so this would have to be kept
> indirect like it is, be it with tests directory or not.

I also have automake 1.14.1 and it doesn't seem to complain. Does it
prevent automake from completing successfully?


>
>> -dist_igt_tests_data_DATA = \
>> +dist_pkgdata_DATA = \
>>       $(IMAGES) \
>>       $(NULL)
>>
>> @@ -52,7 +59,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
>>       -I$(srcdir)/../lib \
>>       -include "$(srcdir)/../lib/check-ndebug.h" \
>>       -DIGT_SRCDIR=\""$(abs_srcdir)"\" \
>> -     -DIGT_DATADIR=\""$(igt_tests_datadir)"\" \
>> +     -DIGT_DATADIR=\""$(pkgdatadir)"\" \
>>       $(LIBUNWIND_CFLAGS) \
>>       $(NULL)
>>
>> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
>> index 59a06e9..4bf11bf 100644
>> --- a/tests/Makefile.sources
>> +++ b/tests/Makefile.sources
>> @@ -1,18 +1,3 @@
>> -igt_tests_bindir = $(pkglibexecdir)/tests
>> -igt_tests_datadir = $(pkgdatadir)/tests
>> -
>> -noinst_PROGRAMS = \
>> -     $(HANG) \
>> -     $(TESTS_testsuite) \
>> -     $(NULL)
>> -
>> -igt_tests_bin_PROGRAMS = \
>> -     gem_alive \
>> -     gem_stress \
>> -     $(TESTS_progs) \
>> -     $(TESTS_progs_M) \
>> -     $(NULL)
>> -
>>  NOUVEAU_TESTS_M = \
>>       prime_nv_api \
>>       prime_nv_pcopy \
diff mbox

Patch

diff --git a/tests/Makefile.am b/tests/Makefile.am
index d6de373..dc864f4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -27,18 +27,25 @@  multi-tests.txt: Makefile.sources
 	@echo ${multi_kernel_tests} >> $@
 	@echo END TESTLIST >> $@
 
-igt_tests_bin_PROGRAMS += \
+noinst_PROGRAMS = \
+	$(HANG) \
+	$(TESTS_testsuite) \
+	$(NULL)
+
+pkglibexec_PROGRAMS = \
+	gem_alive \
+	gem_stress \
 	$(TESTS_progs) \
 	$(TESTS_progs_M) \
 	$(NULL)
 
-dist_igt_tests_bin_SCRIPTS = \
+dist_pkglibexec_SCRIPTS = \
 	$(TESTS_scripts) \
 	$(TESTS_scripts_M) \
 	$(scripts) \
 	$(NULL)
 
-dist_igt_tests_data_DATA = \
+dist_pkgdata_DATA = \
 	$(IMAGES) \
 	$(NULL)
 
@@ -52,7 +59,7 @@  AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS)\
 	-I$(srcdir)/../lib \
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
-	-DIGT_DATADIR=\""$(igt_tests_datadir)"\" \
+	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
 	$(LIBUNWIND_CFLAGS) \
 	$(NULL)
 
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 59a06e9..4bf11bf 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -1,18 +1,3 @@ 
-igt_tests_bindir = $(pkglibexecdir)/tests
-igt_tests_datadir = $(pkgdatadir)/tests
-
-noinst_PROGRAMS = \
-	$(HANG) \
-	$(TESTS_testsuite) \
-	$(NULL)
-
-igt_tests_bin_PROGRAMS = \
-	gem_alive \
-	gem_stress \
-	$(TESTS_progs) \
-	$(TESTS_progs_M) \
-	$(NULL)
-
 NOUVEAU_TESTS_M = \
 	prime_nv_api \
 	prime_nv_pcopy \