[PATCH] D44771: [lit] Test /dev/null support on Windows.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 12:42:54 PDT 2018


rnk added a comment.

In https://reviews.llvm.org/D44771#1045875, @zturner wrote:

> This might be a dumb question, but in Windows you can use `NUL` instead of `/dev/null`.  Instead of all this hackery around temp files, why don't we just replace `/dev/null` with `NUL`?


We should do that, but I consider it future work. It will require more testing. I have a feeling if you just say `open("NUL", mode)` you will create a file called "NUL" in the cwd. It's not something you can feed to generic filesystem APIs.



================
Comment at: utils/lit/tests/unit/TestRunner.py:105
+        if platform.system() != 'Windows':
+          self.assertEqual(value[2].strip(), 'command -o /dev/null')
+          self.assertEqual(value[3].strip(), 'command -output=/dev/null')
----------------
This should match the 4 space indent.


Repository:
  rL LLVM

https://reviews.llvm.org/D44771





More information about the llvm-commits mailing list