Guide and exercise for uploading the correct artifacts for Source Control

Billy McMullinBilly McMullin Posts: 60 admin
edited May 14 in C/C++test

What Files should be Checked into Source Control?

When using Source control with C/C++test, make sure to have the following files checked-in:

  1. .parasoft
  2. .cproject
  3. .project
  4. All source files that are needed for the project
  5. Test Folders or other folder(s) you use for your Test Suites
  6. Stubs Folders or other folder(s) you use for your Stubs

Note:

  • Do not check in temporary data/files (such as instrumented sources, compiled objects, linked test executable, and automatically-generated header files) with the project. By default, temporary files are in the .cpptest directory of the current workspace. These files should not be stored in source control because C++test can automatically regenerate these as needed.

Project’s configuration after checkout.

After the project is checked out, make sure the project settings are configured correctly. If the project was not correctly configured then the analysis may not work properly as it may not be able to find any of the source files. You can configure the project’s settings by Right-clicking on the root project’s folder and selecting “Properties”. From the Properties window go to “Parasoft->C++test->Build Settings”. Here you can configure how C/C++test will find the project’s information to run analysis on. You can set the project’s settings by clicking on the “Options Source” dropdown at the top and selecting an valid option for your project to run with.

Note:

  • The Linux installation doesn’t have as many options available as not all the options are supported in the Linux Environment.

Exercise

For this exercise, we will be using an example project that come with C/C++test and we will be using Subversion four our Source Control. We will also be using the IDE to prepare the project as we would have to manually write our settings for some of them. We will be going through:

  • Configuring the build settings to properly run your tests
  • Configuring the Test Configuration to be shareable
  • (optional) Configuring the machine for Custom Compiler definitions.
  • Committing the correct files for Source Control
  • Checking out the project and running a test
  1. We will begin by configuring the project’s Build Settings. You can get there from your IDE by right-clicking your project and selecting “Properties”. This will open the Properties Window for the project. The Build Settings are located at “Parasoft->C++test->Build Settings”.
  2. Since the BDF has absolute paths based on the machine it was created on, we need to change the Build Settings to use “Use options from a build system” from the drop down. This will configure the project to use whatever build system is used to compile and link the project. This is how C/C++test can find and scan source files for Static Analysis.
  3. Now that the project’s Build Settings have been configured, we will commit the project and the required artifacts. We will commit the following files:
    a. .parasoft
    b. .cproject
    c. .project
    d. All source files from the project
    e. Any Unit Test folders or other folders for the project
    f. Any Stub Folders or other folders required for the project.
    g. (optional) Custom Compiler Definition file.
    Note:
  • Do not commit the BDF for the project or executable made from the project’s build.
  1. Now that the Project has been committed with Source Control, we are ready to check out the project on another machine to run our tests.

  2. Go to a new machine and check out this project from Source Control. After the project is checked out, go ahead and run a test on it.
    Note:

  • If the project is showing “0/0” files scanned, check the console output. The console output will display what it was trying to do when the test began. You might have to make sure the build utility is available on the PATH. For example make sure that GNU Make is available on the System PATH.
Sign In or Register to comment.