Revert "[zircon][unittest] Provide default main function in unittest library"

This reverts commit 48f3aa7c94196750c7ff626fc51a45f4d8990160.

Reason for revert: Landed accidentally via topic CQ snafu!

Original change's description:
> [zircon][unittest] Provide default main function in unittest library
> 
> This removes an inordinate number of boilerplate copies of the standard
> main function for a test.  In the case of the core tests it (mostly)
> obviates the need to compile each source file separately for standalone
> and all-in-one incarnations, which the new build will take advantage of.
> 
> Bug: BLD-325
> Test: CQ
> Change-Id: Ia1ee5a6fc461350d63970d24e0117dc1a812c2ec

TBR=kulakowski@google.com,mcgrathr@google.com,scottmg@google.com

Change-Id: Iab5c8c59fe5b4581c907aa40d6caf801d791cab6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: BLD-325
diff --git a/zircon/system/core/bootsvc/integration-test.cpp b/zircon/system/core/bootsvc/integration-test.cpp
index 456aab1..344cbbb 100644
--- a/zircon/system/core/bootsvc/integration-test.cpp
+++ b/zircon/system/core/bootsvc/integration-test.cpp
@@ -186,3 +186,8 @@
 RUN_TEST(TestStartupHandles)
 RUN_TEST(TestVdsosPresent)
 END_TEST_CASE(bootsvc_integration_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+
diff --git a/zircon/system/core/devmgr/devmgr/test-main.cpp b/zircon/system/core/devmgr/devmgr/test-main.cpp
new file mode 100644
index 0000000..de911d5
--- /dev/null
+++ b/zircon/system/core/devmgr/devmgr/test-main.cpp
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : 1;
+}
diff --git a/zircon/system/core/devmgr/rules.mk b/zircon/system/core/devmgr/rules.mk
index 5864a96..97e2ada 100644
--- a/zircon/system/core/devmgr/rules.mk
+++ b/zircon/system/core/devmgr/rules.mk
@@ -84,6 +84,7 @@
     $(LOCAL_DIR)/devmgr/device.cpp \
     $(LOCAL_DIR)/devmgr/driver.cpp \
     $(LOCAL_DIR)/devmgr/fidl.cpp \
+    $(LOCAL_DIR)/devmgr/test-main.cpp \
     $(LOCAL_DIR)/shared/env.cpp \
 
 MODULE_FIDL_LIBS := \
diff --git a/zircon/system/core/virtcon/textcon-test.cpp b/zircon/system/core/virtcon/textcon-test.cpp
index db76ba97..93a30dc 100644
--- a/zircon/system/core/virtcon/textcon-test.cpp
+++ b/zircon/system/core/virtcon/textcon-test.cpp
@@ -747,3 +747,9 @@
 END_TEST_CASE(gfxconsole_textbuf_tests)
 
 }
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/dev/block/fvm/rules.mk b/zircon/system/dev/block/fvm/rules.mk
index 172fa60..c7964e3 100644
--- a/zircon/system/dev/block/fvm/rules.mk
+++ b/zircon/system/dev/block/fvm/rules.mk
@@ -60,6 +60,7 @@
 
 MODULE_SRCS := $(SHARED_SRCS) \
     $(TEST_DIR)/slice-extent-test.cpp \
+    $(TEST_DIR)/main.cpp \
 
 MODULE_STATIC_LIBS := \
     $(SHARED_STATIC_LIBS) \
diff --git a/zircon/system/dev/block/fvm/test/main.cpp b/zircon/system/dev/block/fvm/test/main.cpp
new file mode 100644
index 0000000..6a8bbb7
--- /dev/null
+++ b/zircon/system/dev/block/fvm/test/main.cpp
@@ -0,0 +1,10 @@
+// Copyright 2018 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 <fbl/alloc_checker.h>
+#include <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/block/usb-mass-storage/rules.mk b/zircon/system/dev/block/usb-mass-storage/rules.mk
index 7648324..b1fe02d 100644
--- a/zircon/system/dev/block/usb-mass-storage/rules.mk
+++ b/zircon/system/dev/block/usb-mass-storage/rules.mk
@@ -39,6 +39,7 @@
 MODULE_SRCS := \
     $(LOCAL_DIR)/block.cpp \
     $(LOCAL_DIR)/tests/block.cpp \
+    $(LOCAL_DIR)/tests/main.c \
 
 MODULE_STATIC_LIBS := system/ulib/ddk \
     system/ulib/ddktl \
@@ -76,6 +77,7 @@
     $(LOCAL_DIR)/usb-mass-storage.cpp \
     $(LOCAL_DIR)/block.cpp \
     $(LOCAL_DIR)/tests/usb-mass-storage.cpp \
+    $(LOCAL_DIR)/tests/main.c \
 
 MODULE_STATIC_LIBS := system/ulib/ddk \
     system/ulib/ddktl \
diff --git a/zircon/system/dev/block/usb-mass-storage/tests/main.c b/zircon/system/dev/block/usb-mass-storage/tests/main.c
new file mode 100644
index 0000000..faff464
--- /dev/null
+++ b/zircon/system/dev/block/usb-mass-storage/tests/main.c
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/bus/virtio/rules.mk b/zircon/system/dev/bus/virtio/rules.mk
index d381016..60626b6 100644
--- a/zircon/system/dev/bus/virtio/rules.mk
+++ b/zircon/system/dev/bus/virtio/rules.mk
@@ -66,6 +66,7 @@
     $(LOCAL_DIR)/scsilib.cpp \
     $(LOCAL_DIR)/ring.cpp \
     $(LOCAL_DIR)/scsi_test.cpp \
+    $(LOCAL_DIR)/test_main.cpp \
 
 MODULE_STATIC_LIBS := \
     system/dev/lib/fake_ddk \
diff --git a/zircon/system/dev/bus/virtio/test_main.cpp b/zircon/system/dev/bus/virtio/test_main.cpp
new file mode 100644
index 0000000..faff464
--- /dev/null
+++ b/zircon/system/dev/bus/virtio/test_main.cpp
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/lib/usb/rules.mk b/zircon/system/dev/lib/usb/rules.mk
index eef66d3..c6e9ffb 100644
--- a/zircon/system/dev/lib/usb/rules.mk
+++ b/zircon/system/dev/lib/usb/rules.mk
@@ -32,6 +32,7 @@
 
 MODULE_SRCS := \
     $(LOCAL_DIR)/tests/usb-wrapper-tests.cpp \
+    $(LOCAL_DIR)/tests/main.c \
     $(LOCAL_DIR)/usb.c \
     $(LOCAL_DIR)/usb-wrapper.cpp \
 
diff --git a/zircon/system/dev/lib/usb/tests/main.c b/zircon/system/dev/lib/usb/tests/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/dev/lib/usb/tests/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/nand/nand/rules.mk b/zircon/system/dev/nand/nand/rules.mk
index 88ae02e..55a274e 100644
--- a/zircon/system/dev/nand/nand/rules.mk
+++ b/zircon/system/dev/nand/nand/rules.mk
@@ -50,6 +50,7 @@
 
 MODULE_SRCS := \
     $(LOCAL_DIR)/nand.cpp \
+    $(TEST_DIR)/main.cpp\
     $(TEST_DIR)/nand-test.cpp\
 
 MODULE_COMPILEFLAGS := \
diff --git a/zircon/system/dev/nand/nand/test/main.cpp b/zircon/system/dev/nand/nand/test/main.cpp
new file mode 100644
index 0000000..faff464
--- /dev/null
+++ b/zircon/system/dev/nand/nand/test/main.cpp
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/nand/nandpart/rules.mk b/zircon/system/dev/nand/nandpart/rules.mk
index 18965ee..148316c 100644
--- a/zircon/system/dev/nand/nandpart/rules.mk
+++ b/zircon/system/dev/nand/nandpart/rules.mk
@@ -54,6 +54,7 @@
     $(LOCAL_DIR)/aml-bad-block.cpp \
     $(LOCAL_DIR)/bad-block.cpp \
     $(LOCAL_DIR)/nandpart-utils.cpp \
+    $(TEST_DIR)/main.cpp\
     $(TEST_DIR)/aml-bad-block-test.cpp\
     $(TEST_DIR)/nandpart-utils-test.cpp\
 
diff --git a/zircon/system/dev/nand/nandpart/test/main.cpp b/zircon/system/dev/nand/nandpart/test/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/dev/nand/nandpart/test/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/nand/ram-nand/rules.mk b/zircon/system/dev/nand/ram-nand/rules.mk
index 71136fe..5ad0d4e 100644
--- a/zircon/system/dev/nand/ram-nand/rules.mk
+++ b/zircon/system/dev/nand/ram-nand/rules.mk
@@ -46,7 +46,8 @@
 
 MODULE_SRCS += \
     $(LOCAL_DIR)/ram-nand.cpp \
-x    $(TEST_DIR)/ram-nand.cpp \
+    $(TEST_DIR)/main.cpp \
+    $(TEST_DIR)/ram-nand.cpp \
     $(TEST_DIR)/ram-nand-ctl.cpp \
 
 MODULE_COMPILEFLAGS := -I$(LOCAL_DIR)
diff --git a/zircon/system/dev/nand/ram-nand/test/main.cpp b/zircon/system/dev/nand/ram-nand/test/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/dev/nand/ram-nand/test/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/nand/skip-block/rules.mk b/zircon/system/dev/nand/skip-block/rules.mk
index 71b7284..bf604ea 100644
--- a/zircon/system/dev/nand/skip-block/rules.mk
+++ b/zircon/system/dev/nand/skip-block/rules.mk
@@ -51,6 +51,7 @@
 MODULE_SRCS := \
     $(LOCAL_DIR)/logical-to-physical-map.cpp \
     $(TEST_DIR)/logical-to-physical-map-test.cpp \
+    $(TEST_DIR)/main.cpp \
 
 MODULE_COMPILEFLAGS := \
     -I$(LOCAL_DIR) \
diff --git a/zircon/system/dev/nand/skip-block/test/main.cpp b/zircon/system/dev/nand/skip-block/test/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/dev/nand/skip-block/test/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/test/operation/main.cpp b/zircon/system/dev/test/operation/main.cpp
new file mode 100644
index 0000000..8af51d4
--- /dev/null
+++ b/zircon/system/dev/test/operation/main.cpp
@@ -0,0 +1,10 @@
+// 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 <lib/operation/operation.h>
+
+#include <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/test/operation/rules.mk b/zircon/system/dev/test/operation/rules.mk
index 6782b40..6c94629 100644
--- a/zircon/system/dev/test/operation/rules.mk
+++ b/zircon/system/dev/test/operation/rules.mk
@@ -15,6 +15,7 @@
     $(LOCAL_DIR)/operation-list-test.cpp \
     $(LOCAL_DIR)/operation-pool-test.cpp \
     $(LOCAL_DIR)/operation-queue-test.cpp \
+    $(LOCAL_DIR)/main.cpp \
 
 MODULE_STATIC_LIBS := \
     system/dev/lib/fake_ddk \
diff --git a/zircon/system/dev/test/usb/main.cpp b/zircon/system/dev/test/usb/main.cpp
new file mode 100644
index 0000000..faff464
--- /dev/null
+++ b/zircon/system/dev/test/usb/main.cpp
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/dev/test/usb/rules.mk b/zircon/system/dev/test/usb/rules.mk
index 9fdc5fa..47d3780 100644
--- a/zircon/system/dev/test/usb/rules.mk
+++ b/zircon/system/dev/test/usb/rules.mk
@@ -11,6 +11,7 @@
 MODULE_NAME := usb-unittest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/usb-request-list-test.cpp \
     $(LOCAL_DIR)/usb-request-pool-test.cpp \
     $(LOCAL_DIR)/usb-request-queue-test.cpp \
diff --git a/zircon/system/uapp/disk-pave/rules.mk b/zircon/system/uapp/disk-pave/rules.mk
index 1f39845..2e19b15 100644
--- a/zircon/system/uapp/disk-pave/rules.mk
+++ b/zircon/system/uapp/disk-pave/rules.mk
@@ -69,6 +69,7 @@
 MODULE_SRCS := \
     $(LOCAL_DIR)/device-partitioner.cpp \
     $(LOCAL_DIR)/pave-utils.cpp \
+    $(TEST_DIR)/main.cpp\
     $(TEST_DIR)/device-partitioner-test.cpp\
 
 MODULE_COMPILEFLAGS := \
diff --git a/zircon/system/uapp/disk-pave/test/main.cpp b/zircon/system/uapp/disk-pave/test/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/uapp/disk-pave/test/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/blobfs/rules.mk b/zircon/system/ulib/blobfs/rules.mk
index d4f1638..aba5a4c2 100644
--- a/zircon/system/ulib/blobfs/rules.mk
+++ b/zircon/system/ulib/blobfs/rules.mk
@@ -111,6 +111,7 @@
     $(TEST_DIR)/extent-reserver-test.cpp \
     $(TEST_DIR)/get-allocated-regions-test.cpp \
     $(TEST_DIR)/journal-test.cpp \
+    $(TEST_DIR)/main.cpp \
     $(TEST_DIR)/node-populator-test.cpp \
     $(TEST_DIR)/node-reserver-test.cpp \
     $(TEST_DIR)/utils.cpp \
diff --git a/zircon/system/ulib/blobfs/test/main.cpp b/zircon/system/ulib/blobfs/test/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/ulib/blobfs/test/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/bootfs/parser-test.cpp b/zircon/system/ulib/bootfs/parser-test.cpp
index 68ebff7..77aaad4 100644
--- a/zircon/system/ulib/bootfs/parser-test.cpp
+++ b/zircon/system/ulib/bootfs/parser-test.cpp
@@ -220,3 +220,8 @@
 RUN_TEST(TestInitCantMap)
 RUN_TEST(TestParseSuccess)
 END_TEST_CASE(bootfs_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+
diff --git a/zircon/system/ulib/ddk/rules.mk b/zircon/system/ulib/ddk/rules.mk
index 9078ed5..4507727 100644
--- a/zircon/system/ulib/ddk/rules.mk
+++ b/zircon/system/ulib/ddk/rules.mk
@@ -34,6 +34,7 @@
 
 MODULE_SRCS += \
     $(LOCAL_DIR)/phys-iter.c \
+    $(TEST_DIR)/main.cpp \
     $(TEST_DIR)/phys-iter-test.cpp \
 
 MODULE_STATIC_LIBS := \
diff --git a/zircon/system/ulib/ddk/test/main.cpp b/zircon/system/ulib/ddk/test/main.cpp
new file mode 100644
index 0000000..faff464
--- /dev/null
+++ b/zircon/system/ulib/ddk/test/main.cpp
@@ -0,0 +1,9 @@
+// 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/driver-integration-test/test/main.cpp b/zircon/system/ulib/driver-integration-test/test/main.cpp
index 9668e74..3021db9 100644
--- a/zircon/system/ulib/driver-integration-test/test/main.cpp
+++ b/zircon/system/ulib/driver-integration-test/test/main.cpp
@@ -65,3 +65,7 @@
 BEGIN_TEST_CASE(driver_integration_tests)
 RUN_TEST(enumeration_test)
 END_TEST_CASE(driver_integration_tests);
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/kvstore/kvstore-test.c b/zircon/system/ulib/kvstore/kvstore-test.c
index dd7f8e9..0325d3e 100644
--- a/zircon/system/ulib/kvstore/kvstore-test.c
+++ b/zircon/system/ulib/kvstore/kvstore-test.c
@@ -189,3 +189,7 @@
 RUN_TEST(kvs_get_put)
 RUN_TEST(kvs_wire_format)
 END_TEST_CASE(kvstore_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/pretty/test.c b/zircon/system/ulib/pretty/test.c
index 4c88011..b5514ea 100644
--- a/zircon/system/ulib/pretty/test.c
+++ b/zircon/system/ulib/pretty/test.c
@@ -257,3 +257,7 @@
 RUN_TEST(hexdump_very_ex_test)
 RUN_TEST(hexdump8_very_ex_test)
 END_TEST_CASE(pretty_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/simplehid/test/simplehid-test.cpp b/zircon/system/ulib/simplehid/test/simplehid-test.cpp
index 8dfd2ad..e39991b 100644
--- a/zircon/system/ulib/simplehid/test/simplehid-test.cpp
+++ b/zircon/system/ulib/simplehid/test/simplehid-test.cpp
@@ -106,6 +106,10 @@
 
 }  // namespace simplehid
 
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : 1;
+}
+
 BEGIN_TEST_CASE(SimpleHidTests)
 RUN_TEST_SMALL(simplehid::TestNoReports)
 RUN_TEST_SMALL(simplehid::TestReports)
diff --git a/zircon/system/ulib/tftp/tftp-test.cpp b/zircon/system/ulib/tftp/tftp-test.cpp
index 95453d2..d036722 100644
--- a/zircon/system/ulib/tftp/tftp-test.cpp
+++ b/zircon/system/ulib/tftp/tftp-test.cpp
@@ -2066,3 +2066,7 @@
 RUN_TEST(test_tftp_recv_busy_from_wrq)
 RUN_TEST(test_tftp_recv_other_err)
 END_TEST_CASE(tftp_recv_err)
+
+int main(int argc, char* argv[]) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/trace-vthread/event_vthread_tests.cpp b/zircon/system/ulib/trace-vthread/event_vthread_tests.cpp
index bc83903..106d6b1 100644
--- a/zircon/system/ulib/trace-vthread/event_vthread_tests.cpp
+++ b/zircon/system/ulib/trace-vthread/event_vthread_tests.cpp
@@ -224,3 +224,7 @@
 RUN_TEST(TestVthreadFlowStep)
 RUN_TEST(TestVthreadFlowEnd)
 END_TEST_CASE(event_thread_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/ulib/unittest/README.md b/zircon/system/ulib/unittest/README.md
index 1d6f31f..caba78d 100644
--- a/zircon/system/ulib/unittest/README.md
+++ b/zircon/system/ulib/unittest/README.md
@@ -31,9 +31,6 @@
 Unittest has a set of options that it recognizes.
 All tests are expected to call `unittest_run_all_tests()`,
 which will ensure all tests get these options.
-The library supplies a default `main()` function that does this.
-So if a test has no interest in the arguments itself and needs no
-other special global initialization, it need not define its own `main` at all.
 
 However, tests can also have their own options. Since Unittest does not
 use any kind of general argv parsing library, and each test as well as
diff --git a/zircon/system/ulib/unittest/rules.mk b/zircon/system/ulib/unittest/rules.mk
index da6739a..27f3ee1 100644
--- a/zircon/system/ulib/unittest/rules.mk
+++ b/zircon/system/ulib/unittest/rules.mk
@@ -14,7 +14,6 @@
     $(LOCAL_DIR)/crash-handler.cpp \
     $(LOCAL_DIR)/crash-list.cpp \
     $(LOCAL_DIR)/unittest.cpp \
-    $(LOCAL_DIR)/unittest-main.cpp \
     $(LOCAL_DIR)/watchdog.cpp \
 
 MODULE_SO_NAME := unittest
@@ -37,7 +36,6 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/all-tests.cpp \
     $(LOCAL_DIR)/unittest.cpp \
-    $(LOCAL_DIR)/unittest-main.cpp \
     $(LOCAL_DIR)/watchdog.cpp \
 
 MODULE_HOST_LIBS := system/ulib/pretty
diff --git a/zircon/system/ulib/unittest/unittest-main.cpp b/zircon/system/ulib/unittest/unittest-main.cpp
deleted file mode 100644
index 27c4565..0000000
--- a/zircon/system/ulib/unittest/unittest-main.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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 <unittest/unittest.h>
-
-// The library provides a default main function so test programs don't need a
-// boilerplate main.  The main function is not special to the linker, so it can
-// come from a library like any other.  Naturally, if the main program provides
-// its own main function, the library's function will be ignored.
-
-int main(int argc, char** argv) {
-    return unittest_run_all_tests(argc, argv) ? 0 : -1;
-}
diff --git a/zircon/system/utest/abigen/abigen.c b/zircon/system/utest/abigen/abigen.c
index d5c5530..a82384a 100644
--- a/zircon/system/utest/abigen/abigen.c
+++ b/zircon/system/utest/abigen/abigen.c
@@ -33,3 +33,8 @@
 RUN_TEST(wrapper_test);
 RUN_TEST(syscall_test);
 END_TEST_CASE(launchpad_tests)
+
+int main(int argc, char **argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/async-loop/main.c b/zircon/system/utest/async-loop/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/async-loop/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/async-loop/rules.mk b/zircon/system/utest/async-loop/rules.mk
index 308114a..c02f144f 100644
--- a/zircon/system/utest/async-loop/rules.mk
+++ b/zircon/system/utest/async-loop/rules.mk
@@ -10,6 +10,7 @@
 
 MODULE_SRCS += \
     $(LOCAL_DIR)/loop_tests.cpp \
+    $(LOCAL_DIR)/main.c \
 
 MODULE_NAME := async-loop-test
 
diff --git a/zircon/system/utest/async-testutils/main.c b/zircon/system/utest/async-testutils/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/async-testutils/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/async-testutils/rules.mk b/zircon/system/utest/async-testutils/rules.mk
index 37a3cc0b..a5c58f4 100644
--- a/zircon/system/utest/async-testutils/rules.mk
+++ b/zircon/system/utest/async-testutils/rules.mk
@@ -10,6 +10,7 @@
 
 MODULE_SRCS += \
 	$(LOCAL_DIR)/test_loop_tests.cpp \
+	$(LOCAL_DIR)/main.c
 
 MODULE_NAME := async-testutils-test
 
diff --git a/zircon/system/utest/async/main.c b/zircon/system/utest/async/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/async/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/async/rules.mk b/zircon/system/utest/async/rules.mk
index 7df4339..b94ee4a 100644
--- a/zircon/system/utest/async/rules.mk
+++ b/zircon/system/utest/async/rules.mk
@@ -11,6 +11,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/default_tests.cpp \
     $(LOCAL_DIR)/exception_tests.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/receiver_tests.cpp \
     $(LOCAL_DIR)/time_tests.cpp \
     $(LOCAL_DIR)/task_tests.cpp \
diff --git a/zircon/system/utest/banjo-compiler/main.cpp b/zircon/system/utest/banjo-compiler/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/banjo-compiler/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/banjo-compiler/rules.mk b/zircon/system/utest/banjo-compiler/rules.mk
index ba9e3bf..7537134 100644
--- a/zircon/system/utest/banjo-compiler/rules.mk
+++ b/zircon/system/utest/banjo-compiler/rules.mk
@@ -61,6 +61,7 @@
 
 
 MODULE_SRCS := \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/dup_attributes_tests.cpp \
     $(LOCAL_DIR)/flat_ast_tests.cpp \
     $(LOCAL_DIR)/formatter_unittests.cpp \
diff --git a/zircon/system/utest/biotime/biotime-test.cpp b/zircon/system/utest/biotime/biotime-test.cpp
index 9b553aa..ec0b17b 100644
--- a/zircon/system/utest/biotime/biotime-test.cpp
+++ b/zircon/system/utest/biotime/biotime-test.cpp
@@ -75,3 +75,8 @@
 END_TEST_CASE(biotime_tests)
 
 }
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/bitmap/main.c b/zircon/system/utest/bitmap/main.c
new file mode 100644
index 0000000..9bc8d0e
--- /dev/null
+++ b/zircon/system/utest/bitmap/main.c
@@ -0,0 +1,9 @@
+// Copyright 2016 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/bitmap/rules.mk b/zircon/system/utest/bitmap/rules.mk
index a5db8eb..564e2d3 100644
--- a/zircon/system/utest/bitmap/rules.mk
+++ b/zircon/system/utest/bitmap/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/raw-bitmap-tests.cpp \
     $(LOCAL_DIR)/rle-bitmap-tests.cpp \
 
diff --git a/zircon/system/utest/chromeos-disk-setup/chromeos-disk-setup.cpp b/zircon/system/utest/chromeos-disk-setup/chromeos-disk-setup.cpp
index be4cdac..f5af44b 100644
--- a/zircon/system/utest/chromeos-disk-setup/chromeos-disk-setup.cpp
+++ b/zircon/system/utest/chromeos-disk-setup/chromeos-disk-setup.cpp
@@ -592,3 +592,7 @@
 RUN_TEST(TestDiskTooSmall)
 RUN_TEST(TestIsCrosDevice)
 END_TEST_CASE(disk_wizard_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/cleanup/cleanup.c b/zircon/system/utest/cleanup/cleanup.c
index ae5393a..e83c39d 100644
--- a/zircon/system/utest/cleanup/cleanup.c
+++ b/zircon/system/utest/cleanup/cleanup.c
@@ -87,3 +87,7 @@
 BEGIN_TEST_CASE(cleanup_tests)
 RUN_TEST(cleanup_test)
 END_TEST_CASE(cleanup_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/cobalt-client/rules.mk b/zircon/system/utest/cobalt-client/rules.mk
index b90052b..2fda251 100644
--- a/zircon/system/utest/cobalt-client/rules.mk
+++ b/zircon/system/utest/cobalt-client/rules.mk
@@ -15,6 +15,7 @@
     $(LOCAL_DIR)/counter_test.cpp \
     $(LOCAL_DIR)/histogram_test.cpp \
     $(LOCAL_DIR)/metric_options_test.cpp \
+    $(LOCAL_DIR)/test_main.cpp \
     $(LOCAL_DIR)/timer_test.cpp \
     $(LOCAL_DIR)/types_internal_test.cpp \
 
diff --git a/zircon/system/utest/cobalt-client/test_main.cpp b/zircon/system/utest/cobalt-client/test_main.cpp
new file mode 100644
index 0000000..9dc457b
--- /dev/null
+++ b/zircon/system/utest/cobalt-client/test_main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : 1;
+}
diff --git a/zircon/system/utest/compiler/integer.cpp b/zircon/system/utest/compiler/integer.cpp
index 7a8509b..6e33c48 100644
--- a/zircon/system/utest/compiler/integer.cpp
+++ b/zircon/system/utest/compiler/integer.cpp
@@ -64,3 +64,7 @@
 RUN_TEST_ENABLE_CRASH_HANDLER(signed_underflow_test)
 RUN_TEST_ENABLE_CRASH_HANDLER(divide_by_zero_test)
 END_TEST_CASE(integer_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/core/bad-syscall/bad-syscall.c b/zircon/system/utest/core/bad-syscall/bad-syscall.c
index 9fdf245..bd7f682 100644
--- a/zircon/system/utest/core/bad-syscall/bad-syscall.c
+++ b/zircon/system/utest/core/bad-syscall/bad-syscall.c
@@ -52,3 +52,9 @@
 RUN_TEST(bad_access_test)
 RUN_TEST(bad_syscall_num_test)
 END_TEST_CASE(bad_syscall_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/c11-condvar/condvar.c b/zircon/system/utest/core/c11-condvar/condvar.c
index fb6524e..a8e1641 100644
--- a/zircon/system/utest/core/c11-condvar/condvar.c
+++ b/zircon/system/utest/core/c11-condvar/condvar.c
@@ -118,3 +118,9 @@
 RUN_TEST(cnd_test)
 RUN_TEST(cnd_timedwait_timeout_test)
 END_TEST_CASE(cnd_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/c11-mutex/mutex.c b/zircon/system/utest/core/c11-mutex/mutex.c
index e15f1f9..a616cd7 100644
--- a/zircon/system/utest/core/c11-mutex/mutex.c
+++ b/zircon/system/utest/core/c11-mutex/mutex.c
@@ -242,3 +242,9 @@
 RUN_TEST(test_static_initializer)
 RUN_TEST(test_timeout_elapsed)
 END_TEST_CASE(mtx_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/c11-thread/thread.c b/zircon/system/utest/core/c11-thread/thread.c
index e260527..bb30bbb 100644
--- a/zircon/system/utest/core/c11-thread/thread.c
+++ b/zircon/system/utest/core/c11-thread/thread.c
@@ -118,3 +118,9 @@
 RUN_TEST(long_name_succeeds)
 RUN_TEST(detach_self_test)
 END_TEST_CASE(c11_thread_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/channel/channel.c b/zircon/system/utest/core/channel/channel.c
index e74818a..8fbbd12 100644
--- a/zircon/system/utest/core/channel/channel.c
+++ b/zircon/system/utest/core/channel/channel.c
@@ -1067,3 +1067,9 @@
 RUN_TEST(channel_write_different_sizes)
 RUN_TEST(channel_write_takes_all_handles)
 END_TEST_CASE(channel_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/clock/clock.c b/zircon/system/utest/core/clock/clock.c
index 8f8ce33..56a0d9c 100644
--- a/zircon/system/utest/core/clock/clock.c
+++ b/zircon/system/utest/core/clock/clock.c
@@ -35,3 +35,9 @@
 BEGIN_TEST_CASE(clock_tests)
 RUN_TEST(clock_monotonic_test)
 END_TEST_CASE(clock_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/cookies/cookies.c b/zircon/system/utest/core/cookies/cookies.c
index b2c9a5b..05f77a0 100644
--- a/zircon/system/utest/core/cookies/cookies.c
+++ b/zircon/system/utest/core/cookies/cookies.c
@@ -99,3 +99,9 @@
 RUN_TEST(test_cookie_actions);
 RUN_TEST(test_cookie_eventpair);
 END_TEST_CASE(cookie_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/echo/echo.c b/zircon/system/utest/core/echo/echo.c
index 5dbab1d..2da036f 100644
--- a/zircon/system/utest/core/echo/echo.c
+++ b/zircon/system/utest/core/echo/echo.c
@@ -146,3 +146,10 @@
 BEGIN_TEST_CASE(echo_tests)
 RUN_TEST(echo_test)
 END_TEST_CASE(echo_tests)
+
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/elf-tls/tls.cpp b/zircon/system/utest/core/elf-tls/tls.cpp
index c1ffd1c..fc75f17 100644
--- a/zircon/system/utest/core/elf-tls/tls.cpp
+++ b/zircon/system/utest/core/elf-tls/tls.cpp
@@ -174,3 +174,9 @@
 BEGIN_TEST_CASE(elf_tls_tests)
 RUN_TEST(ExecutableTlsTest)
 END_TEST_CASE(elf_tls_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/event-pair/event-pair.c b/zircon/system/utest/core/event-pair/event-pair.c
index 8816a0c..ad6187a 100644
--- a/zircon/system/utest/core/event-pair/event-pair.c
+++ b/zircon/system/utest/core/event-pair/event-pair.c
@@ -135,3 +135,9 @@
 RUN_TEST(signal_peer_test)
 RUN_TEST(signal_peer_closed_test)
 END_TEST_CASE(eventpair_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/fifo/fifo.c b/zircon/system/utest/core/fifo/fifo.c
index 6d42959..ef76514 100644
--- a/zircon/system/utest/core/fifo/fifo.c
+++ b/zircon/system/utest/core/fifo/fifo.c
@@ -166,3 +166,9 @@
 RUN_TEST(peer_closed_test)
 RUN_TEST(options_test)
 END_TEST_CASE(fifo_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/futex/futex.cpp b/zircon/system/utest/core/futex/futex.cpp
index eff10d2..b24e25f 100644
--- a/zircon/system/utest/core/futex/futex.cpp
+++ b/zircon/system/utest/core/futex/futex.cpp
@@ -560,3 +560,10 @@
 RUN_TEST(TestFutexMisaligned);
 RUN_TEST(TestEventSignaling);
 END_TEST_CASE(futex_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/handle-close/handle-close.c b/zircon/system/utest/core/handle-close/handle-close.c
index 5a9d9c8..4f0523e 100644
--- a/zircon/system/utest/core/handle-close/handle-close.c
+++ b/zircon/system/utest/core/handle-close/handle-close.c
@@ -102,3 +102,9 @@
 RUN_TEST(handle_close_many_invalid_test)
 RUN_TEST(handle_close_many_duplicate_test)
 END_TEST_CASE(handle_close_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/handle-info/handle-info.c b/zircon/system/utest/core/handle-info/handle-info.c
index bff5b42..dc57613 100644
--- a/zircon/system/utest/core/handle-info/handle-info.c
+++ b/zircon/system/utest/core/handle-info/handle-info.c
@@ -169,3 +169,9 @@
 RUN_TEST(handle_related_koid_test)
 RUN_TEST(handle_rights_test)
 END_TEST_CASE(handle_info_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/handle-transfer/handle-transfer.c b/zircon/system/utest/core/handle-transfer/handle-transfer.c
index 4d17b5b..2ebed95 100644
--- a/zircon/system/utest/core/handle-transfer/handle-transfer.c
+++ b/zircon/system/utest/core/handle-transfer/handle-transfer.c
@@ -144,3 +144,9 @@
 RUN_TEST(handle_transfer_test)
 RUN_TEST(handle_transfer_cancel_wait_test)
 END_TEST_CASE(handle_transfer_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/handle-wait/handle-wait.c b/zircon/system/utest/core/handle-wait/handle-wait.c
index 218e078..91d6750 100644
--- a/zircon/system/utest/core/handle-wait/handle-wait.c
+++ b/zircon/system/utest/core/handle-wait/handle-wait.c
@@ -286,3 +286,10 @@
 BEGIN_TEST_CASE(handle_wait_tests)
 RUN_TEST(handle_wait_test);
 END_TEST_CASE(handle_wait_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/job/jobs.cpp b/zircon/system/utest/core/job/jobs.cpp
index 73121e9..a464b2b 100644
--- a/zircon/system/utest/core/job/jobs.cpp
+++ b/zircon/system/utest/core/job/jobs.cpp
@@ -445,3 +445,10 @@
 RUN_TEST(info_task_stats_fails)
 RUN_TEST(max_height_smoke)
 END_TEST_CASE(job_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/memory-mapping/memory-mapping.cpp b/zircon/system/utest/core/memory-mapping/memory-mapping.cpp
index cd4a93bf..a2e1f0b 100644
--- a/zircon/system/utest/core/memory-mapping/memory-mapping.cpp
+++ b/zircon/system/utest/core/memory-mapping/memory-mapping.cpp
@@ -269,3 +269,10 @@
 RUN_TEST(mmap_flags_test);
 RUN_TEST_ENABLE_CRASH_HANDLER(mprotect_test);
 END_TEST_CASE(memory_mapping_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/object-child/object-child.cpp b/zircon/system/utest/core/object-child/object-child.cpp
index e574270a..5ce966d 100644
--- a/zircon/system/utest/core/object-child/object-child.cpp
+++ b/zircon/system/utest/core/object-child/object-child.cpp
@@ -29,3 +29,9 @@
 BEGIN_TEST_CASE(object_get_child_tests)
 RUN_TEST(handle_invalid);
 END_TEST_CASE(object_get_child_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/object-info/object-info.cpp b/zircon/system/utest/core/object-info/object-info.cpp
index 85309ce..31d96674 100644
--- a/zircon/system/utest/core/object-info/object-info.cpp
+++ b/zircon/system/utest/core/object-info/object-info.cpp
@@ -1081,3 +1081,9 @@
 RUN_TEST(handle_stats_control);
 
 END_TEST_CASE(object_info_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/pager/pager.cpp b/zircon/system/utest/core/pager/pager.cpp
index 24ffbd7..a44ec7f 100644
--- a/zircon/system/utest/core/pager/pager.cpp
+++ b/zircon/system/utest/core/pager/pager.cpp
@@ -1797,3 +1797,12 @@
 END_TEST_CASE(api_violations)
 
 } // namespace pager_tests
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    if (!unittest_run_all_tests(argc, argv)) {
+        return -1;
+    }
+    return 0;
+}
+#endif
diff --git a/zircon/system/utest/core/port/ports.cpp b/zircon/system/utest/core/port/ports.cpp
index cf169d3..370ccb3 100644
--- a/zircon/system/utest/core/port/ports.cpp
+++ b/zircon/system/utest/core/port/ports.cpp
@@ -701,3 +701,9 @@
 RUN_TEST(threads_event_repeat)
 RUN_TEST_LARGE(cancel_stress)
 END_TEST_CASE(port_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/process/process.cpp b/zircon/system/utest/core/process/process.cpp
index f3f92c4..78ee0f7 100644
--- a/zircon/system/utest/core/process/process.cpp
+++ b/zircon/system/utest/core/process/process.cpp
@@ -682,3 +682,10 @@
 RUN_TEST(suspend_twice_before_creating_threads);
 RUN_TEST(suspend_with_dying_thread);
 END_TEST_CASE(process_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/pthread-barrier/barrier.c b/zircon/system/utest/core/pthread-barrier/barrier.c
index 19a63ab..e0f9af2 100644
--- a/zircon/system/utest/core/pthread-barrier/barrier.c
+++ b/zircon/system/utest/core/pthread-barrier/barrier.c
@@ -68,3 +68,9 @@
 BEGIN_TEST_CASE(pthread_barrier_tests)
 RUN_TEST(test_barrier)
 END_TEST_CASE(pthread_barrier_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/pthread-tls/tls-test.c b/zircon/system/utest/core/pthread-tls/tls-test.c
index 8dd8a8a..98c2957 100644
--- a/zircon/system/utest/core/pthread-tls/tls-test.c
+++ b/zircon/system/utest/core/pthread-tls/tls-test.c
@@ -75,3 +75,9 @@
 BEGIN_TEST_CASE(tls_tests)
 RUN_TEST(tls_test)
 END_TEST_CASE(tls_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/pthread/pthread.cpp b/zircon/system/utest/core/pthread/pthread.cpp
index 00e6865..73703f8 100644
--- a/zircon/system/utest/core/pthread/pthread.cpp
+++ b/zircon/system/utest/core/pthread/pthread.cpp
@@ -370,3 +370,9 @@
 RUN_TEST(pthread_getstack_main_thread)
 RUN_TEST(pthread_getstack_other_thread)
 END_TEST_CASE(pthread_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/socket/socket.cpp b/zircon/system/utest/core/socket/socket.cpp
index 8c6b3ae..4033a83 100644
--- a/zircon/system/utest/core/socket/socket.cpp
+++ b/zircon/system/utest/core/socket/socket.cpp
@@ -1405,3 +1405,9 @@
 RUN_TEST(socket_share_consumes_on_failure)
 RUN_TEST(socket_signals2)
 END_TEST_CASE(socket_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/stack/stack-test.c b/zircon/system/utest/core/stack/stack-test.c
index d975dc6..d960d0485 100644
--- a/zircon/system/utest/core/stack/stack-test.c
+++ b/zircon/system/utest/core/stack/stack-test.c
@@ -124,3 +124,9 @@
 RUN_TEST(main_thread_stack_tests)
 RUN_TEST(other_thread_stack_tests)
 END_TEST_CASE(stack_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/sync-completion/main.c b/zircon/system/utest/core/sync-completion/main.c
index cafcb19..ca7ffe1 100644
--- a/zircon/system/utest/core/sync-completion/main.c
+++ b/zircon/system/utest/core/sync-completion/main.c
@@ -82,3 +82,9 @@
 RUN_TEST(test_completions)
 RUN_TEST(test_timeout)
 END_TEST_CASE(sync_completion_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/sync-condition/condition.cpp b/zircon/system/utest/core/sync-condition/condition.cpp
index af536a6..73b9ff7 100644
--- a/zircon/system/utest/core/sync-condition/condition.cpp
+++ b/zircon/system/utest/core/sync-condition/condition.cpp
@@ -44,3 +44,10 @@
 RUN_TEST(Condition::condition_test);
 RUN_TEST(Condition::condition_timeout_test);
 END_TEST_CASE(sync_condition_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/sync-mutex/mutex.c b/zircon/system/utest/core/sync-mutex/mutex.c
index b6c95ac..357dd10 100644
--- a/zircon/system/utest/core/sync-mutex/mutex.c
+++ b/zircon/system/utest/core/sync-mutex/mutex.c
@@ -209,3 +209,9 @@
 RUN_TEST(test_try_mutexes)
 RUN_TEST(test_timeout_elapsed)
 END_TEST_CASE(sync_mutex_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/threads/threads.cpp b/zircon/system/utest/core/threads/threads.cpp
index 55edabce..9761789 100644
--- a/zircon/system/utest/core/threads/threads.cpp
+++ b/zircon/system/utest/core/threads/threads.cpp
@@ -1678,3 +1678,9 @@
 // RUN_TEST(TestDebugRegistersValidation);
 
 END_TEST_CASE(threads_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/time/ticks.c b/zircon/system/utest/core/time/ticks.c
index 095c34d..92eb3e7 100644
--- a/zircon/system/utest/core/time/ticks.c
+++ b/zircon/system/utest/core/time/ticks.c
@@ -28,3 +28,9 @@
 BEGIN_TEST_CASE(ticks_tests)
 RUN_TEST(elapsed_time_using_ticks)
 END_TEST_CASE(ticks_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/vmar/vmar.cpp b/zircon/system/utest/core/vmar/vmar.cpp
index 0246298..0eb3ea6b 100644
--- a/zircon/system/utest/core/vmar/vmar.cpp
+++ b/zircon/system/utest/core/vmar/vmar.cpp
@@ -2025,3 +2025,10 @@
 RUN_TEST(partial_unmap_and_write);
 RUN_TEST(partial_unmap_with_vmar_offset);
 END_TEST_CASE(vmar_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/core/vmo-signal/vmo-signal.c b/zircon/system/utest/core/vmo-signal/vmo-signal.c
index 552a197..99b73fb 100644
--- a/zircon/system/utest/core/vmo-signal/vmo-signal.c
+++ b/zircon/system/utest/core/vmo-signal/vmo-signal.c
@@ -130,3 +130,9 @@
 RUN_TEST(vmo_child_signal_clone_test)
 RUN_TEST(vmo_child_signal_map_test)
 END_TEST_CASE(vmo_signal_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
+#endif
diff --git a/zircon/system/utest/cprng/cprng.c b/zircon/system/utest/cprng/cprng.c
index 605e967..97e8870 100644
--- a/zircon/system/utest/cprng/cprng.c
+++ b/zircon/system/utest/cprng/cprng.c
@@ -47,3 +47,7 @@
 RUN_TEST(cprng_test_add_entropy_buf_too_large)
 RUN_TEST(cprng_test_add_entropy_bad_buf)
 END_TEST_CASE(cprng_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/crypto/main.c b/zircon/system/utest/crypto/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/crypto/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/crypto/rules.mk b/zircon/system/utest/crypto/rules.mk
index ccbddc1..417256c 100644
--- a/zircon/system/utest/crypto/rules.mk
+++ b/zircon/system/utest/crypto/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS := \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/utils.cpp \
 
 MODULE_SRCS += \
diff --git a/zircon/system/utest/ctor/ctor.cpp b/zircon/system/utest/ctor/ctor.cpp
index a1a8b01..b006d34 100644
--- a/zircon/system/utest/ctor/ctor.cpp
+++ b/zircon/system/utest/ctor/ctor.cpp
@@ -70,3 +70,7 @@
 RUN_TEST(check_dso_ctor)
 RUN_TEST(check_thread_local_ctor_dtor)
 END_TEST_CASE(ctors)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/devfs/main.c b/zircon/system/utest/devfs/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/devfs/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/devfs/rules.mk b/zircon/system/utest/devfs/rules.mk
index 5a107ea..773b313 100644
--- a/zircon/system/utest/devfs/rules.mk
+++ b/zircon/system/utest/devfs/rules.mk
@@ -13,6 +13,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/fdio-tests.cpp \
     $(LOCAL_DIR)/fidl-tests.cpp \
+    $(LOCAL_DIR)/main.c \
 
 MODULE_NAME := devfs-test
 
diff --git a/zircon/system/utest/digest/main.c b/zircon/system/utest/digest/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/digest/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/digest/rules.mk b/zircon/system/utest/digest/rules.mk
index f3795877..c1cc725 100644
--- a/zircon/system/utest/digest/rules.mk
+++ b/zircon/system/utest/digest/rules.mk
@@ -11,6 +11,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/digest.cpp \
     $(LOCAL_DIR)/merkle-tree.cpp \
+    $(LOCAL_DIR)/main.c
 
 MODULE_NAME := digest-test
 
diff --git a/zircon/system/utest/dlfcn/dlfcn.c b/zircon/system/utest/dlfcn/dlfcn.c
index 388ad91..8863546b 100644
--- a/zircon/system/utest/dlfcn/dlfcn.c
+++ b/zircon/system/utest/dlfcn/dlfcn.c
@@ -167,17 +167,16 @@
     END_TEST;
 }
 
-void test_global_function(void) {}
-
-static bool dladdr_unexported_test(void) {
+int main(int argc, char** argv);
+static bool dladdr_main_test(void) {
     BEGIN_TEST;
 
     Dl_info info;
-    ASSERT_NE(dladdr(&test_global_function, &info), 0, "dladdr failed");
+    ASSERT_NE(dladdr(&main, &info), 0, "dladdr failed");
 
-    // This symbol is not exported to .dynsym, so it won't be found.
-    EXPECT_NULL(info.dli_sname, "unexpected symbol name");
-    EXPECT_NULL(info.dli_saddr, "unexpected symbol address");
+    // The "main" symbol is not exported to .dynsym, so it won't be found.
+    EXPECT_EQ(info.dli_sname, NULL, "unexpected symbol name");
+    EXPECT_EQ(info.dli_saddr, NULL, "unexpected symbol address");
 
     END_TEST;
 }
@@ -188,5 +187,10 @@
 RUN_TEST(dlopen_vmo_test);
 RUN_TEST(loader_service_test);
 RUN_TEST(clone_test);
-RUN_TEST(dladdr_unexported_test);
+RUN_TEST(dladdr_main_test);
 END_TEST_CASE(dlfcn_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/dlopen-indirect-deps/dlopen-indirect-deps.c b/zircon/system/utest/dlopen-indirect-deps/dlopen-indirect-deps.c
index ff4b8f6..b2f1b2a 100644
--- a/zircon/system/utest/dlopen-indirect-deps/dlopen-indirect-deps.c
+++ b/zircon/system/utest/dlopen-indirect-deps/dlopen-indirect-deps.c
@@ -29,3 +29,8 @@
 BEGIN_TEST_CASE(dlopen_indirect_deps_tests)
 RUN_TEST(dlopen_indirect_deps_test);
 END_TEST_CASE(dlopen_indirect_deps_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/elf-search/elf-search-test.cpp b/zircon/system/utest/elf-search/elf-search-test.cpp
index 58f2571..675b2c5 100644
--- a/zircon/system/utest/elf-search/elf-search-test.cpp
+++ b/zircon/system/utest/elf-search/elf-search-test.cpp
@@ -187,3 +187,8 @@
 // sussed out by looking at coverage results.
 RUN_TEST(ElfSearchTest)
 END_TEST_CASE(elf_search_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/entropy/entropy.cpp b/zircon/system/utest/entropy/entropy.cpp
index 64dbabe..1865c60 100644
--- a/zircon/system/utest/entropy/entropy.cpp
+++ b/zircon/system/utest/entropy/entropy.cpp
@@ -27,3 +27,7 @@
 END_TEST_CASE(entropy_tests)
 
 #endif
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/errno/errno.c b/zircon/system/utest/errno/errno.c
index 9eb7586..d579127 100644
--- a/zircon/system/utest/errno/errno.c
+++ b/zircon/system/utest/errno/errno.c
@@ -45,3 +45,7 @@
 BEGIN_TEST_CASE(errno_tests)
 RUN_TEST(errno_test)
 END_TEST_CASE(errno_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/ethernet/ethernet.cpp b/zircon/system/utest/ethernet/ethernet.cpp
index cb2069c..021801fd 100644
--- a/zircon/system/utest/ethernet/ethernet.cpp
+++ b/zircon/system/utest/ethernet/ethernet.cpp
@@ -934,3 +934,8 @@
 RUN_TEST_MEDIUM(EthernetDataTest_Send)
 RUN_TEST_MEDIUM(EthernetDataTest_Recv)
 END_TEST_CASE(EthernetDataTests)
+
+int main(int argc, char* argv[]) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/events/events.c b/zircon/system/utest/events/events.c
index f8e7f78..4621760 100644
--- a/zircon/system/utest/events/events.c
+++ b/zircon/system/utest/events/events.c
@@ -287,3 +287,7 @@
 RUN_TEST(reset_test)
 RUN_TEST(wait_many_failures_test)
 END_TEST_CASE(event_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/exit/exit.c b/zircon/system/utest/exit/exit.c
index f629d2d..d8c8f1d 100644
--- a/zircon/system/utest/exit/exit.c
+++ b/zircon/system/utest/exit/exit.c
@@ -30,3 +30,7 @@
 BEGIN_TEST_CASE(hard_to_exit)
 RUN_TEST(mutex_block)
 END_TEST_CASE(hard_to_exit)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fbl/main.c b/zircon/system/utest/fbl/main.c
new file mode 100644
index 0000000..9bc8d0e
--- /dev/null
+++ b/zircon/system/utest/fbl/main.c
@@ -0,0 +1,9 @@
+// Copyright 2016 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fbl/rules.mk b/zircon/system/utest/fbl/rules.mk
index d09b432..766377c 100644
--- a/zircon/system/utest/fbl/rules.mk
+++ b/zircon/system/utest/fbl/rules.mk
@@ -20,6 +20,7 @@
     $(LOCAL_DIR)/intrusive_hash_table_sll_tests.cpp \
     $(LOCAL_DIR)/intrusive_singly_linked_list_tests.cpp \
     $(LOCAL_DIR)/intrusive_wavl_tree_tests.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/recycler_tests.cpp \
     $(LOCAL_DIR)/ref_ptr_tests.cpp \
     $(LOCAL_DIR)/string_buffer_tests.cpp \
diff --git a/zircon/system/utest/fdio/main.c b/zircon/system/utest/fdio/main.c
new file mode 100644
index 0000000..bfd9b24
--- /dev/null
+++ b/zircon/system/utest/fdio/main.c
@@ -0,0 +1,10 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/fdio/rules.mk b/zircon/system/utest/fdio/rules.mk
index a1cdb54..3adc4fc 100644
--- a/zircon/system/utest/fdio/rules.mk
+++ b/zircon/system/utest/fdio/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/fdio_fd.cpp \
     $(LOCAL_DIR)/fdio_handle_fd.c \
     $(LOCAL_DIR)/fdio_open_max.c \
diff --git a/zircon/system/utest/fidl-compiler/main.cpp b/zircon/system/utest/fidl-compiler/main.cpp
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/fidl-compiler/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fidl-compiler/rules.mk b/zircon/system/utest/fidl-compiler/rules.mk
index f2aef1e..82ff693 100644
--- a/zircon/system/utest/fidl-compiler/rules.mk
+++ b/zircon/system/utest/fidl-compiler/rules.mk
@@ -75,6 +75,7 @@
     $(LOCAL_DIR)/flat_ast_tests.cpp \
     $(LOCAL_DIR)/formatter_unittests.cpp \
     $(LOCAL_DIR)/json_generator_tests.cpp \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/max_bytes_multipass_tests.cpp \
     $(LOCAL_DIR)/max_bytes_tests.cpp \
     $(LOCAL_DIR)/max_handle_tests.cpp \
diff --git a/zircon/system/utest/fidl-llcpp-interop/main.cpp b/zircon/system/utest/fidl-llcpp-interop/main.cpp
new file mode 100644
index 0000000..57f8f55
--- /dev/null
+++ b/zircon/system/utest/fidl-llcpp-interop/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
\ No newline at end of file
diff --git a/zircon/system/utest/fidl-llcpp-interop/rules.mk b/zircon/system/utest/fidl-llcpp-interop/rules.mk
index 4f6ce47..59204de 100644
--- a/zircon/system/utest/fidl-llcpp-interop/rules.mk
+++ b/zircon/system/utest/fidl-llcpp-interop/rules.mk
@@ -41,6 +41,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/generated/fidl_llcpp_basictypes.cpp \
     $(LOCAL_DIR)/generated/fidl_llcpp_dirent.cpp \
     $(LOCAL_DIR)/basictypes_tests.cpp \
@@ -76,3 +77,4 @@
     -Isystem/utest/fidl-llcpp-interop/generated \
 
 include make/module.mk
+
diff --git a/zircon/system/utest/fidl-simple/main.c b/zircon/system/utest/fidl-simple/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/fidl-simple/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fidl-simple/rules.mk b/zircon/system/utest/fidl-simple/rules.mk
index d550ef2..0f5b0d3 100644
--- a/zircon/system/utest/fidl-simple/rules.mk
+++ b/zircon/system/utest/fidl-simple/rules.mk
@@ -44,6 +44,7 @@
     $(LOCAL_DIR)/client_tests.c \
     $(LOCAL_DIR)/fakesocket_tests.cpp \
     $(LOCAL_DIR)/ldsvc_tests.c \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/server_tests.c \
     $(LOCAL_DIR)/spaceship_tests.c \
     $(LOCAL_DIR)/spaceship_tests.cpp \
diff --git a/zircon/system/utest/fidl/main.c b/zircon/system/utest/fidl/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/fidl/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fidl/rules.mk b/zircon/system/utest/fidl/rules.mk
index 1969c2b..db7a253 100644
--- a/zircon/system/utest/fidl/rules.mk
+++ b/zircon/system/utest/fidl/rules.mk
@@ -18,6 +18,7 @@
     $(LOCAL_DIR)/handle_closing_tests.cpp \
     $(LOCAL_DIR)/linearizing_tests.cpp \
     $(LOCAL_DIR)/llcpp_types_tests.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/message_tests.cpp \
     $(LOCAL_DIR)/validating_tests.cpp \
 
diff --git a/zircon/system/utest/fit/main.c b/zircon/system/utest/fit/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/fit/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fit/rules.mk b/zircon/system/utest/fit/rules.mk
index cc99529..89f206d 100644
--- a/zircon/system/utest/fit/rules.mk
+++ b/zircon/system/utest/fit/rules.mk
@@ -8,6 +8,7 @@
 # Zircon currently only supports that for the host.
 fit_zircon_friendly_usertests := \
     $(LOCAL_DIR)/function_tests.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/nullable_tests.cpp \
     $(LOCAL_DIR)/optional_tests.cpp \
     $(LOCAL_DIR)/result_tests.cpp \
diff --git a/zircon/system/utest/fpu/fputest.c b/zircon/system/utest/fpu/fputest.c
index 60a38fd..0490a80 100644
--- a/zircon/system/utest/fpu/fputest.c
+++ b/zircon/system/utest/fpu/fputest.c
@@ -89,3 +89,8 @@
 BEGIN_TEST_CASE(fpu_tests)
 RUN_TEST(fpu_test);
 END_TEST_CASE(fpu_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/fs-host/main.cpp b/zircon/system/utest/fs-host/main.cpp
new file mode 100644
index 0000000..9bfc91c
--- /dev/null
+++ b/zircon/system/utest/fs-host/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
\ No newline at end of file
diff --git a/zircon/system/utest/fs-host/rules.mk b/zircon/system/utest/fs-host/rules.mk
index 921d98d..78587fe 100644
--- a/zircon/system/utest/fs-host/rules.mk
+++ b/zircon/system/utest/fs-host/rules.mk
@@ -11,6 +11,7 @@
 MODULE_NAME := fs-test
 
 MODULE_SRCS := \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/util.cpp \
     $(LOCAL_DIR)/test-basic.cpp \
     $(LOCAL_DIR)/test-directory.cpp \
diff --git a/zircon/system/utest/fs-vnode/main.c b/zircon/system/utest/fs-vnode/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/fs-vnode/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fs-vnode/rules.mk b/zircon/system/utest/fs-vnode/rules.mk
index 22c27b13..e68c5209 100644
--- a/zircon/system/utest/fs-vnode/rules.mk
+++ b/zircon/system/utest/fs-vnode/rules.mk
@@ -16,6 +16,7 @@
     $(LOCAL_DIR)/service-tests.cpp \
     $(LOCAL_DIR)/teardown-tests.cpp \
     $(LOCAL_DIR)/vmo-file-tests.cpp \
+    $(LOCAL_DIR)/main.c
 
 MODULE_NAME := fs-vnode-test
 
diff --git a/zircon/system/utest/fuzz-utils/main.cpp b/zircon/system/utest/fuzz-utils/main.cpp
new file mode 100644
index 0000000..3d7400e
--- /dev/null
+++ b/zircon/system/utest/fuzz-utils/main.cpp
@@ -0,0 +1,11 @@
+// Copyright 2018 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 <stdio.h>
+
+#include <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fuzz-utils/rules.mk b/zircon/system/utest/fuzz-utils/rules.mk
index 61b52c9..2f6abb0 100644
--- a/zircon/system/utest/fuzz-utils/rules.mk
+++ b/zircon/system/utest/fuzz-utils/rules.mk
@@ -11,6 +11,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/fixture.cpp \
     $(LOCAL_DIR)/fuzzer-fixture.cpp \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/test-fuzzer.cpp \
 
 MODULE_SRCS += \
diff --git a/zircon/system/utest/fzl/main.c b/zircon/system/utest/fzl/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/fzl/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/fzl/rules.mk b/zircon/system/utest/fzl/rules.mk
index db28baa..14fca5b 100644
--- a/zircon/system/utest/fzl/rules.mk
+++ b/zircon/system/utest/fzl/rules.mk
@@ -12,6 +12,7 @@
 
 MODULE_SRCS := \
     $(LOCAL_DIR)/fdio.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/memory_probe_tests.cpp \
 
 MODULE_STATIC_LIBS := \
diff --git a/zircon/system/utest/getentropy/getentropy.cpp b/zircon/system/utest/getentropy/getentropy.cpp
index 34e8920..d93299c 100644
--- a/zircon/system/utest/getentropy/getentropy.cpp
+++ b/zircon/system/utest/getentropy/getentropy.cpp
@@ -46,3 +46,7 @@
 RUN_TEST(getentropy_valid);
 RUN_TEST(getentropy_too_big);
 END_TEST_CASE(getentropy_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/handle-alias/handle-alias.c b/zircon/system/utest/handle-alias/handle-alias.c
index 7ca2395..0e580fb 100644
--- a/zircon/system/utest/handle-alias/handle-alias.c
+++ b/zircon/system/utest/handle-alias/handle-alias.c
@@ -121,3 +121,8 @@
 BEGIN_TEST_CASE(handle_reuse)
 RUN_TEST_LARGE(handle_value_alias_test); // Potentially flaky => large test
 END_TEST_CASE(handle_reuse)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/hid-parser/hid-parser-test.cpp b/zircon/system/utest/hid-parser/hid-parser-test.cpp
index abf6942..a96b61c 100644
--- a/zircon/system/utest/hid-parser/hid-parser-test.cpp
+++ b/zircon/system/utest/hid-parser/hid-parser-test.cpp
@@ -920,3 +920,8 @@
 RUN_TEST(parse_asus_touch)
 RUN_TEST(parse_eve_touchpad_v2)
 END_TEST_CASE(hidparser_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/hid/hid-test.cpp b/zircon/system/utest/hid/hid-test.cpp
index c233b0b..da6f845 100644
--- a/zircon/system/utest/hid/hid-test.cpp
+++ b/zircon/system/utest/hid/hid-test.cpp
@@ -312,3 +312,8 @@
 RUN_TEST(parse_acer12)
 RUN_TEST(parse_asus)
 END_TEST_CASE(hid_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/hypervisor/main.cpp b/zircon/system/utest/hypervisor/main.cpp
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/hypervisor/main.cpp
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/hypervisor/rules.mk b/zircon/system/utest/hypervisor/rules.mk
index d99e54f..7c0edda 100644
--- a/zircon/system/utest/hypervisor/rules.mk
+++ b/zircon/system/utest/hypervisor/rules.mk
@@ -13,6 +13,7 @@
 MODULE_SRCS += \
     $(LOCAL_DIR)/$(ARCH).S \
     $(LOCAL_DIR)/guest.cpp \
+    $(LOCAL_DIR)/main.cpp \
 
 MODULE_LIBS := \
     system/ulib/c \
diff --git a/zircon/system/utest/inspect-vmo/main.cpp b/zircon/system/utest/inspect-vmo/main.cpp
new file mode 100644
index 0000000..cc704bf
--- /dev/null
+++ b/zircon/system/utest/inspect-vmo/main.cpp
@@ -0,0 +1,10 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/inspect-vmo/rules.mk b/zircon/system/utest/inspect-vmo/rules.mk
index e5047c6..6cb98a6 100644
--- a/zircon/system/utest/inspect-vmo/rules.mk
+++ b/zircon/system/utest/inspect-vmo/rules.mk
@@ -11,6 +11,7 @@
 MODULE_NAME := inspect-test
 
 MODULE_SRCS := \
+    $(LOCAL_DIR)/main.cpp \
     $(LOCAL_DIR)/heap_tests.cpp \
     $(LOCAL_DIR)/inspect_tests.cpp \
     $(LOCAL_DIR)/scanner_tests.cpp \
@@ -29,5 +30,6 @@
     system/ulib/fdio  \
     system/ulib/unittest \
     system/ulib/zircon \
+    system/ulib/unittest \
 
 include make/module.mk
diff --git a/zircon/system/utest/int-types/int-types.cpp b/zircon/system/utest/int-types/int-types.cpp
index ef0191b..e50164e 100644
--- a/zircon/system/utest/int-types/int-types.cpp
+++ b/zircon/system/utest/int-types/int-types.cpp
@@ -325,3 +325,7 @@
 BEGIN_TEST_CASE(format_specifiers)
 RUN_TEST(check_format_specifiers)
 END_TEST_CASE(format_specifiers)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/kcounter/kcounter-test.cpp b/zircon/system/utest/kcounter/kcounter-test.cpp
index 51e8189..db1d68a 100644
--- a/zircon/system/utest/kcounter/kcounter-test.cpp
+++ b/zircon/system/utest/kcounter/kcounter-test.cpp
@@ -131,3 +131,8 @@
 BEGIN_TEST_CASE(counters_test)
 RUN_TEST(test_counters)
 END_TEST_CASE(counters_test)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/kernel-unittests/kernel-unittests.cpp b/zircon/system/utest/kernel-unittests/kernel-unittests.cpp
index 232a84e1..c8924a9 100644
--- a/zircon/system/utest/kernel-unittests/kernel-unittests.cpp
+++ b/zircon/system/utest/kernel-unittests/kernel-unittests.cpp
@@ -47,3 +47,8 @@
 BEGIN_TEST_CASE(kernel_unittests)
 RUN_TEST(run_kernel_unittests)
 END_TEST_CASE(kernel_unittests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/libfzl/main.c b/zircon/system/utest/libfzl/main.c
new file mode 100644
index 0000000..7e15b95
--- /dev/null
+++ b/zircon/system/utest/libfzl/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/libfzl/rules.mk b/zircon/system/utest/libfzl/rules.mk
index 5aabb93..f7be6a7 100644
--- a/zircon/system/utest/libfzl/rules.mk
+++ b/zircon/system/utest/libfzl/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/fzl-test.cpp \
     $(LOCAL_DIR)/owned-vmo-mapper-tests.cpp \
     $(LOCAL_DIR)/resizeable-vmo-mapper-tests.cpp \
diff --git a/zircon/system/utest/libhwreg/bitfields-test.cpp b/zircon/system/utest/libhwreg/bitfields-test.cpp
index 31a68e3..24dde0b 100644
--- a/zircon/system/utest/libhwreg/bitfields-test.cpp
+++ b/zircon/system/utest/libhwreg/bitfields-test.cpp
@@ -498,3 +498,8 @@
 RUN_TEST(print_test)
 RUN_TEST(set_chaining_test)
 END_TEST_CASE(libhwreg_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/libzx/zx-test.cpp b/zircon/system/utest/libzx/zx-test.cpp
index 382a5a09..8b4fdb4 100644
--- a/zircon/system/utest/libzx/zx-test.cpp
+++ b/zircon/system/utest/libzx/zx-test.cpp
@@ -653,3 +653,8 @@
 RUN_TEST(unowned_test)
 RUN_TEST(get_child_test)
 END_TEST_CASE(libzx_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/logger/test.cpp b/zircon/system/utest/logger/test.cpp
index 1fd09b8..eaea90b 100644
--- a/zircon/system/utest/logger/test.cpp
+++ b/zircon/system/utest/logger/test.cpp
@@ -247,3 +247,7 @@
 RUN_TEST(TestLoggerDiesWithSocket)
 RUN_TEST(TestLoggerDiesWithChannelWhenNoConnectCalled)
 END_TEST_CASE(logger_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/memfs/main.c b/zircon/system/utest/memfs/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/memfs/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/memfs/rules.mk b/zircon/system/utest/memfs/rules.mk
index 49a6af6..8e21abd 100644
--- a/zircon/system/utest/memfs/rules.mk
+++ b/zircon/system/utest/memfs/rules.mk
@@ -12,6 +12,7 @@
 
 MODULE_SRCS += \
     $(LOCAL_DIR)/fidl-tests.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/memfs-tests.cpp \
     $(LOCAL_DIR)/vmofile-tests.cpp \
 
diff --git a/zircon/system/utest/namespace/namespace-test.cpp b/zircon/system/utest/namespace/namespace-test.cpp
index 442f700..3ce1d73 100644
--- a/zircon/system/utest/namespace/namespace-test.cpp
+++ b/zircon/system/utest/namespace/namespace-test.cpp
@@ -379,3 +379,7 @@
 END_TEST_CASE(namespace_tests)
 
 } // namespace
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/platform-bus/main.cpp b/zircon/system/utest/platform-bus/main.cpp
index 1ba9695..f0a30fc 100644
--- a/zircon/system/utest/platform-bus/main.cpp
+++ b/zircon/system/utest/platform-bus/main.cpp
@@ -104,3 +104,7 @@
 BEGIN_TEST_CASE(pbus_tests)
 RUN_TEST(enumeration_test)
 END_TEST_CASE(pbus_tests);
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/policy/job-policy.cpp b/zircon/system/utest/policy/job-policy.cpp
index fe36f0c..5a452f6 100644
--- a/zircon/system/utest/policy/job-policy.cpp
+++ b/zircon/system/utest/policy/job-policy.cpp
@@ -464,3 +464,8 @@
 RUN_TEST(TestExceptionOnBadHandle)
 RUN_TEST(TestGetInfoOnBadHandle)
 END_TEST_CASE(job_policy)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/posixio/main.cpp b/zircon/system/utest/posixio/main.cpp
index 9e8aaa8..a13de00 100644
--- a/zircon/system/utest/posixio/main.cpp
+++ b/zircon/system/utest/posixio/main.cpp
@@ -107,3 +107,8 @@
 RUN_TEST(lstat_empty_test)
 RUN_TEST(open_empty_test)
 END_TEST_CASE(posixio_test)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/processor/processor.c b/zircon/system/utest/processor/processor.c
index 847a8a0..6188069 100644
--- a/zircon/system/utest/processor/processor.c
+++ b/zircon/system/utest/processor/processor.c
@@ -51,3 +51,7 @@
 BEGIN_TEST_CASE(processor_tests)
 RUN_TEST(processor_test)
 END_TEST_CASE(processor_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/profile/profile.cpp b/zircon/system/utest/profile/profile.cpp
index b713fbb..00efaf1 100644
--- a/zircon/system/utest/profile/profile.cpp
+++ b/zircon/system/utest/profile/profile.cpp
@@ -48,3 +48,7 @@
 BEGIN_TEST_CASE(sched_profiles)
 RUN_TEST(get_profile);
 END_TEST_CASE(sched_profiles)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/property/property.c b/zircon/system/utest/property/property.c
index 632f5b8..5fc6a8f 100644
--- a/zircon/system/utest/property/property.c
+++ b/zircon/system/utest/property/property.c
@@ -408,3 +408,8 @@
 RUN_TEST(gs_test)
 #endif
 END_TEST_CASE(property_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/pty/pty-test.c b/zircon/system/utest/pty/pty-test.c
index 25e03c3..4c091d6 100644
--- a/zircon/system/utest/pty/pty-test.c
+++ b/zircon/system/utest/pty/pty-test.c
@@ -225,3 +225,7 @@
 RUN_TEST(pty_test)
 RUN_TEST(not_a_pty_test)
 END_TEST_CASE(pty_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/qsort/qsort.c b/zircon/system/utest/qsort/qsort.c
index fc3b8bb..376a372 100644
--- a/zircon/system/utest/qsort/qsort.c
+++ b/zircon/system/utest/qsort/qsort.c
@@ -57,3 +57,7 @@
 BEGIN_TEST_CASE(qsort_tests)
 RUN_TEST(qsort_test)
 END_TEST_CASE(qsort_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/ramdisk/main.c b/zircon/system/utest/ramdisk/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/ramdisk/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/ramdisk/rules.mk b/zircon/system/utest/ramdisk/rules.mk
index 94ab5d0..4379a88 100644
--- a/zircon/system/utest/ramdisk/rules.mk
+++ b/zircon/system/utest/ramdisk/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/ramdisk.cpp \
 
 MODULE_NAME := ramdisk-test
diff --git a/zircon/system/utest/region-alloc/main.c b/zircon/system/utest/region-alloc/main.c
new file mode 100644
index 0000000..9bc8d0e
--- /dev/null
+++ b/zircon/system/utest/region-alloc/main.c
@@ -0,0 +1,9 @@
+// Copyright 2016 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/region-alloc/rules.mk b/zircon/system/utest/region-alloc/rules.mk
index 63f309d..df0ac937 100644
--- a/zircon/system/utest/region-alloc/rules.mk
+++ b/zircon/system/utest/region-alloc/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/region-alloc.cpp \
     $(LOCAL_DIR)/region-alloc-c-api.c
 
diff --git a/zircon/system/utest/register-state/register-state-test.cpp b/zircon/system/utest/register-state/register-state-test.cpp
index ce867bd..a413a74 100644
--- a/zircon/system/utest/register-state/register-state-test.cpp
+++ b/zircon/system/utest/register-state/register-state-test.cpp
@@ -173,3 +173,8 @@
 END_TEST_CASE(register_state_tests)
 
 #endif
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/rtc-lib/rtc.cpp b/zircon/system/utest/rtc-lib/rtc.cpp
index 38149de..29ae47b 100644
--- a/zircon/system/utest/rtc-lib/rtc.cpp
+++ b/zircon/system/utest/rtc-lib/rtc.cpp
@@ -54,3 +54,7 @@
 RUN_TEST(santitize_rtc_test)
 RUN_TEST(seconds_since_epoch_test)
 END_TEST_CASE(rtc_lib_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/runtests-utils/helper/publish-data-helper.c b/zircon/system/utest/runtests-utils/helper/publish-data-helper.c
index 7b0a673..e48a42f 100644
--- a/zircon/system/utest/runtests-utils/helper/publish-data-helper.c
+++ b/zircon/system/utest/runtests-utils/helper/publish-data-helper.c
@@ -22,3 +22,7 @@
 BEGIN_TEST_CASE(publish_data_helper_tests)
 RUN_TEST(publish_data)
 END_TEST_CASE(publish_data_helper_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/sanitizer/sanitizer-utils.c b/zircon/system/utest/sanitizer/sanitizer-utils.c
index d9ff3c221..29b45ea 100644
--- a/zircon/system/utest/sanitizer/sanitizer-utils.c
+++ b/zircon/system/utest/sanitizer/sanitizer-utils.c
@@ -188,3 +188,8 @@
 RUN_TEST(publish_data_test);
 RUN_TEST(debug_config_test);
 END_TEST_CASE(sanitizer_utils_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/spawn/spawn.cpp b/zircon/system/utest/spawn/spawn.cpp
index c614480..88279f72 100644
--- a/zircon/system/utest/spawn/spawn.cpp
+++ b/zircon/system/utest/spawn/spawn.cpp
@@ -613,3 +613,7 @@
 RUN_TEST(spawn_errors_test)
 RUN_TEST(spawn_vmo_test)
 END_TEST_CASE(spawn_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/stdio/stdio.c b/zircon/system/utest/stdio/stdio.c
index 229872f..cb64b48 100644
--- a/zircon/system/utest/stdio/stdio.c
+++ b/zircon/system/utest/stdio/stdio.c
@@ -156,3 +156,10 @@
 RUN_TEST(stdio_pipe_test);
 RUN_TEST(stdio_launchpad_pipe_test);
 END_TEST_CASE(launchpad_tests)
+
+int main(int argc, char **argv)
+{
+    bool success = unittest_run_all_tests(argc, argv);
+
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/sysconf/sysconf.c b/zircon/system/utest/sysconf/sysconf.c
index 707c80f2..2d9598c 100644
--- a/zircon/system/utest/sysconf/sysconf.c
+++ b/zircon/system/utest/sysconf/sysconf.c
@@ -24,3 +24,7 @@
 BEGIN_TEST_CASE(sysconf_tests)
 RUN_TEST(sysconf_test)
 END_TEST_CASE(sysconf_tests)
+
+int main(int argc, char** argv) {
+  return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/sysinfo/main.cpp b/zircon/system/utest/sysinfo/main.cpp
index c76b256..4866e07 100644
--- a/zircon/system/utest/sysinfo/main.cpp
+++ b/zircon/system/utest/sysinfo/main.cpp
@@ -99,3 +99,7 @@
 RUN_TEST(get_board_name_succeeds)
 RUN_TEST(get_interrupt_controller_info_succeeds)
 END_TEST_CASE(sysinfo_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/syslog/main.c b/zircon/system/utest/syslog/main.c
new file mode 100644
index 0000000..e73ef9ef
--- /dev/null
+++ b/zircon/system/utest/syslog/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+  return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/syslog/rules.mk b/zircon/system/utest/syslog/rules.mk
index 3c8cea2..44ae849 100644
--- a/zircon/system/utest/syslog/rules.mk
+++ b/zircon/system/utest/syslog/rules.mk
@@ -9,6 +9,7 @@
 MODULE_TYPE := usertest
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/syslog_tests.c \
     $(LOCAL_DIR)/syslog_socket_tests.cpp \
 
diff --git a/zircon/system/utest/sysmem/main.c b/zircon/system/utest/sysmem/main.c
new file mode 100644
index 0000000..e5e4816
--- /dev/null
+++ b/zircon/system/utest/sysmem/main.c
@@ -0,0 +1,9 @@
+// Copyright 2018 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+  return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/sysmem/rules.mk b/zircon/system/utest/sysmem/rules.mk
index e4bcca5..6c73fa40 100644
--- a/zircon/system/utest/sysmem/rules.mk
+++ b/zircon/system/utest/sysmem/rules.mk
@@ -18,6 +18,7 @@
 #MODULE_GROUP := misc
 
 MODULE_SRCS += \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/sysmem_tests.cpp \
 
 MODULE_NAME := sysmem-test
diff --git a/zircon/system/utest/task-utils/walker.cpp b/zircon/system/utest/task-utils/walker.cpp
index 7da15a0..0e26ddd 100644
--- a/zircon/system/utest/task-utils/walker.cpp
+++ b/zircon/system/utest/task-utils/walker.cpp
@@ -199,3 +199,8 @@
 RUN_TEST((cpp_walk_failure<HAS_ON_THREAD, /*PoisonDepth=*/2>))
 
 END_TEST_CASE(task_utils)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/thread-initial-state/init-state.c b/zircon/system/utest/thread-initial-state/init-state.c
index 87396b2..745a4c5 100644
--- a/zircon/system/utest/thread-initial-state/init-state.c
+++ b/zircon/system/utest/thread-initial-state/init-state.c
@@ -58,3 +58,7 @@
 BEGIN_TEST_CASE(tis_tests)
 RUN_TEST(tis_test)
 END_TEST_CASE(tis_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/time/time_test.cpp b/zircon/system/utest/time/time_test.cpp
index b4f695d..eee4880 100644
--- a/zircon/system/utest/time/time_test.cpp
+++ b/zircon/system/utest/time/time_test.cpp
@@ -246,3 +246,8 @@
 RUN_TEST(duration_from_test)
 RUN_TEST(macro_conversion_test)
 END_TEST_CASE(time_test)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/timers/timers.cpp b/zircon/system/utest/timers/timers.cpp
index 9d2a8b5..7501dce 100644
--- a/zircon/system/utest/timers/timers.cpp
+++ b/zircon/system/utest/timers/timers.cpp
@@ -233,3 +233,8 @@
 RUN_TEST(restart_race)
 RUN_TEST(signals_asserted_immediately)
 END_TEST_CASE(timers_test)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/trace-reader/main.c b/zircon/system/utest/trace-reader/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/trace-reader/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/trace-reader/rules.mk b/zircon/system/utest/trace-reader/rules.mk
index 767fdf0..ec0aa01 100644
--- a/zircon/system/utest/trace-reader/rules.mk
+++ b/zircon/system/utest/trace-reader/rules.mk
@@ -5,6 +5,7 @@
 LOCAL_DIR := $(GET_LOCAL_DIR)
 
 reader_tests := \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/reader_tests.cpp \
     $(LOCAL_DIR)/records_tests.cpp
 
diff --git a/zircon/system/utest/trace/main.c b/zircon/system/utest/trace/main.c
new file mode 100644
index 0000000..ed1a365
--- /dev/null
+++ b/zircon/system/utest/trace/main.c
@@ -0,0 +1,9 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/trace/rules.mk b/zircon/system/utest/trace/rules.mk
index b22a57f..6054421 100644
--- a/zircon/system/utest/trace/rules.mk
+++ b/zircon/system/utest/trace/rules.mk
@@ -14,6 +14,7 @@
     $(LOCAL_DIR)/event_tests.cpp \
     $(LOCAL_DIR)/fields_tests.cpp \
     $(LOCAL_DIR)/fixture.cpp \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/no_optimization.c \
     $(LOCAL_DIR)/record_tests.cpp
 
diff --git a/zircon/system/utest/usb/usb-test.c b/zircon/system/utest/usb/usb-test.c
index c208bb1..5163771 100644
--- a/zircon/system/utest/usb/usb-test.c
+++ b/zircon/system/utest/usb/usb-test.c
@@ -241,3 +241,7 @@
 RUN_TEST(usb_isoch_loopback_test)
 RUN_TEST(usb_callbacks_opt_out_test)
 END_TEST_CASE(usb_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/utf_conversion/main.cpp b/zircon/system/utest/utf_conversion/main.cpp
index 3f1996e..9a4e79f 100644
--- a/zircon/system/utest/utf_conversion/main.cpp
+++ b/zircon/system/utest/utf_conversion/main.cpp
@@ -362,3 +362,7 @@
 RUN_TEST(utf16to8_dst_buffer_lengths);
 RUN_TEST(utf16to8_endianness_and_bom);
 END_TEST_CASE(utf_conversion_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/util/listnode.cpp b/zircon/system/utest/util/listnode.cpp
index 1fe0f2f..1a74322 100644
--- a/zircon/system/utest/util/listnode.cpp
+++ b/zircon/system/utest/util/listnode.cpp
@@ -167,3 +167,10 @@
 RUN_TEST(element_add_remove);
 RUN_TEST(list_splice_split);
 END_TEST_CASE(listnode_tests)
+
+#ifndef BUILD_COMBINED_TESTS
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
+#endif  // BUILD_COMBINED_TESTS
diff --git a/zircon/system/utest/vdso-base/vdso-base.c b/zircon/system/utest/vdso-base/vdso-base.c
index 1c0ddba..3051f652 100644
--- a/zircon/system/utest/vdso-base/vdso-base.c
+++ b/zircon/system/utest/vdso-base/vdso-base.c
@@ -137,3 +137,8 @@
 RUN_TEST(vdso_unmap_test);
 RUN_TEST(vdso_map_test);
 END_TEST_CASE(vdso_base_tests)
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/vdso-variant/helper/vdso-variant-helper.c b/zircon/system/utest/vdso-variant/helper/vdso-variant-helper.c
index 0f37df72..6bcac72 100644
--- a/zircon/system/utest/vdso-variant/helper/vdso-variant-helper.c
+++ b/zircon/system/utest/vdso-variant/helper/vdso-variant-helper.c
@@ -67,3 +67,7 @@
 RUN_TEST(vdso_open_test)
 RUN_TEST(vdso_missing_test_syscall1_test)
 END_TEST_CASE(vdso_variant_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/vdso/vdso.cpp b/zircon/system/utest/vdso/vdso.cpp
index 53f8dbe..f05431e 100644
--- a/zircon/system/utest/vdso/vdso.cpp
+++ b/zircon/system/utest/vdso/vdso.cpp
@@ -185,3 +185,7 @@
 RUN_TEST(vdso_map_code_wrong_test);
 RUN_TEST(vdso_map_change_test);
 END_TEST_CASE(vdso_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/x86-umip/main.cpp b/zircon/system/utest/x86-umip/main.cpp
index 6e03d82..9235cf6 100644
--- a/zircon/system/utest/x86-umip/main.cpp
+++ b/zircon/system/utest/x86-umip/main.cpp
@@ -150,3 +150,7 @@
 RUN_TEST(umip_test<Instruction::NOOP>)
 RUN_TEST(umip_test<Instruction::MOV_NONCANON>)
 END_TEST_CASE(x86_umip_test)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/zbi/zbi.cpp b/zircon/system/utest/zbi/zbi.cpp
index 7df2897..8bbfe83 100644
--- a/zircon/system/utest/zbi/zbi.cpp
+++ b/zircon/system/utest/zbi/zbi.cpp
@@ -528,3 +528,7 @@
 RUN_TEST(ZbiTestExtendOkay)
 RUN_TEST(ZbiTestNoOverflow)
 END_TEST_CASE(zbi_tests)
+
+int main(int argc, char** argv) {
+    return unittest_run_all_tests(argc, argv) ? 0 : -1;
+}
diff --git a/zircon/system/utest/zxio/main.c b/zircon/system/utest/zxio/main.c
new file mode 100644
index 0000000..bfd9b24
--- /dev/null
+++ b/zircon/system/utest/zxio/main.c
@@ -0,0 +1,10 @@
+// Copyright 2017 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 <unittest/unittest.h>
+
+int main(int argc, char** argv) {
+    bool success = unittest_run_all_tests(argc, argv);
+    return success ? 0 : -1;
+}
diff --git a/zircon/system/utest/zxio/rules.mk b/zircon/system/utest/zxio/rules.mk
index 08f74ca..7833e934 100644
--- a/zircon/system/utest/zxio/rules.mk
+++ b/zircon/system/utest/zxio/rules.mk
@@ -11,6 +11,7 @@
 MODULE_NAME := zxio-test
 
 MODULE_SRCS := \
+    $(LOCAL_DIR)/main.c \
     $(LOCAL_DIR)/null-test.cpp \
     $(LOCAL_DIR)/vmofile-test.cpp \
     $(LOCAL_DIR)/zxio-test.cpp \