:py:mod:`buildtest.builders.script` =================================== .. py:module:: buildtest.builders.script Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: buildtest.builders.script.ScriptBuilder .. py:class:: ScriptBuilder(name, recipe, buildspec, executor, buildexecutor, configuration, testdir=None, numprocs=None, numnodes=None, compiler=None, strict=None, display=None) Bases: :py:obj:`buildtest.builders.base.BuilderBase` This is a subclass of BuilderBase used for building test that uses ``type: script`` in the buildspec. The BuilderBase provides common functions for any builder. The builder is an instance of BuilderBase. The initializer method will setup the builder attributes based on input test by ``name`` parameter. :param name: Name of test in buildspec recipe :type name: str :param recipe: The loaded test section from the buildspec file :type recipe: str :param buildspec: Full path to buildspec file :type buildspec: str :param buildexecutor: An instance of BuildExecutor class used for accessing executors :type buildexecutor: :obj:`buildtest.executors.setup.BuildExecutor` :param testdir: Test directory where tests are written. Must be full path on filesystem. :type testdir: str :param display: Display content of output/error or test. :type display: list, optional .. py:attribute:: type :value: 'script' .. py:method:: resolve_compilers() .. py:method:: write_python_script() This method is used for writing python script when ``shell: python`` is set. The content from ``run`` section is added into a python script. The file is written to run directory and we simply invoke python script by running ``python script.py`` .. py:method:: _get_compiler_variables() .. py:method:: generate_script() This method builds the content of the test script which will return a list of shell commands that will be written to file. .. py:method:: _get_container_command() This method is responsible for generating container command for docker, podman, or singularity. This method will return a list of commands to launch container. This method is called when 'container' property is defined in buildspec.