* [PATCH i-g-t 1/3] lib: fix symbol names in documentation comments
@ 2014-11-25 16:26 Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 2/3] tests: use subtests in gem_tiled_swapping Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 3/3] lib: ensure subtests are not added to simple tests Thomas Wood
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Wood @ 2014-11-25 16:26 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
lib/drmtest.c | 2 +-
lib/igt_core.h | 2 +-
lib/intel_batchbuffer.c | 4 ++--
lib/ioctl_wrappers.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index 3d828e1..813c315 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -344,7 +344,7 @@ int drm_open_any_master(void)
}
/**
- * drm_open_any:
+ * drm_open_any_render:
*
* Open an i915 drm render device node.
*
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 846f599..a258348 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -263,7 +263,7 @@ void igt_exit(void) __attribute__((noreturn));
#define igt_fail_on(expr) igt_assert(!(expr))
/**
- * igt_assert_f:
+ * igt_fail_on_f:
* @expr: condition to test
* @...: format string and optional arguments
*
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index c1b0e3d..30ef2cf 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -86,7 +86,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
}
/**
- * intel_batchbuffer_reset:
+ * intel_batchbuffer_alloc:
* @bufmgr: libdrm buffer manager
* @devid: pci device id of the drm device
*
@@ -109,7 +109,7 @@ intel_batchbuffer_alloc(drm_intel_bufmgr *bufmgr, uint32_t devid)
}
/**
- * intel_batchbuffer_reset:
+ * intel_batchbuffer_free:
* @batch: batchbuffer object
*
* Releases all resource of the batchbuffer object @batch.
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index f423237..56280b6 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -620,7 +620,7 @@ bool gem_uses_aliasing_ppgtt(int fd)
}
/**
- * gem_uses_aliasing_ppgtt:
+ * gem_available_fences:
* @fd: open i915 drm file descriptor
*
* Feature test macro to query the kernel for the number of available fences
@@ -811,7 +811,7 @@ uint64_t gem_aperture_size(int fd)
}
/**
- * gem_aperture_size:
+ * gem_mappable_aperture_size:
* @fd: open i915 drm file descriptor
*
* Feature test macro to query the kernel for the mappable gpu aperture size.
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH i-g-t 2/3] tests: use subtests in gem_tiled_swapping
2014-11-25 16:26 [PATCH i-g-t 1/3] lib: fix symbol names in documentation comments Thomas Wood
@ 2014-11-25 16:26 ` Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 3/3] lib: ensure subtests are not added to simple tests Thomas Wood
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Wood @ 2014-11-25 16:26 UTC (permalink / raw)
To: intel-gfx
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
tests/gem_tiled_swapping.c | 64 ++++++++++++++++++++++++----------------------
1 file changed, 34 insertions(+), 30 deletions(-)
diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c
index 69d1cfa..11bb245 100644
--- a/tests/gem_tiled_swapping.c
+++ b/tests/gem_tiled_swapping.c
@@ -143,42 +143,46 @@ static void thread_fini(struct thread *t)
free(t->idx_arr);
}
-igt_simple_main
+igt_main
{
struct thread *threads;
int fd, n, count, num_threads;
- current_tiling_mode = I915_TILING_X;
-
- intel_purge_vm_caches();
-
- fd = drm_open_any();
- /* need slightly more than available memory */
- count = intel_get_total_ram_mb() + intel_get_total_swap_mb() / 4;
- bo_handles = calloc(count, sizeof(uint32_t));
- igt_assert(bo_handles);
-
- num_threads = gem_available_fences(fd);
- threads = calloc(num_threads, sizeof(struct thread));
- igt_assert(threads);
-
- igt_log(IGT_LOG_INFO,
- "Using %d 1MiB objects (available RAM: %ld/%ld, swap: %ld)\n",
- count,
- (long)intel_get_avail_ram_mb(),
- (long)intel_get_total_ram_mb(),
- (long)intel_get_total_swap_mb());
- intel_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP);
-
- for (n = 0; n < count; n++) {
- bo_handles[n] = create_bo_and_fill(fd);
- /* Not enough mmap address space possible. */
- igt_require(bo_handles[n]);
+ igt_fixture {
+ current_tiling_mode = I915_TILING_X;
+
+ intel_purge_vm_caches();
+
+ fd = drm_open_any();
+ /* need slightly more than available memory */
+ count = intel_get_total_ram_mb() + intel_get_total_swap_mb() / 4;
+ bo_handles = calloc(count, sizeof(uint32_t));
+ igt_assert(bo_handles);
+
+ num_threads = gem_available_fences(fd);
+ threads = calloc(num_threads, sizeof(struct thread));
+ igt_assert(threads);
+
+ igt_log(IGT_LOG_INFO,
+ "Using %d 1MiB objects (available RAM: %ld/%ld, swap: %ld)\n",
+ count,
+ (long)intel_get_avail_ram_mb(),
+ (long)intel_get_total_ram_mb(),
+ (long)intel_get_total_swap_mb());
+ intel_require_memory(count, 1024*1024, CHECK_RAM | CHECK_SWAP);
+
+ for (n = 0; n < count; n++) {
+ bo_handles[n] = create_bo_and_fill(fd);
+ /* Not enough mmap address space possible. */
+ igt_require(bo_handles[n]);
+ }
}
- thread_init(&threads[0], fd, count);
- thread_run(&threads[0]);
- thread_fini(&threads[0]);
+ igt_subtest("non-threaded") {
+ thread_init(&threads[0], fd, count);
+ thread_run(&threads[0]);
+ thread_fini(&threads[0]);
+ }
/* Once more with threads */
igt_subtest("threaded") {
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH i-g-t 3/3] lib: ensure subtests are not added to simple tests
2014-11-25 16:26 [PATCH i-g-t 1/3] lib: fix symbol names in documentation comments Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 2/3] tests: use subtests in gem_tiled_swapping Thomas Wood
@ 2014-11-25 16:26 ` Thomas Wood
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Wood @ 2014-11-25 16:26 UTC (permalink / raw)
To: intel-gfx
Simple tests do not support subtests, so fail if igt_subtest is used in
one.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
lib/igt_core.c | 1 +
lib/tests/.gitignore | 1 +
lib/tests/Makefile.sources | 2 ++
lib/tests/igt_simple_test_subtests.c | 31 +++++++++++++++++++++++++++++++
4 files changed, 35 insertions(+)
create mode 100644 lib/tests/igt_simple_test_subtests.c
diff --git a/lib/igt_core.c b/lib/igt_core.c
index b937f43..3fd4595 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -672,6 +672,7 @@ bool __igt_run_subtest(const char *subtest_name)
{
assert(!in_subtest);
assert(!in_fixture);
+ assert(test_with_subtests);
if (list_subtests) {
printf("%s\n", subtest_name);
diff --git a/lib/tests/.gitignore b/lib/tests/.gitignore
index 9fd8580..907bd88 100644
--- a/lib/tests/.gitignore
+++ b/lib/tests/.gitignore
@@ -5,4 +5,5 @@ igt_no_exit
igt_no_exit_list_only
igt_no_subtest
igt_simulation
+igt_simple_test_subtests
igt_timeout
diff --git a/lib/tests/Makefile.sources b/lib/tests/Makefile.sources
index 4208a26..828baa4 100644
--- a/lib/tests/Makefile.sources
+++ b/lib/tests/Makefile.sources
@@ -5,6 +5,7 @@ check_PROGRAMS = \
igt_list_only \
igt_no_subtest \
igt_simulation \
+ igt_simple_test_subtests \
igt_timeout \
$(NULL)
@@ -23,5 +24,6 @@ XFAIL_TESTS = \
igt_no_exit \
igt_no_exit_list_only \
igt_no_subtest \
+ igt_simple_test_subtests \
igt_timeout \
$(NULL)
diff --git a/lib/tests/igt_simple_test_subtests.c b/lib/tests/igt_simple_test_subtests.c
new file mode 100644
index 0000000..abe8e40
--- /dev/null
+++ b/lib/tests/igt_simple_test_subtests.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "igt_core.h"
+
+igt_simple_main
+{
+ igt_subtest("subtest") {
+ igt_info("Invalid subtest.\n");
+ }
+}
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-25 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 16:26 [PATCH i-g-t 1/3] lib: fix symbol names in documentation comments Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 2/3] tests: use subtests in gem_tiled_swapping Thomas Wood
2014-11-25 16:26 ` [PATCH i-g-t 3/3] lib: ensure subtests are not added to simple tests Thomas Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).