Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings MIN Test Framework
Summary Forums Tracker Lists Tasks Docs News SCM Files Wiki

MIN commandline options

FrontPage

Tutorial to MIN command line options

Introduction

This article describes how MIN can be used from command line. Each command line option is explained separately, and last it is shown how the command line options can be utilized with make check target.

-h, --help

Displays short information of available command line options. Also copyright information and email address for bug reporting are shown. When help option is specified, execute option is ignored.

  $ min -h
  MIN Test Framework, © Nokia 2008, All rights reserved,
  licensed under the Gnu General Public License version 2,
  Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
  Usage: min options
  Options:
  -h,  --help			Display this information and exits
  -v,  --version		Display version information and exits
  -c,  --console		Start MIN without consoleui
  -i,  --info test_module	Print details about test_module and exits
  -x,  --execute test_module:configuration_file:... 
				Execute test cases from test_module (with configuration file(s))
 Report bugs to:
 DG.MIN-Support@nokia.com

-v, --version

Displays MIN version information. When version option is given, execute option is ignored.

 $ min -v
 MIN Test Framework, © Nokia 2008, All rights reserved,
 licensed under the Gnu General Public License version 2,
 Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
 MIN Test Framework release min2008w50

-c, --console

Starts MIN without the ConsoleUI and reports results to stdout.

 $ min -c
 Checking for active min processes...
 Checking for active tmc processes...
 Checking for MQ left behind...
 Checking for SHM left behind...
 MIN Test Framework, © Nokia 2008, All rights reserved,
 licensed under the Gnu General Public License version 2,
 Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
 Test case gathering...1
 2008-12-22 11:59:00 Passed  minDemoModule Demo_1 PASSED
 2008-12-22 11:59:00 Passed  minDemoModule Demo_2 PASSED

If no test modules are specified with execute, MIN tries to run all test cases in all the test modules specified in MIN configuration file(s).

-i, --info

Displays information of test module given as argument.

 $ min -i math/mathTestModule.so -i .min/unitTestModule.so
 MIN Test Framework, © Nokia 2008, All rights reserved,
 licensed under the Gnu General Public License version 2,
 Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
 Module Type:   Module Version:              Build date:
 TestClass?     200844                       Nov  5 2008 10:47:46
 MINUnit        200830                       Nov 11 2008 08:13:16

The Module Version refers to the Test Module Template Wizard version.

-x, --execute

Executes the test cases of test module given as argument. It is possible to provide also test case files. The path to test module (and test case files) can be absolute or relative.

 $ min --console --execute /usr/lib/min/scripter.so:.min/rel.cfg:.min/script.cfg
 Checking for active min processes...
 Checking for active tmc processes...
 Checking for MQ left behind...
 Checking for SHM left behind...
 MIN Test Framework, © Nokia 2008, All rights reserved,
 licensed under the Gnu General Public License version 2,
 Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
 Test case gathering...1
 2008-12-18 12:42:26 Passed scripter.so scripted test Scripted test case passed
 2008-12-18 12:42:26 Passed scripter.so footest       Scripted test case passed

If execute is given without console option, the consoleUI is loaded, but only modules given with execute are visible in the menus.

Integrating MIN tests to build

The command line options in MIN makes it possible to integrate MIN tests to build chain, so that they can be used for example in continuous integration.

The makefiles generated by Test Module Template Wizard come with make check target.

 $ make check
 make  check-TESTS
 make[1]: Entering directory `/home/jars/minunit'
 Checking for active min processes...
 Checking for active tmc processes...
 Checking for MQ left behind...
 Checking for SHM left behind...
 MIN Test Framework, © Nokia 2008, All rights reserved,
 licensed under the Gnu General Public License version 2,
 Contact: Pekka Nuotio, DG.MIN-Support@nokia.com
 Test case gathering...1
 2008-12-22 12:05:31 Passed  minunitTestModule.so minunit_1 PASSED
 2008-12-22 12:05:31 FAILED  minunitTestModule.so minunit_2 AssertEquals? failed
 FAIL: /home/jars/minunit/tmp/usr/lib/minunitTestModule/minunitTestModule.so
 ===================
 1 of 1 tests failed
 ===================
 make[1]: *** check-TESTS? Error 1
 make[1]: Leaving directory `/home/jars/minunit'
 make: *** check-am? Error 2

If there are many test suites to be added to the build, creating them individually with Test Module Template Wizard may be undesired, since each module is generated to own directory, and contains files that could be shared between the modules. For MINUnit a shared file /usr/share/min/minunit.c can be used, so that the file is compiled with a pre-processor flag stating the file containing the test cases. Example shows Makefile.am for two test modules (testmodulea and testmoduleb) used in this fashion.

 check_PROGRAMS = testmodulea.so testmoduleb.so
 TESTS = $(check_PROGRAMS)
 TESTS_ENVIRONMENT = min --console --execute
 testmodulea_so_CFLAGS = -DCASES_FILE='"a_testCases.c"'
 testmodulea_so_LDFLAGS = -shared
 testmodulea_so_SOURCES = ../shared/minunit.c
 testmodulea_so_LDADD =  -lminutils -lmintmapi -lminevent
 testmoduleb_so_CFLAGS = -DCASES_FILE='"b_testCases.c"'
 testmoduleb_so_LDFLAGS = -shared
 testmoduleb_so_SOURCES = ../shared/minunit.c b_test_utils.c
 testmoduleb_so_LDADD =  -lminutils -lmintmapi -lminevent

(last edited June 25, 2009) - Read Only [info] [diff])
FindPage by browsing or searching
5 best incoming links: FrontPage (22), MIN Test Module Template Wizard (13), MIN ConsoleUI (11), RecentChanges (11)
5 best outgoing links: FrontPage (22)TestClass (6)AssertEquals (4)check-am (4)check-TESTS (4)
5 most popular nearby: FrontPage (2648), MIN ConsoleUI (471), MIN Test Module Template Wizard (470), RecentChanges (304), TestClass (146)

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment