Lesson 2: Adding a New Package

To create a new package (a collection of C++ classes), change dir into your working area (t67 if you come from the previous lesson), and then type

<d0mino> ctnewpkg -l example

to add a new CTEST/SRT package called example (name is of course up to you). Try ctnewpkg -h or this for available options.

<d0mino> cd include
<d0mino> ln -s ../example/example example
<d0mino> cd ..

example/example will contain your include files. The directory tree starting from include will be searched for them during compilation.

<d0mino> cd example

Now we can start writing code for the example package.

<d0mino> xemacs example/test1.hpp src/test1.cpp src/test1_t.cpp

Open your favourite editor with the include file test1.hpp, the source file test1.cpp and the component test file test1_t.cpp. For a trivial example, take a look at:

<d0mino> xemacs LIBDEPS

Insert the names of the libraries your package directly depends on. Higher level library dependencies will be handled by the system. For test1 nothing needs to be added here, see Lesson 4 for an example that makes use of this.

<d0mino> xemacs src/COMPONENTS

Insert the name of the component (in this case test1). When compiling your package, CTEST will check this file to see which tests should be executed (in this case test1_t.cpp will be run to test test1.cpp).

<d0mino> cd ..

Now we are ready to compile (check out the next lesson on how to do that).