mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 19:11:08 +00:00
test: stabilize hosted dependency and Vulkan checks
This commit is contained in:
1 parent
5d10c8e96d
commit
6affa87442
3 files changed
+10
-1
No files matched your search
@@ -248,6 +248,7 @@ android {
|
||||
'--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED'
|
||||
maxHeapSize = '2g'
|
||||
maxParallelForks = 2
|
||||
systemProperty 'robolectric.dependency.repo.url', 'https://repo.maven.apache.org/maven2'
|
||||
def logTarget = providers.systemProperty('robolectric.logging').orNull
|
||||
if (logTarget != null) systemProperty 'robolectric.logging', logTarget
|
||||
}
|
||||
|
||||
@@ -22,10 +22,14 @@ class VrProducerLeaseTest(unittest.TestCase):
|
||||
subprocess.run(command + ["-o", str(executable)], check=True)
|
||||
environment = dict(os.environ)
|
||||
if gpu:
|
||||
environment["LP_NUM_THREADS"] = "2"
|
||||
manifests = sorted(Path("/usr/share/vulkan/icd.d").glob("lvp_icd*.json"))
|
||||
environment["VK_DRIVER_FILES"] = str(manifests[0])
|
||||
environment["VK_ICD_FILENAMES"] = str(manifests[0])
|
||||
result = subprocess.run([str(executable)], env=environment, capture_output=True, text=True, timeout=20)
|
||||
try:
|
||||
result = subprocess.run([str(executable)], env=environment, capture_output=True, text=True, timeout=60 if gpu else 20)
|
||||
except subprocess.TimeoutExpired as error:
|
||||
self.fail("producer test timed out: " + (error.stderr or b"").decode(errors="replace"))
|
||||
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
|
||||
return result.stdout
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ int main(void) {
|
||||
VkTimelineSemaphoreSubmitInfo timeline = {VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, NULL, 1, &value, 0, NULL};
|
||||
VkPipelineStageFlags stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
|
||||
VkSubmitInfo first = {VK_STRUCTURE_TYPE_SUBMIT_INFO, &timeline, 1, &gate, &stage, 1, &commands[0], 0, NULL};
|
||||
fputs("producer GPU: initial queued completion\n", stderr);
|
||||
assert(QueueSubmit(test_queue, 1, &first, VK_NULL_HANDLE) == VK_SUCCESS);
|
||||
pthread_t signal_thread;
|
||||
int64_t began = droiddeck_producer_now();
|
||||
@@ -107,6 +108,7 @@ int main(void) {
|
||||
assert(droiddeck_producer_now() - began >= 20000000LL);
|
||||
assert(pthread_join(signal_thread, NULL) == 0);
|
||||
check_pixels(pixels, patterns[0]);
|
||||
fputs("producer GPU: retained ownership\n", stderr);
|
||||
pthread_t writer;
|
||||
assert(pthread_create(&writer, NULL, second_submit, NULL) == 0);
|
||||
while (!atomic_load(&second_entered)) usleep(100);
|
||||
@@ -117,6 +119,7 @@ int main(void) {
|
||||
assert(pthread_join(writer, NULL) == 0);
|
||||
assert(vkQueueWaitIdle(test_queue) == VK_SUCCESS);
|
||||
check_pixels(pixels, patterns[1]);
|
||||
fputs("producer GPU: timeout retention\n", stderr);
|
||||
value = 2;
|
||||
assert(QueueSubmit(test_queue, 1, &first, VK_NULL_HANDLE) == VK_SUCCESS);
|
||||
assert(!producer_acquire(droiddeck_producer_now() + 20000000LL));
|
||||
@@ -130,6 +133,7 @@ int main(void) {
|
||||
assert(producer_acquire(droiddeck_producer_now() + 1000000000LL));
|
||||
producer_release();
|
||||
check_pixels(pixels, patterns[0]);
|
||||
fputs("producer GPU: teardown\n", stderr);
|
||||
producer_destroy_device(&g_dev[0], NULL);
|
||||
vkDestroySemaphore(test_device, gate, NULL);
|
||||
vkDestroyCommandPool(test_device, pool, NULL);
|
||||
|
||||
Reference in new issue
Block a user