Testing Cappuccino

olifante edited this page Aug 30, 2011 · 5 revisions

Goal: To test cappuccino git master without installing cappuccino tool chain and potentially breaking an existing installation of the tool chain. Breaking an existing installation can really ruin your day on another cappuccino project.

What has to happen is that narwhal and all required packages need to be reinstalled in a separate directory. Then modify the PATH shell-variable to point to the new tools and then you can install cappuccino into that narwhal installation.

## create directory for a new installation of narwhal. This can be any new directory.
mkdir ~/.narwhal
cd ~/.narwhal
git clone git://github.com/cappuccino/narwhal.git
cd narwhal/

## add the new narwhal bin to the front of the command path.
export PATH=$(pwd)/bin:$PATH

## if using bash (or another shell?), the various commands might still be hashed (e.g. which jake), 
## reset the command hash
hash -r

## check that tusk is now coming from the local installation. Should be ~/.narwhal/narwhal/bin/tusk
which tusk

## install necessary tools for building cappuccino
tusk install jake
tusk install browserjs
tusk install shrinksafe

## clone cappuccino and install it into the local narwhal installation. Directory where you do this
## is unimportant, so long you know where it is!
cd ~/gitrepos
git clone https://github.com/cappuccino/cappuccino.git
cd cappuccino

## install cappuccino as tusk package into the local directory as defined above.
## Note, this can take a while, i.e. coffee time.
jake install 

## OJTest to run the cappuccino tests. Needs to be installed after cappuccino 
## since ojtest has a objective-j dependency.
tusk install https://github.com/cappuccino/OJTest/zipball/latest

## run all the tests inside the cappuccino installation
jake test-only

Now you can modify the tests and the cappuccino codebase (assuming your still in the cappuccino directory that you just installed):

## make some modification
emacs AppKit/CoreGraphics/CGGradient.j

## reinstall the new code
jake install

## test the new code
ojtest Tests/AppKit/CGGradientTest.j

Rinse and repeat.

There is also a bash alias for doing this: https://gist.github.com/955379