Dollarg 2009: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
Line 49: Line 49:
Testing is helpful to find bugs, detect problems discovered by system upgrades, and to help make sure projects are working on a daily basis.
Testing is helpful to find bugs, detect problems discovered by system upgrades, and to help make sure projects are working on a daily basis.


To add a test to your project, create a "test" target in the Makefile.
Each project should contain a simple smoke test with the target name "test".
 
It should ensure basic functionality and run reasonably fast.
For example, to run a test for the wrist project you could type:
For example, to run the test for the wrist project you would type:


<pre>
<pre>
cd /map/gfx0/users/foo/project/wrist
  > cd /map/gfx0/users/foo/project/wrist
make test
  > make test
</pre>
</pre>


''Note to doc authors: what if a project wants more than one test?''
Projects can include additional tests.
By convention the make target should be named with a prefix, "test" (e.g. testmore).

Revision as of 17:28, 6 January 2009

Getting Started with $G - January 2009

Setting Environment Variables for your User Account

Edit your ~/.cshrc file and add the lines:

setenv GROOT /map/gfx0
source $GROOT/tools/gfxtools-startup-csh

setenv CVSROOT /map/gfx0/cvsroot

Checking out a project

$G uses CVS for source control and you can read more about it here.

You can work anywhere except under the $G directory. At Brown ample disk space has been allocated here for students:

   /map/gfx0/users/$USER

So, for example, if your user id is "goo" and you wanted to check out the "wrist" project, you should type:

   > mkdir  /map/gfx0/users/goo
   > cd     /map/gfx0/users/goo
   > cvs  co  project/wrist        # Creates:  /map/gfx0/users/goo/project/wrist/...

Please do not waste space and retain only the files you need. When you are done with your account please be sure to delete it.

Building a project

Type "make all" to build a project. Continuing the wrist project example from above, you would type:

   > cd  /map/gfx0/users/foo/project/wrist
   > make  all

By convention simple projects that build a single program or library can be built just by typing "make".

Creating a "test" for a project

Testing is helpful to find bugs, detect problems discovered by system upgrades, and to help make sure projects are working on a daily basis.

Each project should contain a simple smoke test with the target name "test". It should ensure basic functionality and run reasonably fast. For example, to run the test for the wrist project you would type:

   > cd  /map/gfx0/users/foo/project/wrist
   > make  test

Projects can include additional tests. By convention the make target should be named with a prefix, "test" (e.g. testmore).