Testing the Example Packages

We will now test the previous examples. Testing packages involves building them, putting them in a binary bundle, installing the bundle in an empty location, and then run a quick test on the executables. With this example the testing is easier because the guten_tag_welt package uses the contents of the other packages. You can try this out by downloading a tarfile that contains all of the source for the example packages.

The first thing to do is to build all of the packages. This can be done by one gpt-build command. See this section for information on how to use gpt-build:

bash$ gpt-build -srcdir=hello_world2/ -srcdir=hello_world_c1/ -srcdir=guten_tag_welt/
gpt-build ====> CHECKING BUILD DEPENDENCIES FOR hello_world
gpt-build ====> Changing to /home/mbletzin/nmi/gpt-docs/examples/hello_world2/
gpt-build ====> BUILDING FLAVOR 
gpt-build ====> Changing to /home/mbletzin/install/globus/etc
gpt-build ====> REMOVING empty package hello_world-noflavor-dev
gpt-build ====> REMOVING empty package hello_world-noflavor-rtl
gpt-build ====> CHECKING BUILD DEPENDENCIES FOR hello_world_c
gpt-build ====> Changing to /home/mbletzin/nmi/gpt-docs/examples/hello_world_c1/gpt-build ====> BUILDING FLAVOR 
gpt-build ====> Changing to /home/mbletzin/install/globus/etc
gpt-build ====> REMOVING empty package hello_world_c-noflavor-dev
gpt-build ====> REMOVING empty package hello_world_c-noflavor-rtl
gpt-build ====> CHECKING BUILD DEPENDENCIES FOR guten_tag_welt
gpt-build ====> Changing to /home/mbletzin/nmi/gpt-docs/examples/guten_tag_welt/gpt-build ====> BUILDING FLAVOR 
gpt-build ====> Changing to /home/mbletzin/install/globus/etc
gpt-build ====> REMOVING empty package guten_tag_welt-noflavor-dev
gpt-build ====> REMOVING empty package guten_tag_welt-noflavor-rtl

Next we create a bundle out of all of the packages. For this we can specify the top level guten_tag_welt package. gpt-bundle will pull in all of the dependent packages. The command is as follows (This section has more information on gpt-bundle.)

bash$ gpt-bundle -bn=gpt-examples -bv=0.1 guten_tag_welt
Bundle written as /home/mbletzin/nmi/gpt-docs/examples/gpt-examples-0.1-i686-pc-linux-gnu-bin.tar.gz
bash$ tar tzvf gpt-examples-0.1-i686-pc-linux-gnu-bin.tar.gz 
-rw-r--r-- mbletzin/mbletzin 1092 2003-05-17 20:25:56 gpt-examples_bundle-0.1.gpt-bundle.xml
-rw-r--r-- mbletzin/mbletzin 5892 2003-05-17 20:25:56 guten_tag_welt-0.0-i686-pc-linux-gnu-noflavor-pgm.tar.gz
-rw-r--r-- mbletzin/mbletzin  771 2003-05-17 20:25:56 hello_world-0.1-i686-pc-linux-gnu-noflavor-pgm.tar.gz
-rw-r--r-- mbletzin/mbletzin 7153 2003-05-17 20:25:56 hello_world_c-0.0-i686-pc-linux-gnu-noflavor-pgm.tar.gz
-rw-r--r-- mbletzin/mbletzin  167 2003-05-17 20:25:56 packagelist

This bundle is now installed in an empty location and tested to make sure that the packages are complete:

bash$ gpt-install gpt-examples-0.1-i686-pc-linux-gnu-bin.tar.gz 
Bundle gpt-examples successfully installed.
Cleaning up temp locations
bash$ $GPT_INSTALL_LOCATION/bin/guten-tag-welt 
Guten Tag Welt
Hello World
I am a hello world configuration file.
Hello from the hello world library

The bundle looks ready to ship :)