| 1 |
import Builder |
| 2 |
import sys |
| 3 |
import os |
| 4 |
import re |
| 5 |
|
| 6 |
|
| 7 |
class AWSCHttpTest(Builder.Action): |
| 8 |
|
| 9 |
def _export_env_var(self, filename, env): |
| 10 |
with open(filename) as file: |
| 11 |
pattern = re.compile("(\w+) (\w+)=(.+)") |
| 12 |
for i in file.readlines(): |
| 13 |
match = pattern.match(i) |
| 14 |
if match != None: |
| 15 |
env.shell.setenv(match.groups()[1], match.groups()[2]) |
| 16 |
print(match.groups()[1]) |
| 17 |
|
| 18 |
def run(self, env): |
| 19 |
actions = [] |
| 20 |
if os.path.exists('/tmp/setup_proxy_test_env.sh'): |
| 21 |
|
| 22 |
|
| 23 |
print("setting proxy integration test environment") |
| 24 |
self._export_env_var('/tmp/setup_proxy_test_env.sh', env) |
| 25 |
env.shell.setenv('AWS_PROXY_NO_VERIFY_PEER', 'on') |
| 26 |
if os.path.exists('./build/aws-c-http/'): |
| 27 |
|
| 28 |
|
| 29 |
os.chdir('./build/aws-c-http/') |
| 30 |
elif os.path.exists('../../aws-c-http'): |
| 31 |
|
| 32 |
|
| 33 |
os.chdir('../../aws-c-http') |
| 34 |
|
| 35 |
actions.append(['ctest', '--output-on-failure']) |
| 36 |
|
| 37 |
actions.append(['ctest', '-T', 'coverage']) |
| 38 |
|
| 39 |
return Builder.Script(actions, name='aws-c-http-test') |