Beispiel #1
0
def setup():
    env = mbuild.env_t()
    env.parse_args()
    mbuild.cmkdir(env['build_dir'])
    if not env.on_windows():
        env['LINK'] = env['CC']  # not g++ for this program
    return env
Beispiel #2
0
def work():
    env = mbuild.env_t()
    env.parser.add_option(
        "--bulk-make-tests",
        "-b",
        dest="bulk_tests",
        action="append",
        default=[],
        help=
        "List of bulk tests from which to create test references. Repeatable")
    env.parser.add_option(
        "--rebase-tests",
        dest="rebase_tests",
        action="store_true",
        default=False,
        help="Update the reference output files. Do not compare.")
    env.parser.add_option("--tests",
                          dest="tests",
                          action="append",
                          default=[],
                          help="Directory where tests live.")
    env.parser.add_option("--otests",
                          dest="otests",
                          action="store",
                          default='tests-base',
                          help="Directory where tests live.")
    env.parser.add_option("-c",
                          "--code",
                          dest="codes",
                          action="append",
                          default=[],
                          help="Codes for test subsetting (DEC, ENC, AVX, " +
                          "AVX512X, AVX512PF, XOP, KNC)." +
                          " Only used for running tests, not creating them.")
    env.parse_args()

    if not env['tests']:
        env['tests'] = ['tests-base']

    xed = mbuild.join(env['build_dir'], 'xed')
    #xedexe = xed + ".exe"
    #if not os.path.exists(xed) and not os.path.exists(xedexe):
    #    mbuild.die("Need the xed command line tool: %s or %s\n\n" % (xed,xedexe))

    if len(env['bulk_tests']) != 0:
        mbuild.msgb("MAKE BULK TESTS")
        make_bulk_tests(env)
        sys.exit(0)

    if env['rebase_tests']:
        rebase_tests(env)
        sys.exit(0)

    errors = run_tests(env)
    sys.exit(errors)
def mkenv():
    """External entry point: create the environment"""
    if sys.version_info[0] == 3 and sys.version_info[1] < 4:        
        _fatal("Need python version 3.4 or later.")
    elif sys.version_info[0] == 2 and sys.version_info[1] < 7:        
        _fatal("Need python version 2.7 or later.")
    # create an environment, parse args
    env = mbuild.env_t()
    standard_defaults = dict(    doxygen_install='',
                                 doxygen='',
                                 clean=False,
                                 die_on_errors=True,
                                 xed_messages=False,
                                 xed_asserts=False,
                                 pedantic=True,
                                 clr=False,
                                 use_werror=True,
                                 dbghelp=False,
                                 install_dir='',
                                 kit_kind='base',
                                 win=False,
                                 dev=False,
                                 legal_header=None,
                                 encoder=True,
                                 enc2=True,
                                 decoder=True,
                                 ld_library_path=[],
                                 ld_library_path_for_tests=[],
                                 use_elf_dwarf=False,
                                 use_elf_dwarf_precompiled=False,
                                 strip='strip',
                                 verbose = 1,
                                 example_linkflags='',
                                 example_flags='',
                                 example_rpaths=[],
                                 android=False,
                                 xed_inc_dir=[],
                                 xed_lib_dir='',
                                 xed_enc2_libs=[],
                                 xed_dir='',
                                 build_cpp_examples=False,
                                 set_copyright=False,
                                 pin_crt='')

    env['xed_defaults'] = standard_defaults
    env.set_defaults(env['xed_defaults'])
    return env
Beispiel #4
0
def mkenv():
    """External entry point: create the environment"""
    if not mbuild.check_python_version(2, 7):
        xbc.cdie("Need python 2.7.x...")
    # create an environment, parse args
    env = mbuild.env_t()
    standard_defaults = dict(doxygen_install='',
                             doxygen='',
                             clean=False,
                             die_on_errors=True,
                             xed_messages=False,
                             xed_asserts=False,
                             pedantic=True,
                             clr=False,
                             use_werror=True,
                             dbghelp=False,
                             install_dir='',
                             kit_kind='base',
                             win=False,
                             dev=False,
                             legal_header=None,
                             encoder=True,
                             decoder=True,
                             ld_library_path=[],
                             ld_library_path_for_tests=[],
                             use_elf_dwarf=False,
                             use_elf_dwarf_precompiled=False,
                             strip='strip',
                             verbose=1,
                             example_linkflags='',
                             example_rpaths=[],
                             android=False,
                             xed_inc_dir='',
                             xed_lib_dir='',
                             xed_dir='',
                             build_cpp_examples=False,
                             pin_crt='')

    env['xed_defaults'] = standard_defaults
    env.set_defaults(env['xed_defaults'])
    return env
Beispiel #5
0
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#
#END_LEGAL

import os, sys

sys.path = ['..'] + sys.path
import mbuild

env = mbuild.env_t()
env.parse_args()

env['jobs'] = 1
work_queue = mbuild.work_queue_t(env['jobs'])
all_cmds = ['python -c "1+1"']
subs = {}
command_list = []
for cmd in all_cmds:
    cmd = cmd % (subs)
    mbuild.msgb('ADDING', cmd)
    c = mbuild.command_t(cmd, output_file_name="foo")
    work_queue.add(c)
    command_list.append(cmd)

phase = "BUILD"
Beispiel #6
0
def main():
    mbuild.msgb("in main")
    env = mbuild.env_t()
    env.parse_args()
    bar()
Beispiel #7
0
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#
#END_LEGAL
import sys
# find.py is in the tests dir. It finds mbuild and puts it on the
# sys.path.
import find
import mbuild

env = mbuild.env_t(init_verbose=0)
env.parse_args()
#mbuild.build_env.set_env_icl(env)
mbuild.cmkdir(env['build_dir'])
dag = mbuild.dag_t()
res = env.compile(dag, ['VersionInfo.rc'])
objs = env.compile(dag, ['hello.c'])
cmd = dag.add(env, env.dynamic_lib(objs + res,
                                   env.build_dir_join('hello.dll')))

work_queue = mbuild.work_queue_t(env['jobs'])
okay = work_queue.build(dag=dag)
if not okay:
    mbuild.die("build failed")
mbuild.msgb("SUCCESS")