Refactor test/api/meson.build and always run test-unicode test
diff --git a/test/api/meson.build b/test/api/meson.build
index 2bfea39..e40c015 100644
--- a/test/api/meson.build
+++ b/test/api/meson.build
@@ -24,11 +24,6 @@
     'test-ot-metrics-tt-var.c',
     'test-set.c',
     'test-shape.c',
-    'test-var-coords.c',
-    'test-version.c',
-  ]
-
-  subset_tests = [
     'test-subset.c',
     'test-subset-cmap.c',
     'test-subset-drop-tables.c',
@@ -48,13 +43,11 @@
     'test-subset-gpos.c',
     'test-subset-colr.c',
     'test-subset-cbdt.c',
+    'test-unicode.c',
+    'test-var-coords.c',
+    'test-version.c',
   ]
 
-  icu_tests = []
-  if conf.get('HAVE_ICU', 0) == 1
-    icu_tests += 'test-unicode.c'
-  endif
-
   if conf.get('HAVE_FREETYPE', 0) == 1
     tests += 'test-ot-math.c'
   endif
@@ -73,30 +66,18 @@
 
   foreach source : tests
     test_name = source.split('.')[0]
-    test(test_name, executable(test_name, source,
-      include_directories: [incconfig, incsrc],
-      dependencies: deps,
-      link_with: libharfbuzz,
-      install: false,
-    ), env: env)
-  endforeach
 
-  foreach source : subset_tests
-    test_name = source.split('.')[0]
-    test(test_name, executable(test_name, source,
-      include_directories: [incconfig, incsrc],
-      dependencies: deps,
-      link_with: [libharfbuzz, libharfbuzz_subset],
-      install: false,
-    ), env: env)
-  endforeach
+    link_withs = libharfbuzz
+    if test_name.contains('-subset')
+      link_withs = [libharfbuzz, libharfbuzz_subset]
+    elif test_name == 'test-unicode' and have_icu and not have_icu_builtin
+      link_withs = [libharfbuzz, libharfbuzz_icu]
+    endif
 
-  foreach source : icu_tests
-    test_name = source.split('.')[0]
     test(test_name, executable(test_name, source,
       include_directories: [incconfig, incsrc],
       dependencies: deps,
-      link_with: have_icu_builtin ? [libharfbuzz] : [libharfbuzz, libharfbuzz_icu],
+      link_with: link_withs,
       install: false,
     ), env: env)
   endforeach