4040# e.g. for `$(CC) -o $(RUN_BINFILE)`.
4141RUN_BINFILE = $(TMPDIR ) /$(1 )
4242
43+ # Invoke the generated binary on the remote machine if a test address is
44+ # provided, otherwise run it on the current host.
45+ ifdef TEST_DEVICE_ADDR
46+ # FIXME: if a test requires additional files, this will need to be changed to
47+ # also push them (by changing the 0 to the number of additional files, and
48+ # providing the path of the additional files as the last arguments).
49+ EXECUTE = $(REMOTE_TEST_CLIENT ) run 0 $(RUN_BINFILE )
50+ else
51+ EXECUTE = $(RUN_BINFILE )
52+ endif
53+
4354# RUN and FAIL are basic way we will invoke the generated binary. On
4455# non-windows platforms, they set the LD_LIBRARY_PATH environment
4556# variable before running the binary.
@@ -50,16 +61,16 @@ BIN = $(1)
5061UNAME = $(shell uname)
5162
5263ifeq ($(UNAME ) ,Darwin)
53- RUN = $(TARGET_RPATH_ENV ) $(RUN_BINFILE )
54- FAIL = $(TARGET_RPATH_ENV ) $(RUN_BINFILE ) && exit 1 || exit 0
64+ RUN = $(TARGET_RPATH_ENV ) $(EXECUTE )
65+ FAIL = $(TARGET_RPATH_ENV ) $(EXECUTE ) && exit 1 || exit 0
5566DYLIB_GLOB = lib$(1 ) *.dylib
5667DYLIB = $(TMPDIR ) /lib$(1 ) .dylib
5768STATICLIB = $(TMPDIR ) /lib$(1 ) .a
5869STATICLIB_GLOB = lib$(1 ) *.a
5970else
6071ifdef IS_WINDOWS
61- RUN = PATH="$(PATH ) :$(TARGET_RPATH_DIR ) " $(RUN_BINFILE )
62- FAIL = PATH="$(PATH ) :$(TARGET_RPATH_DIR ) " $(RUN_BINFILE ) && exit 1 || exit 0
72+ RUN = PATH="$(PATH ) :$(TARGET_RPATH_DIR ) " $(EXECUTE )
73+ FAIL = PATH="$(PATH ) :$(TARGET_RPATH_DIR ) " $(EXECUTE ) && exit 1 || exit 0
6374DYLIB_GLOB = $(1 ) *.dll
6475DYLIB = $(TMPDIR ) /$(1 ) .dll
6576ifdef IS_MSVC
7384BIN = $(1 ) .exe
7485LLVM_FILECHECK := $(shell cygpath -u "$(LLVM_FILECHECK ) ")
7586else
76- RUN = $(TARGET_RPATH_ENV ) $(RUN_BINFILE )
77- FAIL = $(TARGET_RPATH_ENV ) $(RUN_BINFILE ) && exit 1 || exit 0
87+ RUN = $(TARGET_RPATH_ENV ) $(EXECUTE )
88+ FAIL = $(TARGET_RPATH_ENV ) $(EXECUTE ) && exit 1 || exit 0
7889DYLIB_GLOB = lib$(1 ) *.so
7990DYLIB = $(TMPDIR ) /lib$(1 ) .so
8091STATICLIB = $(TMPDIR ) /lib$(1 ) .a
0 commit comments