40
40
# e.g. for `$(CC) -o $(RUN_BINFILE)`.
41
41
RUN_BINFILE = $(TMPDIR ) /$(1 )
42
42
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
+
43
54
# RUN and FAIL are basic way we will invoke the generated binary. On
44
55
# non-windows platforms, they set the LD_LIBRARY_PATH environment
45
56
# variable before running the binary.
@@ -50,16 +61,16 @@ BIN = $(1)
50
61
UNAME = $(shell uname)
51
62
52
63
ifeq ($(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
55
66
DYLIB_GLOB = lib$(1 ) *.dylib
56
67
DYLIB = $(TMPDIR ) /lib$(1 ) .dylib
57
68
STATICLIB = $(TMPDIR ) /lib$(1 ) .a
58
69
STATICLIB_GLOB = lib$(1 ) *.a
59
70
else
60
71
ifdef 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
63
74
DYLIB_GLOB = $(1 ) *.dll
64
75
DYLIB = $(TMPDIR ) /$(1 ) .dll
65
76
ifdef IS_MSVC
73
84
BIN = $(1 ) .exe
74
85
LLVM_FILECHECK := $(shell cygpath -u "$(LLVM_FILECHECK ) ")
75
86
else
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
78
89
DYLIB_GLOB = lib$(1 ) *.so
79
90
DYLIB = $(TMPDIR ) /lib$(1 ) .so
80
91
STATICLIB = $(TMPDIR ) /lib$(1 ) .a
0 commit comments