From 5a78423193c48cae4800eb1ec44b62d14ae03920 Mon Sep 17 00:00:00 2001 From: Takuto Ikuta Date: Sun, 18 Nov 2018 02:23:28 +0900 Subject: Add OSX build on travis (#1502) Also make test script works for OSX script command. --- .travis.yml | 10 +++++++--- misc/output_test.py | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 70b1fd0..19a9b28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ +matrix: + include: + - os: linux + compiler: gcc + - os: linux + compiler: clang + - os: osx sudo: false language: cpp -compiler: - - gcc - - clang script: - ./configure.py --bootstrap - ./ninja all diff --git a/misc/output_test.py b/misc/output_test.py index 878de19..1dcde10 100755 --- a/misc/output_test.py +++ b/misc/output_test.py @@ -6,6 +6,7 @@ In order to simulate a smart terminal it uses the 'script' command. """ import os +import platform import subprocess import sys import tempfile @@ -26,6 +27,9 @@ def run(build_ninja, flags='', pipe=False, env=default_env): try: if pipe: output = subprocess.check_output([ninja_cmd], shell=True, env=env) + elif platform.system() == 'Darwin': + output = subprocess.check_output(['script', '-q', '/dev/null', 'bash', '-c', ninja_cmd], + env=env) else: output = subprocess.check_output(['script', '-qfec', ninja_cmd, '/dev/null'], env=env) @@ -43,7 +47,7 @@ class Output(unittest.TestCase): def test_issue_1418(self): self.assertEqual(run( '''rule echo - command = sleep 0.$delay && echo $out + command = sleep $delay && echo $out description = echo $out build a: echo -- cgit v0.12