Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The analysis release build system, SConsTools, provides a mechanism for integrating unit tests. Each package in the release, or a package that a user is developing, can have its own tests. All tests can be run by a simple command. Users may find this useful for testing their packages. For packages that psana developers add to the analysis release, these tests are automatically run during the nightly build. This page is primarily for psana developers, to go over how to add unit tests to test packages in that are a part of the release during nightly builds. There are special considerations to make for tests that are part of run during the nightly build discussed below.

Creating a Package test directory

As an example, lets make a package with both a Python and a C++ unit test. For the example below, I am starting from the directory rel in my home directory. I make a new release, a new package in the release, and the crucial step is that I make a subdirectory called test in my package:

...

a directory where I want to create a psana release directory. You can cut and past these lines into your terminal (assuming you are on a psana interactive node, and set up your environment for analysis):

Code Block
newrel ana-current unitTestTutorial

...


cd unitTestTutorial

...


sit_setup

...


newpkg MyPkg

...


mkdir MyPkg/test

Now when one does

scons test

...