summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
AgeCommit message (Collapse)Author
2019-05-07lib/igt_core: Just use igt_can_fail() in __igt_run_subtest()Lyude Paul
That's what it's there for. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07Use gettid() wrapper everywhereLyude Paul
Currently we have multiple different parts of IGT that define their own wrapper around the gettid() syscall (or just call it directly with no wrapper). Additionally, add the appropriate #includes for igt_aux.h to make sure syscall() is available. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-04-18lib/igt_dummyload: Get rid of 'batch' on spinner accessorsMika Kuoppala
There is no guarantee that spinners are and will be implemented using batches. As we have igt_spin_t, manipulate it through igt_spin_* functions consistently and hide the batch nature. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-04-10lib: Reset errno to 0 after isattyArkadiusz Hiler
Since igt_assert family of functions logs last errno we get a lot of those: "Last errno: 25, Inappropriate ioctl for device" isatty() seems to be the biggest offender in that area, so this patch should limit amount of confusing messages significantly. Cc: Martin Peres <martin.peres@linux.intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-02-21lib: disallow fixtures/subtest groups in simple testsDaniel Vetter
They don't work, see igt_can_fail(). We already check for test_with_subtests in igt_subtest. Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Drop IGT_EXIT_TIMEOUTDaniel Vetter
We use the timeout status for when the runner had to kill a testcase, which indicates a more sever issue than an operation failing that we expected to complete within seconds. Since it's unused, drop it. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Drop igt_child_doneDaniel Vetter
Added in commit 054eb1abecd1cce2e4ee0516f3ff8a67a35dca22 Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Date: Thu Mar 30 14:32:29 2017 +0100 benchmarks/gem_wsim: Command submission workload simulator but since then the only user was lost. Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Make sure we leak no child processesDaniel Vetter
There's a lot more ways to leak children than igt_fork, some even handrolled. So check for that. Also have a nice littel testcase for that too. v2: Don't hang if there's a leaked child process (Chris). Has the added benefit that my library unit test also gets faster! v3: Rebase. Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-02-15lib: Don't leak children in igt_waitchildren_timeoutDaniel Vetter
Instead of cleaning up the mess in igt_exit make sure we don't even let it out of the container. See also commit 754876378d6c9b2775e8c07b4d16f9878c55949f Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 26 22:11:10 2016 +0000 igt/gem_sync: Enforce a timeout of 20s which added this helper. To make sure that everyone follows the rules, add an assert. We're keeping the cleanup code as a failsafe, and because it speeds up the testcase I'm following up with. v2: Chris pointed out that my original patch did nothing. Which I didn't catch because my testcase was also broken. Unfortunately this means we need to open code part of the waiting. v3: The 2nd __igt_waitchildren() isn't necessary, __igt_waitchildren recovers from EINTR already and keeps waiting (Chris Wilson). v4: Change the timeout signal vs waitchildren logic to be race-free (Chris). This changes the exit code for a timeout from IGT_EXIT_FAILURE to SIGKILL + 128. v5: Clarify the docs (Chris). Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2019-01-30lib: Skip unused fork helpersChris Wilson
Skip trying to stop unused fork helpers to avoid the various asserts that they were running and didn't die early. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109468 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-01-21lib/igt_core: Initialize fds in igt_system_quietPetri Latvala
This avoids calling close() with uninitialized ints if some dup() calls succeed and others don't. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2019-01-21lib/igt_core: Handle all failures to read .igtrcPetri Latvala
Parse error is not the only way to fail loading the file. A common other error is the file not existing. Handle all failures to read .igtrc by releasing the key store immediately. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2019-01-21lib/igt_core: Assert that optarg is presentPetri Latvala
If getopt_long is told an argument is required, it will give it. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-01-21lib: Avoid memcpying 0 bytes from NULLPetri Latvala
The behaviour of memcpying 0 bytes from NULL is semantically sound, but still undefined behaviour. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-12-20Add support for forcing a specific driverPetri Latvala
This commit adds a new option for forcing the use of a specific driver indicated via an environment variable. v2 (Petri): - Use an environment variable instead of command line - Refactor the loop in __open_device - Don't try to load kernel modules v3 (Petri): - Rebase and adjust to the driver loading changes Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: gustavo@padovan.org Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2018-11-27lib: Show stacktrace when terminated by runnerChris Wilson
The igt_runner sends a SIGTERM to ask the test to cleanly exit upon an external timeout. It is useful to know what the code was doing when the timeout occurred, just in case it was unexpectedly stuck. However, since we use SIGTERM internally to marshal helper processes, we want to keep SIGTERM quiet, and so opt to use SIGQUIT for the timeout request instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-11-05docs: Remove incorrect reference to i915Petri Latvala
While true that subtest listing doesn't require the i915 driver, same applies to any driver or platform. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-30lib/core: Use libdw to decode stack trace with debugging symbols, v2.Maarten Lankhorst
libdw is a new dependency built from the elfutils package. It provides us a way to generate line numbers and file names from the instruction pointer. elfutils is LGPLv3 or GPLv2, so it's ok to link against it. Before: IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64) Starting subtest: fail-result (meta_test:29661) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94: (meta_test:29661) CRITICAL: Failed assertion: result == 1 (meta_test:29661) CRITICAL: error: 0 != 1 Stack trace: #0 [__igt_fail_assert+0x20a] #1 [test_result+0x7a] #2 [__real_main120+0x240] #3 [main+0x4a] #4 (../csu/libc-start.c) __libc_start_main:344 #5 [_start+0x2a] After: IGT-Version: 1.23-g8ae86abd419d (x86_64) (Linux: 4.16.0-1-amd64 x86_64) Starting subtest: fail-result (meta_test:1357) CRITICAL: Test assertion failure function test_result, file ../tests/meta_test.c:94: (meta_test:1357) CRITICAL: Failed assertion: result == 1 (meta_test:1357) CRITICAL: error: 0 != 1 Stack trace: #0 ../lib/igt_core.c:1467 __igt_fail_assert() #1 ../tests/meta_test.c:95 test_result() #2 ../tests/meta_test.c:137 __real_main120() #3 ../tests/meta_test.c:120 main() #4 ../csu/libc-start.c:344 __libc_start_main() #5 [_start+0x2a] Changes since v1: - Add libdw dependency to readme. - Change backtrace format slightly. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Add description about libdw in commit msg, name -> dwfl_name] Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-09lib: Export igt_gettime and igt_time_elapsedPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09lib: Print subtest starting/ending line to stderr tooPetri Latvala
when instructed via the environment. This is needed for the new test runner to properly assign stderr output to the correct subtest. v2: Print the subtest result from skip_subtests_henceforth handling also to stderr. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-27lib/igt_core: Fix typoGwan-gyeong Mun
"overridden" was misspelled as "overriden". Fix it. Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2018-07-12lib/igt_core: fix check for running under gdbLucas De Marchi
Properly check for errors and rename the function since we are checking if we are running under gdb, not making it run under gdb. Previously we were passing uninitialized data to basename() due to not properly adding the nul termination. ==22293== Conditional jump or move depends on uninitialised value(s) ==22293== at 0x4C306D0: rindex (vg_replace_strmem.c:199) ==22293== by 0x4EC55DD: basename (in /usr/lib64/libc-2.27.so) ==22293== by 0x400744: running_under_gdb (in /tmp/a) There's another problem with this function that it doesn't detect when we are running gdb from a toolchain using a toolchain triplet, but that's left for another patch. v2: remove the fix for repeating the argument on readlink() since that landed in another patch Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-07-11Remove parameter aliases with another argumentRodrigo Siqueira
This commit fixes the following GCC warning: warning: passing argument 2 to restrict-qualified parameter aliases with argument 1 [-Wrestrict] return (readlink (buf, buf, sizeof (buf)) != -1 && This commit fixes the GCC warning by creating a second buffer only to keep the path. v2: make pathname smaller (A. Hiler) Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-06-25Make GLib mandatoryPetri Latvala
GLib was originally made optional for Android builds, and Android support was dropped a while ago due to lack of use and maintenance. Building without GLib was broken without bug reports anyway. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-06-08igt/drv_suspend: Suspend under memory pressureChris Wilson
Recently we discovered that we have a race between swapping and suspend in our resume path (we might be trying to page in an object after disabling the block devices). Let's try to exercise that by exhausting all of system memory before suspend. v2: Explicitly share the large memory area on forking to avoid running out of memory inside the suspend helpers (for they fork!) References: https://bugs.freedesktop.org/show_bug.cgi?id=106640 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-03-05lib/sysfs: s/kick_fbcon/bind_fbcon/Ville Syrjälä
Rename kick_fbcon() into bind_fbcon() so that it's not so confusing. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-05tests/perf_pmu: Handle CPU hotplug failures betterChris Wilson
CPU hotplug, especially CPU0, can be flaky on commodity hardware. To improve test reliability and reponse times when testing larger runs we need to handle those cases better. Handle failures to off-line a CPU by immediately skipping the test, and failures to on-line a CPU by immediately rebooting the machine. This patch includes igt_sysrq_reboot implementation from Chris Wilson. v2: Halt by default, reboot if env variable IGT_REBOOT_ON_FATAL_ERROR is set. (Petri Latvala) v3: Add missign docs and update stale comment. (Petri Latvala) v4: Use pause instead of sleep. (Chris Wilson) v5: Newlines! (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-02-27lib: Export kmsg()Chris Wilson
Export the kmsg() function for use by tests to write into the kernel message log, useful for tests to inline their progress with kernel error messages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-12-13lib/core: Don't leak dummyloads between subtestsChris Wilson
If a test fails or skips early, it may not clean up after itself. In lieu of having a framework for test deconstructors, hook igt_terminate_spin_batches() into exit_subtest() itself so that we don't allow a recursive batch from an earlier test to leak into the next and cause an unexpected GPU hang. Similarly, we also want to terminate the dummyload as the first step in our atexit handlers (currently it is at the start of the last step) as some atexit handlers may be unwittingly exposed to dummyloads and so cause another wait on GPU hang. We trust that the core already distinguishes correctly between the principal test process and its children. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2017-12-05lib: avoid < in gtkdoc commentsDaniel Vetter
For reasons entirely not clear to me meson gtkdoc runs in strict xml parsing mode, whereas automake gtkdoc doesn't. And gtkdoc itself is tooooooooo dense to correctly escape this stuff. Paper around this. v2: {foo} instead of of tripy &lt;foo> (Joonas) v3: More fixups (Joonas) Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-12-04igt: Make dependency on libunwind mandatoryArkadiusz Hiler
With Android support gone there is not much reason for keeping libunwind dependency optional. This also deals (cheaply!) with ifdefs covering huge portions of code, removing a placement minefield. Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-29igt: Remove Android supportArkadiusz Hiler
This patch gets rid of the Android support, deleting all the hacks and moving code around to the places it belongs. Android build is not really maintained properly and rots rather fast. With recent push for Meson here and Android going for Soong it will only accelerate. It's a good time to drop the illusion of providing any support. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-11-24lib/igt_core: Move write_stderr out of LIBUNWIND ifdefArkadiusz Hiler
write_stderr() and __write_stderr() are defined behind ifdef on HAVE_LIBUNWIND, but do no depend on the lib in any way. fatal_sig_handler() uses those helpers unconditionally. This patch just moves the code couple of lines up, so the helpers are always available and do not break build on systems without libunwind. Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2017-11-22lib/core: Avoid unused result in backtrace printingTvrtko Ursulin
Add helpers for direct write to stderr to consolidate the code and avoid the unused result warning in build. v2: Use igt_ignore_warn since it is questionable whether igt_assert is safe in signal handlers. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-11-09lib: Always enable ftrace-dump-on-oopsChris Wilson
Some debugging information is too voluminous to enable by default, yet may be invaluable when it comes to post-mortem debugging. trace_printk() provides the facility for the trace ringbuffer to be dumped on oops, this way we can cheaply spam the debug log and only present it in case of emergency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-16aux: Suspend signal helper for shell commandsImre Deak
The clone() system call with a larger executable (like /bin/sh) may have difficulty to make progress on some platforms if interrupted frequently. So suspend the signal helper process for the duration of the syscall. This is needed to solve an actual problem by the next patch. v2: - Clarify/fix code comments. (Chris) - Update igt_system_quiet() as well accordingly. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
2017-10-03lib: Reduce dependency on glibPetri Latvala
In commit ebd6eb69f57b ("Make igtrc configuration common, with configurable suspend/resume delay") .igtrc handling was moved to igt_core from igt_chamelium. That made everything in IGT depend on GLIB by accident. In short, igt_core.h declared a variable of type GKeyFile*, requiring glib.h. Everything that tried to #include igt_core.h required glib.h to be available, by use of GLIB_CFLAGS. This "worked" so far because CAIRO_CFLAGS contained GLIB_CFLAGS. As the variable is only used by other stuff in lib/, stuff it in its own header file to leave igt_core.h without a dependency to glib.h. Also add a couple of missing #ifdef HAVE_GLIBs around. Reported-by: Felipe De Jesus Ruiz Garcia <felipe.de.jesus.ruiz.garcia@intel.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-09-25igt_core: Rework igt_system()Petri Latvala
Instead of redirecting output to pipes and forking, redirect after forking to avoid having to carefully unredirect before logging anything. igt@tools_test@sysfs_l3_parity had a racy condition where it prints the output of intel_l3_parity prepended by [cmd], but that ended up being printed again prepended by [cmd] because output was redirected, causing outputs to appear multiple times. This patch fixes that. CC: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2017-09-08lib: prefix frame_dump_pathDaniel Vetter
Just a bit of ocd for anything non-static. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08build: use HAVE_LIBGEN_H consistentlyDaniel Vetter
Also, we are _GNU_SOURCE, so simplify the conditions accordingly. The next patch will remove _GNU_SOURCE everywhere else. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-05igt_core: Skip sync when listing subtestsTvrtko Ursulin
No need to sync filesystems when only listing subtest. Extremely marginal benefit of avoid a short stall after make followed by listing subtests. v2: Move sync to common_init for consolidation and simplicity. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-08-28lib/igt_core: Use HTML character for documentation comment in examplePaul Kocialkowski
The gtkdoc output for the example configuration given in the file confuses gtkdoc because of the use of # for comments, that is interpreted as a headline (although it is an example block). This uses the HTML character instead to ensure the rendering is correct. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> (with one small typo fixed) Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-08-24lib/core: Use igt_info instead of printfDaniel Vetter
igt_info doesn't add anything when printing to stdout, but so looks the same. But it has the upside of appending the lines also to the igt crashdump log, where I especially want the backtraces. Atm they're the only thing that doesn't end up in there, which is a bit confusing. While at it also convert the other lines - the test summary usually doesn't make it since the test fails before that, and the version line tends to scroll off the crashdump. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-14lib: Add igt_can_fail()Daniel Vetter
Useful to make sure folks use library helpers correctly. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-07-20lib/igt_core: Split out env-related handling to common_init_envPaul Kocialkowski
This moves the parts of the code doing env-related handling from common_init to a new dedicated common_init_env function, making common_init a bit more readable. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20lib/igt_core: Move all config-related parsing to common_init_configPaul Kocialkowski
This moves all the pieces related to config parsing to the dedicated function for this purpose, renamed common_init_config for consistency. It allows making the common_init function less big and more readable. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20lib/igt_core: Handle glib errors correctly to avoid stderr spewPaul Kocialkowski
This adds the required error clean/free calls after calling configuration parsing functions. In addition to properly handling memory, this avoids glib spewing out error messages on stderr, which breaks the whole CI with this message: GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Key file does not have group ?DUT? Fixes: ee31e0b5 ("Introduce common frame dumping configuration...") Cc: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Cc: Lyude <lyude@redhat.com> Cc: Martin Peres <martin.peres@linux.intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
2017-07-19igt_core: Add the rest of Paul's patch I forgot by accidentLyude
Whoops, I meant to commit the entirity of Paul's patch but it appears I forgot to stage all of the changes to igt_core. This should have been included in the previous commit. Signed-off-by: Lyude <lyude@redhat.com>
2017-07-19Introduce common frame dumping configuration and helpersPaul Kocialkowski
This introduces a common FrameDumpPath configuration field, as well as helper functions in dedicated igt_frame for writing cairo surfaces to png files. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-06Make igtrc configuration common, with configurable suspend/resume delayPaul Kocialkowski
This adds support for configurable suspend/resume delay and takes the occasion to move igtrc configuation from igt_chamelium to igt_core. This way, suspend/resume delay configuration can be used for all tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>