mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Add MODE=optlinux build mode (#141)
This commit is contained in:
parent
226aaf3547
commit
67b5200a0b
111 changed files with 934 additions and 854 deletions
22
third_party/python/Lib/test/test_cosmo.py
vendored
Normal file
22
third_party/python/Lib/test/test_cosmo.py
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
import subprocess
|
||||
|
||||
|
||||
class SubprocessTest(unittest.TestCase):
|
||||
def test_execve(self):
|
||||
tmp_dir = tempfile.mkdtemp()
|
||||
self.addCleanup(shutil.rmtree, tmp_dir)
|
||||
exe = os.path.join(tmp_dir, 'hello.com')
|
||||
shutil.copyfile('/zip/.python/test/hello.com', exe)
|
||||
os.chmod(exe, 0755)
|
||||
proc = subprocess.Popen([exe], stdout=subprocess.PIPE)
|
||||
stdout, stderr = proc.communicate()
|
||||
self.assertEqual(b'hello world\n', stdout)
|
||||
self.assertEqual(0, proc.wait())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue