[PATCH] [libcxx] Add support for Android targets to lit.cfg.

Dan Albert danalbert at google.com
Mon Jul 21 14:04:53 PDT 2014


================
Comment at: test/lit.cfg:94
@@ -93,1 +93,3 @@
 
+    def _build(self, exec_path, source_path, compile_only=False):
+        cmd = [self.cxx_under_test, self.cxx_under_test, '-o', exec_path,
----------------
Saleem Abdulrasool wrote:
> The compile_only is misleading.  !compile_only implies compile and link.  I think that using an enum would be much nicer here:
> 
>     (COMPILE_ONLY, LINK_ONLY, COMPILE_AND_LINK) = xrange(3)
self._build(..., compile_only=False) might be misleading, but callers wouldn't write that. They'd write self._build(...), which does exactly what it says it does.

================
Comment at: test/lit.cfg:209
@@ +208,3 @@
+            exec_file = os.path.basename(exec_path)
+            device_path = os.path.join('/data/nativetest/', exec_file)
+            cmd = ['adb', 'push', exec_path, device_path]
----------------
Saleem Abdulrasool wrote:
> Does this have to be /data/nativetest?  Personally, I would vote for /data/local/tmp/nativetest/.
I'll make it configurable.

================
Comment at: test/lit.cfg:210
@@ +209,3 @@
+            device_path = os.path.join('/data/nativetest/', exec_file)
+            cmd = ['adb', 'push', exec_path, device_path]
+            out, err, exit_code = self.execute_command(cmd)
----------------
Saleem Abdulrasool wrote:
> Might be nice to make a parameter to specify where adb is.
This set up is only intended to be used as part of a platform build, so it uses the freshly built adb. Expanding this config to work with the NDK is a task for another day.

================
Comment at: test/lit.cfg:212
@@ +211,3 @@
+            out, err, exit_code = self.execute_command(cmd)
+            cmd = build_cmd + ['&&'] + cmd
+            return cmd, out, err, exit_code
----------------
Saleem Abdulrasool wrote:
> Ick.  Can you chain this together using exit code checks please?  This feels fragile (quoting and reliance on the exec passing it through to the shell appropriately).
This `cmd` is never run. It's only returned so LIT can dump the command that was run in the even of an error. All this line is doing is printing `clang ... && adb push ...`.

http://reviews.llvm.org/D4594






More information about the cfe-commits mailing list