tests/drm_lib.sh: Extract fake getopt options so it can sourced into tests that require it.

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)

v3: Forget to place the script in Makefile.sources, otherwise
distcheck will not copy it.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
[Chris: Replace exit 1 with exit $IGT_EXIT_FAILURE]
CC: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
4 files changed