Giter Club home page Giter Club logo

imx-linux-test's Introduction

	Misc Stuff for Linux
	====================

This "misc" folder contains the source code and necessary build files for Linux
utility programs such as tests, demos, etc. All the non-Linux BSP source should
go into this directory.


1. Directory structure
======================

Currently the "misc" directory is organized as follows to cover three types of
programs: bootloader, test and demo.

misc
  |- include
  |- platform
  |- bootloader
  |- lib
  |- module_test
  |_ test
       |_ demo


misc -> include
---------------
	This directory's path is included in the build system so that generic
	header files can be put under this directory and be included by the source
	code.

misc -> platform
----------------
	This directory contains the build output files. Once "make" finishes, a
	platform specific directory will be created.

misc -> test
------------
	The unit test code goes in directories below misc/test.


2. Build Steps
==============

To build all the tests and bootloaders, run make as shown:

make PLATFORM=MXC27530EVB LINUXPATH=/home/marsha/LINUX2.6/linux \
KBUILD_OUTPUT=/home/marsha/LINUX2.6/kbuild/mxc27530evb \
CROSS_COMPILE=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/bin/arm_v6_vfp_le-

Note that you have to specify 4 things: PLATFORM, LINUXPATH, KBUILD_OUTPUT, and CROSS_COMPILE.

The build results will end up in the platform directory.

To build a single test add the test dir name to the above like:

make PLATFORM=MXC27530EVB LINUXPATH=/home/marsha/LINUX2.6/linux \
KBUILD_OUTPUT=/home/marsha/LINUX2.6/kbuild/mxc27530evb \
CROSS_COMPILE=/opt/montavista/mobilinux/devkit/arm/v6_vfp_le/bin/arm_v6_vfp_le- \
mxc_mu_test


3. Adding new programs
======================

To add new programs such as test and demo, the easiest way is to use other existing
code as an example.  Be careful not to use absolute paths when including files from
the linux tree.


4. Adding autorun scripts
=========================

The autorun scripts are used to run the unit tests each night by the nightly build,
without human interaction.  After the tests are run, a script parses the output
into some emails to let the team know how well testing went that night and which
tests are having difficulty.  These scripts can also make it easier for people who
are not familiar with the unit tests to run them.  Currently the simplest autorun
script is misc/test/wdog/autorun-wdog.sh, which is quoted below.

      #!/bin/bash

      source /unit_tests/test-utils.sh

      #
      # Exit status is 0 for PASS, nonzero for FAIL
      #
      STATUS=0

      check_devnode "/dev/misc/watchdog"

      print_status
      exit $STATUS

All scripts should have this form and contain basically everything that this test
have except for the "check_devnode" line.  Any tests deviating from this may break
the autorun or have output that can't properly be parsed by the nightly build scripts.

Tests must initialize STATUS=0 early on and can never set it to 0 again later in
the script as that might clear a failure code.

There are three files that you should be aware of, autorun.sh which runs the
autorun scripts, autorun-suite.txt which lists the which autoruns to run (and
assigns a test id to each), and test-utils.sh which has functions each autorun
script uses.  All these are checked in to LINUX2.6/misc/.

Any tests that require a specialized kernel build of course can not be run during
the nightly run so they are not listed in autorun-suite.txt.  Still, these can
be useful for humans running tests as they can run the test by hand without
having to be familiar with the unit test.

Also check the misc/test/wdog/Makefile for how the test gets copied.  The script
just has to be added to the the OBJ list since there is a rule for .sh files in
misc/tests/make.rules.

If there are platforms that a test should not be built for or run on, add that
platform to the Makefile's exclude list.

If a autorun needs to run tests differently conditioned on what platform we are
on, there is a function in test-utils.sh for determining platform.

imx-linux-test's People

Contributors

annthornton avatar b38800 avatar gibsson avatar liuhui-jason avatar nxpfrankli avatar xie-xiaobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.