diff options
author | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
commit | 3dd3f861f4c3aa320aa137802f033f8f1fc7dc41 (patch) | |
tree | 357577c560920eb0f5837b7d073999f5c7a1a2cd /test/unit/applications/lang/go.py | |
parent | 9de7aea721245cda9f079a2b29d8efaf99c440fd (diff) | |
parent | 59db9a3887211fccdaec04b7952ad0140090de22 (diff) | |
download | unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.gz unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.bz2 |
Merged with the default branch.
Diffstat (limited to '')
-rw-r--r-- | test/unit/applications/lang/go.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/test/unit/applications/lang/go.py b/test/unit/applications/lang/go.py index 15ac1cd9..18345828 100644 --- a/test/unit/applications/lang/go.py +++ b/test/unit/applications/lang/go.py @@ -12,7 +12,8 @@ class TestApplicationGo(TestApplicationProto): go_app = TestApplicationGo() go_app.testdir = unit.testdir - if go_app.prepare_env('empty', 'app').returncode == 0: + proc = go_app.prepare_env('empty', 'app') + if proc and proc.returncode == 0: cls.available['modules']['go'] = [] return unit if not complete_check else unit.complete() @@ -23,18 +24,23 @@ class TestApplicationGo(TestApplicationProto): env = os.environ.copy() env['GOPATH'] = self.pardir + '/go' - process = Popen( - [ - 'go', - 'build', - '-o', - self.testdir + '/go/' + name, - self.current_dir + '/go/' + script + '/' + name + '.go', - ], - env=env, - ) - process.communicate() + try: + process = Popen( + [ + 'go', + 'build', + '-o', + self.testdir + '/go/' + name, + self.current_dir + '/go/' + script + '/' + name + '.go', + ], + env=env, + ) + + process.communicate() + + except: + return None return process |