From d1e2ff5da39d1ac9be457003cee2158c23b2f13c Mon Sep 17 00:00:00 2001
From: Sean Klein <smklein@google.com>
Date: Thu, 9 May 2019 11:30:07 -0700
Subject: [PATCH] [test][zbi] Relocate unit tests to exist alongside source

Change-Id: I58d1754ca577703e082a3b094373b150eb54d263
---
 zircon/system/{utest/zbi => ulib/libzbi/test}/BUILD.gn | 7 +++++++
 zircon/system/{utest/zbi => ulib/libzbi/test}/zbi.cpp  | 0
 zircon/system/utest/BUILD.gn                           | 4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)
 rename zircon/system/{utest/zbi => ulib/libzbi/test}/BUILD.gn (86%)
 rename zircon/system/{utest/zbi => ulib/libzbi/test}/zbi.cpp (100%)

diff --git a/zircon/system/utest/zbi/BUILD.gn b/zircon/system/ulib/libzbi/test/BUILD.gn
similarity index 86%
rename from zircon/system/utest/zbi/BUILD.gn
rename to zircon/system/ulib/libzbi/test/BUILD.gn
index aa4c25fdbb0..1d4b760f7d6 100644
--- a/zircon/system/utest/zbi/BUILD.gn
+++ b/zircon/system/ulib/libzbi/test/BUILD.gn
@@ -2,6 +2,13 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+group("test") {
+  testonly = true
+  deps = [
+    ":zbi",
+  ]
+}
+
 test("zbi") {
   sources = [
     "zbi.cpp",
diff --git a/zircon/system/utest/zbi/zbi.cpp b/zircon/system/ulib/libzbi/test/zbi.cpp
similarity index 100%
rename from zircon/system/utest/zbi/zbi.cpp
rename to zircon/system/ulib/libzbi/test/zbi.cpp
diff --git a/zircon/system/utest/BUILD.gn b/zircon/system/utest/BUILD.gn
index 25567417b14..78c51086672 100644
--- a/zircon/system/utest/BUILD.gn
+++ b/zircon/system/utest/BUILD.gn
@@ -77,6 +77,7 @@ if (current_cpu != "") {
       "$zx/system/ulib/fzl/test",
       "$zx/system/ulib/gpt/test",
       "$zx/system/ulib/id_allocator/test",
+      "$zx/system/ulib/libzbi/test",
       "$zx/system/ulib/kvstore:kvstore-test",
       "$zx/system/ulib/lazy_init:lazy_init-test",
       "$zx/system/ulib/minfs/allocator/test",
@@ -191,7 +192,6 @@ if (current_cpu != "") {
       "virtio",
       "virtual_camera",
       "vmo",
-      "zbi",
       "zxcrypt",
 
       # disabled for now:
@@ -222,6 +222,7 @@ if (current_cpu != "") {
     deps = [
       "$zx/system/ulib/fbl/test",
       "$zx/system/ulib/fvm/test",
+      "$zx/system/ulib/libzbi/test",
       "$zx/system/ulib/zxtest/test",
       "$zx/system/ulib/trace-reader:tests",
       "cmdline",
@@ -232,7 +233,6 @@ if (current_cpu != "") {
       "fvm-host",
       "runtests-utils",
       "util",
-      "zbi",
     ]
     if (current_os == "linux") {
       deps += [
-- 
GitLab