You've already forked templates-parser
mirror of
https://github.com/AdaCore/templates-parser.git
synced 2026-02-12 12:29:55 -08:00
* Fix run command with interpreter, fix test paths Two problems fixed: - Bug introduced in previous merge request that would crash Run by giving it a bad kwarg. Reverted to self.shell, but used the e3.sys.interpreter to be more flexible. - Replaced the tests naming by setting a tests_subdir instead of a test_name method, which would crash Windows tests. TN: V223-017
28 lines
594 B
Python
Executable File
28 lines
594 B
Python
Executable File
"""
|
|
This module contains support functions for all test.py
|
|
"""
|
|
|
|
from e3.os.process import Run
|
|
import os
|
|
import sys
|
|
|
|
|
|
def gprbuild(prj):
|
|
"""Compile a project with gprbuild"""
|
|
cmd = ["gprbuild", "-p", "-P" + prj, "-bargs", "-E"]
|
|
process = Run(cmd)
|
|
if process.status:
|
|
print(process.out)
|
|
|
|
|
|
def run(bin, options=None, output_file=None):
|
|
"""Run a test"""
|
|
if options is None:
|
|
options = []
|
|
if "TIMEOUT" in os.environ:
|
|
timeout = int(os.environ["TIMEOUT"])
|
|
else:
|
|
timeout = 300
|
|
|
|
Run([bin] + options, output=output_file, timeout=timeout)
|