Skip to content
Snippets Groups Projects
Commit 75e7a3a8 authored by Marius Vlad's avatar Marius Vlad
Browse files

autotools/: Allow check target to be invoked w/o the need to issue a build.


We need to have the test list generated before running the check target.
Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to
building the tests and execute the script.

This would allow cleaning followed by a make check.

Also assembler/ directory needs also to be adjusted in order for this
to work.

Kept the possibility to invoke tests/igt_command_line.sh to determine
which test is failing.

Signed-off-by: default avatarMarius Vlad <marius.c.vlad@intel.com>
Url: https://patchwork.freedesktop.org/series/6539/


Reviewed-By: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 7213c3e0
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,112 @@ intel_gen4disasm_LDADD = libbrw.la ...@@ -47,8 +47,112 @@ intel_gen4disasm_LDADD = libbrw.la
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = intel-gen4asm.pc pkgconfig_DATA = intel-gen4asm.pc
CLEANFILES = $(BUILT_SOURCES) check_SCRIPTS = test/run-test.sh
TESTS = \
test/mov \
test/frc \
test/rndd \
test/rndu \
test/rnde \
test/rnde-intsrc \
test/rndz \
test/lzd \
test/not \
test/immediate \
$(NULL)
# Tests that are expected to fail because they contain some inccorect code.
XFAIL_TESTS =
# Those tests were already failing when the assembler was imported from
# the intel-gen4asm git repository:
# http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
# We disable them "for now" as a workaround to be able to release i-g-t
disabled_tests = \
test/declare \
test/jmpi \
test/if \
test/iff \
test/while \
test/else \
test/break \
test/cont \
test/halt \
test/wait \
test/endif \
$(NULL)
disabled_xfail_tests = \
test/rnde-intsrc \
$(NULL)
TESTDATA = \
test/mov.expected \
test/mov.g4a \
test/frc.expected \
test/frc.g4a \
test/rndd.expected \
test/rndd.g4a \
test/rndu.expected \
test/rndu.g4a \
test/rnde.expected \
test/rnde.g4a \
test/rnde-intsrc.expected \
test/rnde-intsrc.g4a \
test/rndz.expected \
test/rndz.g4a \
test/lzd.expected \
test/lzd.g4a \
test/not.expected \
test/not.g4a \
test/jmpi.expected \
test/jmpi.g4a \
test/if.expected \
test/if.g4a \
test/iff.expected \
test/iff.g4a \
test/while.expected \
test/while.g4a \
test/else.expected \
test/else.g4a \
test/break.expected \
test/break.g4a \
test/cont.expected \
test/cont.g4a \
test/halt.expected \
test/halt.g4a \
test/wait.expected \
test/wait.g4a \
test/endif.expected \
test/endif.g4a \
test/declare.expected \
test/declare.g4a \
test/immediate.g4a \
test/immediate.expected \
$(NULL)
test_EXTRA_DIST = \
${TESTDATA} \
test/run-test.sh \
$(NULL)
$(TESTS): test/run-test.sh
sed "s|TEST|$@|g" ${srcdir}/test/run-test.sh > $@
chmod +x $@
test_CLEANFILES = \
test/*.out \
${TESTS} \
$(NULL)
CLEANFILES = $(BUILT_SOURCES) \
$(test_CLEANFILES) \
$(NULL)
EXTRA_DIST = \ EXTRA_DIST = \
README \ README \
TODO \ TODO \
intel-gen4asm.pc.in intel-gen4asm.pc.in \
$(test_EXTRA_DIST) \
$(NULL)
check_SCRIPTS = run-test.sh
TESTS_ENVIRONMENT = top_builddir=${top_builddir}
TESTS = \
mov \
frc \
rndd \
rndu \
rnde \
rnde-intsrc \
rndz \
lzd \
not \
immediate
# Tests that are expected to fail because they contain some inccorect code.
XFAIL_TESTS =
# Those tests were already failing when the assembler was imported from
# the intel-gen4asm git repository:
# http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
# We disable them "for now" as a workaround to be able to release i-g-t
disabled_tests = \
declare \
jmpi \
if \
iff \
while \
else \
break \
cont \
halt \
wait \
endif
disabled_xfail_tests = \
rnde-intsrc
TESTDATA = \
mov.expected \
mov.g4a \
frc.expected \
frc.g4a \
rndd.expected \
rndd.g4a \
rndu.expected \
rndu.g4a \
rnde.expected \
rnde.g4a \
rnde-intsrc.expected \
rnde-intsrc.g4a \
rndz.expected \
rndz.g4a \
lzd.expected \
lzd.g4a \
not.expected \
not.g4a \
jmpi.expected \
jmpi.g4a \
if.expected \
if.g4a \
iff.expected \
iff.g4a \
while.expected \
while.g4a \
else.expected \
else.g4a \
break.expected \
break.g4a \
cont.expected \
cont.g4a \
halt.expected \
halt.g4a \
wait.expected \
wait.g4a \
endif.expected \
endif.g4a \
declare.expected \
declare.g4a \
immediate.g4a \
immediate.expected
EXTRA_DIST = \
${TESTDATA} \
run-test.sh
$(TESTS): run-test.sh
sed "s|TEST|$@|g" ${srcdir}/run-test.sh > $@
chmod +x $@
CLEANFILES = \
*.out \
${TESTS}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
SRCDIR=${srcdir-`pwd`} SRCDIR=${srcdir-`pwd`}
BUILDDIR=${top_builddir-`pwd`} BUILDDIR=${top_builddir-`pwd`}
${BUILDDIR}/assembler/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a ${BUILDDIR}/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else
echo "Output comparison for TEST" echo "Output comparison for TEST"
diff -u ${SRCDIR}/TEST.expected TEST.out diff -u ${SRCDIR}/TEST.expected TEST.out
......
...@@ -7,8 +7,6 @@ AM_TESTS_ENVIRONMENT = \ ...@@ -7,8 +7,6 @@ AM_TESTS_ENVIRONMENT = \
top_builddir=$(top_builddir) \ top_builddir=$(top_builddir) \
top_srcdir=$(top_srcdir) top_srcdir=$(top_srcdir)
EXTRA_DIST = $(check_SCRIPTS)
AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
-I$(srcdir)/../.. \ -I$(srcdir)/../.. \
-I$(srcdir)/.. \ -I$(srcdir)/.. \
......
...@@ -15,10 +15,6 @@ check_prog_list = \ ...@@ -15,10 +15,6 @@ check_prog_list = \
igt_exit_handler \ igt_exit_handler \
$(NULL) $(NULL)
check_script_list = \
igt_command_line.sh \
$(NULL)
TESTS = \ TESTS = \
$(check_prog_list) \ $(check_prog_list) \
$(check_script_list) \ $(check_script_list) \
......
...@@ -50,7 +50,7 @@ all-local: .gitignore ...@@ -50,7 +50,7 @@ all-local: .gitignore
pkgdata_DATA = test-list.txt test-list-full.txt pkgdata_DATA = test-list.txt test-list-full.txt
EXTRA_PROGRAMS = $(HANG) EXTRA_PROGRAMS = $(HANG)
EXTRA_DIST = $(common_files) EXTRA_DIST = $(common_files) $(check_SCRIPTS)
CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore CLEANFILES = $(EXTRA_PROGRAMS) test-list.txt test-list-full.txt .gitignore
......
...@@ -304,6 +304,12 @@ testdisplay_SOURCES = \ ...@@ -304,6 +304,12 @@ testdisplay_SOURCES = \
TESTS_progs += testdisplay TESTS_progs += testdisplay
check_SCRIPTS = igt_command_line.sh \
$(NULL)
TESTS = $(check_SCRIPTS) \
$(NULL)
common_files = \ common_files = \
eviction_common.c \ eviction_common.c \
$(NULL) $(NULL)
...@@ -26,13 +26,18 @@ ...@@ -26,13 +26,18 @@
# #
if [ -z "$top_builddir" ]; then if [ -z "$top_builddir" ]; then
top_builddir="$(dirname $0)/../.." top_builddir="$(dirname $0)"
fi fi
TESTLIST=`cat $top_builddir/tests/test-list.txt` # allow to run this script from top directory
TESTLIST=`cat $top_builddir/test-list.txt`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: Could not read test lists" # distcheck requires this hack
exit 99 TESTLIST=$(cat test-list.txt)
if [ $? -ne 0 ]; then
echo "Error: Could not read test lists"
exit 99
fi
fi fi
fail () { fail () {
...@@ -45,11 +50,12 @@ for test in $TESTLIST; do ...@@ -45,11 +50,12 @@ for test in $TESTLIST; do
continue continue
fi fi
if [ -x $top_builddir/tests/$test ]; then # top_builddir is empty for distcheck
test=$top_builddir/tests/$test test=$top_builddir/$test
else
# if the test is a script, it will be in $srcdir # distcheck requires this hack
test=$top_srcdir/tests/$test if [ ! -x "$test" ]; then
continue
fi fi
echo "$test:" echo "$test:"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment