[cmake] Run rest of the tests on Windows (#668)

diff --git a/test/shaping/CMakeLists.txt b/test/shaping/CMakeLists.txt
index 5310a2c..e186858 100644
--- a/test/shaping/CMakeLists.txt
+++ b/test/shaping/CMakeLists.txt
@@ -1,11 +1,10 @@
 if (HB_BUILD_UTILS)
   file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
   extract_make_variable (TESTS ${MAKEFILEAM})
+
   foreach (test IN ITEMS ${TESTS})
-    add_test (${test} python run-tests.py "${test}")
-    set_tests_properties (${test} PROPERTIES
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-      ENVIRONMENT "top_builddir=${PROJECT_BINARY_DIR};utildir=."
-    )
+    add_test (NAME ${test}
+      COMMAND python run-tests.py $<TARGET_FILE:hb-shape> "${test}"
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endforeach ()
 endif ()
diff --git a/test/shaping/run-tests.py b/test/shaping/run-tests.py
index 09c2f68..342c006 100755
--- a/test/shaping/run-tests.py
+++ b/test/shaping/run-tests.py
@@ -28,14 +28,22 @@
 extra_options = "--verify"
 hb_shape = os.path.join (top_builddir, utildir, "hb-shape" + EXEEXT)
 
-fails = 0
 args = sys.argv[1:]
 
+if not os.path.exists (hb_shape):
+	hb_shape = args[0]
+	args = args[1:]
+
+fails = 0
+
 reference = False
 if len (args) and args[0] == "--reference":
 	reference = True
 	args = args[1:]
 
+if not reference:
+	print ('hb_shape:', hb_shape)
+
 if not len (args):
 	args = [sys.stdin]