* [PATCH i-g-t] tests/vgem_reload_basic: Include drm_lib.sh to please check target.
@ 2016-06-21 10:23 Marius Vlad
2016-06-21 10:33 ` Chris Wilson
2016-06-21 12:34 ` [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it Marius Vlad
0 siblings, 2 replies; 4+ messages in thread
From: Marius Vlad @ 2016-06-21 10:23 UTC (permalink / raw)
To: intel-gfx
Scripts are required to have it included.
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/vgem_reload_basic | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/vgem_reload_basic b/tests/vgem_reload_basic
index b150b2c..d1897b3 100755
--- a/tests/vgem_reload_basic
+++ b/tests/vgem_reload_basic
@@ -5,6 +5,9 @@
# ... we've broken this way too often :(
#
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_lib.sh
+
function unload() {
/sbin/rmmod vgem
# drm may be used by other devices (nouveau, radeon, udl, etc)
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t] tests/vgem_reload_basic: Include drm_lib.sh to please check target.
2016-06-21 10:23 [PATCH i-g-t] tests/vgem_reload_basic: Include drm_lib.sh to please check target Marius Vlad
@ 2016-06-21 10:33 ` Chris Wilson
2016-06-21 12:34 ` [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it Marius Vlad
1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2016-06-21 10:33 UTC (permalink / raw)
To: Marius Vlad; +Cc: intel-gfx
On Tue, Jun 21, 2016 at 01:23:51PM +0300, Marius Vlad wrote:
> Scripts are required to have it included.
No. This breaks the test by requiring i915.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it.
2016-06-21 10:23 [PATCH i-g-t] tests/vgem_reload_basic: Include drm_lib.sh to please check target Marius Vlad
2016-06-21 10:33 ` Chris Wilson
@ 2016-06-21 12:34 ` Marius Vlad
2016-06-21 12:42 ` Chris Wilson
1 sibling, 1 reply; 4+ messages in thread
From: Marius Vlad @ 2016-06-21 12:34 UTC (permalink / raw)
To: intel-gfx
This should allow tests/vgem_reload_basic to pass check target and it
doesn't depend of i915 being present.
v2: Do not source drm_lib.sh, only fake getopt parsing
option to again access to --list-subtests option (Chris)
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
---
tests/drm_getopt.sh | 38 ++++++++++++++++++++++++++++++++++++++
tests/drm_lib.sh | 35 ++---------------------------------
tests/vgem_reload_basic | 3 +++
3 files changed, 43 insertions(+), 33 deletions(-)
create mode 100644 tests/drm_getopt.sh
diff --git a/tests/drm_getopt.sh b/tests/drm_getopt.sh
new file mode 100644
index 0000000..a94a759
--- /dev/null
+++ b/tests/drm_getopt.sh
@@ -0,0 +1,38 @@
+# This is required for check/distcheck target as it has to --list-subtests
+# for each test. Source it if you add a new test in form of a (shell) script.
+
+# See tests/vgem_reload_basic
+
+IGT_EXIT_TIMEOUT=78
+IGT_EXIT_SKIP=77
+IGT_EXIT_SUCCESS=0
+IGT_EXIT_INVALID=79
+IGT_EXIT_FAILURE=99
+
+# hacked-up long option parsing
+for arg in $@ ; do
+ case $arg in
+ --list-subtests)
+ exit $IGT_EXIT_INVALID
+ ;;
+ --run-subtest)
+ exit $IGT_EXIT_INVALID
+ ;;
+ --debug)
+ IGT_LOG_LEVEL=debug
+ ;;
+ --help-description)
+ echo $IGT_TEST_DESCRIPTION
+ exit $IGT_EXIT_SUCCESS
+ ;;
+ --help)
+ echo "Usage: `basename $0` [OPTIONS]"
+ echo " --list-subtests"
+ echo " --run-subtest <pattern>"
+ echo " --debug"
+ echo " --help-description"
+ echo " --help"
+ exit $IGT_EXIT_SUCCESS
+ ;;
+ esac
+done
diff --git a/tests/drm_lib.sh b/tests/drm_lib.sh
index 2ba146b..c32bc68 100755
--- a/tests/drm_lib.sh
+++ b/tests/drm_lib.sh
@@ -1,38 +1,7 @@
#!/bin/sh
-IGT_EXIT_TIMEOUT=78
-IGT_EXIT_SKIP=77
-IGT_EXIT_SUCCESS=0
-IGT_EXIT_INVALID=79
-IGT_EXIT_FAILURE=99
-
-# hacked-up long option parsing
-for arg in $@ ; do
- case $arg in
- --list-subtests)
- exit $IGT_EXIT_INVALID
- ;;
- --run-subtest)
- exit $IGT_EXIT_INVALID
- ;;
- --debug)
- IGT_LOG_LEVEL=debug
- ;;
- --help-description)
- echo $IGT_TEST_DESCRIPTION
- exit $IGT_EXIT_SUCCESS
- ;;
- --help)
- echo "Usage: `basename $0` [OPTIONS]"
- echo " --list-subtests"
- echo " --run-subtest <pattern>"
- echo " --debug"
- echo " --help-description"
- echo " --help"
- exit $IGT_EXIT_SUCCESS
- ;;
- esac
-done
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_getopt.sh
skip() {
echo "$@"
diff --git a/tests/vgem_reload_basic b/tests/vgem_reload_basic
index b150b2c..a42da70 100755
--- a/tests/vgem_reload_basic
+++ b/tests/vgem_reload_basic
@@ -5,6 +5,9 @@
# ... we've broken this way too often :(
#
+SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
+. $SOURCE_DIR/drm_getopt.sh
+
function unload() {
/sbin/rmmod vgem
# drm may be used by other devices (nouveau, radeon, udl, etc)
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it.
2016-06-21 12:34 ` [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it Marius Vlad
@ 2016-06-21 12:42 ` Chris Wilson
0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2016-06-21 12:42 UTC (permalink / raw)
To: Marius Vlad; +Cc: intel-gfx
On Tue, Jun 21, 2016 at 03:34:07PM +0300, Marius Vlad wrote:
> This should allow tests/vgem_reload_basic to pass check target and it
> doesn't depend of i915 being present.
>
> v2: Do not source drm_lib.sh, only fake getopt parsing
> option to again access to --list-subtests option (Chris)
>
> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
> CC: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Might want to change the exit 1 to exit $IGT_FAILURE now.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-21 12:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21 10:23 [PATCH i-g-t] tests/vgem_reload_basic: Include drm_lib.sh to please check target Marius Vlad
2016-06-21 10:33 ` Chris Wilson
2016-06-21 12:34 ` [PATCH i-g-t v2] tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it Marius Vlad
2016-06-21 12:42 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox