blob: cf7fbbe434215c119f98a07056db6c1cf7ade0cf [file]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fcntl.h>
#include <lib/magma_service/test_util/platform_device_helper.h>
#include <gtest/gtest.h>
int main(int argc, char** argv) {
int fd = open("/dev/dri/renderD128", O_RDWR);
if (fd < 0) {
fprintf(stderr, "Failed to open gpu device\n");
return -1;
}
void* device = reinterpret_cast<void*>(fd);
TestPlatformDevice::SetInstance(magma::PlatformDevice::Create(device));
SetTestDeviceHandle(device);
testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
close(fd);
return ret;
}