Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CPPTDESKDEV and version 10.4.2

...

       1. Choose New> Other from the shortcut menu.A wizard will open.


      2     2. Select Import C++test 6.x test suites, then click Next. 


           3.   In the C++test 6.x project file field, enter the location of the C++test 6.x project file. This file should have a .cpf extension.


           4. In the Imported test suites location field, choose the drop-down menu item for the import strategy you want to use (import all test suites into a single directory, or import the test suites for each C++test 6.x Test Unit into a separate subdirectory), then customize the entered text to specify the location where you want the test suites stored. When specifying the location, you can use the following variables:

    • ${src_file_name} - Name of the context file (a "context file" is a source file that describes the compilation unit in which the given tested function is defined).
    • ${src_file_base_name} - Name of context file without extension.
    • ${src_file_ext} - Extension of context file.
    • ${src_file_loc_rel} - Context file project relative location.
    • ${src_file_uid} - Context file unique identifier.
    • ${unit_name} - Imported test suite C++test 6.x test unit name.


      5     5. Modify the following options if desired:

...

[NewProject]
[Native Tests (OldProject.cpf)]
  [File1.cpp]
    [Class1]
      [Function1]
        [TestCase1]
        [TestCase2]

 


Updating Tests

New test cases should be added using C++test 10.x functionality. If you need to modify a native test case, you can do so in C++test 6.x, then refresh the Test Case Explorer to synchronize.

...

  • Open the code editor to analyze covered/not covered lines
  • Create reports
  • Publish results to Team Server for team sharing
  • Publish results to Development Testing Platform DTP (see see Connecting to Development Testing PlatformDTP)

Limitations

  • Native tests can be executed based on a file, test suite, or project selection. Individual selection of native test for execution is not available.
  • C++test provides line coverage data for test execution. Other coverage metrics are not available.

...

       1.  Choose New> Other from the shortcut menu. A wizard will open.


           2. Select Import C++test 6.x user stubs, then click Next. 


           3. In the C++test 6.x project file field, enter the location of the C++test 6.x project file. This file should have a .cpf extension.


           4. In the Imported stubs location field, enter the location where you want the stubs stored. You can use the drop-down menu to configure this value to import all stubs into a single directory, import all stubs for the given C++test 10.x Text Context into separate subdirectories, or import all stubs for the given C++test 6.x Text Unit into separate subdirectories.

...

           // [...] 
     if (CppTest_IsCurrentContext("Examplesexamples/ATM/Source Files/Account.cxx")) {
     // [...]

This option is especially useful with the Merge duplicated stubs setting. Here, C++test will create a single stub definition that will behave differently for each Test Context  corresponding to the behavior of the C++test 6.x stubs. The default path of a stub will call the original definition of the stubbed function. For example:

 


Code Block
double (::Account::CppTest_Stub_getBalance) ()
{
	if (CppTest_IsCurrentContext("/ATM/ATM/Account.cxx"))
	{
	//account
	}
	else if (CppTest_IsCurrentContext("/ATM/ATM/ATM.cxx"))
	{
	//atm
	}
	else
	{
		return getBalance();
	}
}

 



           7. If you want C++test to  add the specified text at the beginning of each imported stub file, enable Insert custom code at beginning of each stub file. For example, this can be used to add a common set of #include directives for required header files to all imported stub files.


           8. If you want C++test to comment out duplicated stubs, enable Comment out duplicated stubs.


           9. Click Finish.

As stubs are being imported, progress information will be displayed in the Console view. Progress information includes details about the stub files created, duplicate stubs identified, and conversion problems encountered, as well as an import summary.

...

The following table shows the differences in command line usage between C++test 6.x and C++test 10.x. An x is used to indicate that no equivalent command is available. 


C++test 6.xC++test 10.x
-Zicpf (file), --Zinput_cpf_project (file)-data (WORKSPACE_DIR)
-Zocpf (file), --Zoutput_cpf_project (file)x
-Zdsp (file), --Zdsp_project (file) x
-Zvcproj (file), --Zvcproj_project (file) x
-Zdc (name), --Zdsp_config (name)x
-Zdc (name), --Zdsp_config (name)x
-Zmcl (param), --Zmake_command_line (param)x
-Ztf (name), --Ztest_file (name)-resource (RESOURCE)
-Zeh (name), --Zexport_harness (name)x
-Zrl (name), --Zread_logs (name)x
-Ztc (name), --Ztest_config (name)-config (CONFIG_URL)
-Zpc (name), --Zproject_config (name) x
-Zso (file), --Zsave_options (file)x
-Zitc (file), --Zimport_test_cases (file)x
-Zito (file), --Zimport_test_objects (file)x
-Zis (file), --Zimport_suppressions (file)x
-Zrf (file), --Zreport_file (file)-report (REPORT_FILE)
-Zgh (name), --Zgenerate_html (name)-report (REPORT_FILE)
-Zhrd (dir), --Zhtml_report_directory (dir)-report (REPORT_FILE)
-Zgx, --Zgenerate_xml-report (REPORT_FILE)
-Zxrd (dir), --Zxml_report_directory (dir)-report (REPORT_FILE)
-Zpr, --Zpublish_results-publish, -publishteamserver
-Zf, --Zforcex
-Zow {on\off}, --Zoverwrite {on\off}x
-Zoe [quiet], --Zonly_errors [quiet]x
-Zq, --Zquietx
-Zvm(level), --Zverbosity_mode(level)x
-Zgrs {on\off}, --Zgrs {on\off}-localsettings (LOCALSETTINGS_FILE)
-Zga (name), --Zgrs_attribute (name)-localsettings  (LOCALSETTINGS_FILE)
-Zcs, --Zcompile_sourcex
-Zrs, --Zreread_symbolsx
-Zlc (param), --Zlist_config (param)x
-Zecf, --Zexpand_command_filesx
-Znt --Zno_testsx
-h, --help-help
-V, --version-version
x-nobuild
x-showdetails
x-appconsole stdout