function_test_build 

Fuego wiki

Login or create account

function test build

NAME [edit section]

test_build

SYNOPSIS [edit section]

Performs the actual steps needed to build the test software.

DESCRIPTION [edit section]

This function is defined in the base test script for a test, and executes those commands required to build the software.

When this function starts, the source code for the test program has been unpacked, and the current directory is the root directory where the source is located (in /fuego-rw/buildzone/<test_name-platform_name/>

Commonly called functions or programs [edit section]

This function can contain calls to just about any command, but there are some common commands used for building Linux source
  • patch - used to apply patches to the source
  • configure - used with autoconf-based source
  • make - used to build programs from source

EXAMPLES [edit section]

Some sample contents are:
    function test_build {
        make && touch test_suite_ready || build_error "error building software"
    }

    function test_build {
        configure
        make && touch test_suite_ready || build_error "error building software"
    }

    function test_build {
        patch -N -s -p1 < $TEST_HOME/nbench_Makefile.patch
        rm -f pointer.h && touch pointer.h
        CLFAGS+= " -s -static -Wall -O3"
        make CFLAGS="${CFLAGS}" CC="$CC" AR="$AR" RANLIB="$RANLIB" CXX="$CXX" CPP="$CPP" CXXCPP="$CXXCPP" && touch test_suite_ready || build_error "error while building test"
    }

ENVIRONMENT and ARGUMENTS [edit section]

A number of environment variables are set (see Core interfaces and Variables)

However, some variables that are commonly used in this function are:

  • $TEST_HOME - the directory where source materials for the test are located
    • This is often used to reference patch files
  • The toolchain variables:
    • $CC, $AR, $LD, $RANLIB, $CXX, $CPP, $CXXPP (see tools.sh)

There are no arguments to this function.

RETURN [edit section]

returns non-zero for error

On success, the function should create the file 'test_suite_ready' in the root of the build directory. This is normally done with the 'touch' command, as shown in the examples.

SOURCE [edit section]

Located in the base script for each test. The base test scripts are located in /fuego-core/engine/tests/<test_name>.

An example path would be: /fuego-core/engine/tests/Functional.hello_world/fuego_test.sh

SEE ALSO [edit section]

TBWiki engine 1.8.2 by Tim Bird