vmg/clar — pull request #44 by chip (2014-01-04 22:30:34+00:00)
Title: clar.c:508:10: fatal error: 'clar/sandbox.h' file not found

This looks like a really cool library, but I ran into a little trouble on my first try. **I think all that is needed is to revise the README, which is what I did here.** Please let me know if there's a better way to accomplish this.

### The problem

#### Here's what I did after forking the repo:

1. Clone it
```shell
hub clone chip/clar
Cloning into 'clar'...
remote: Reusing existing pack: 456, done.
remote: Total 456 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (456/456), 240.96 KiB | 0 bytes/s, done.
Resolving deltas: 100% (232/232), done.
Checking connectivity... done
```

2. Export ENV variables
```shell
export CLAR_ROOT=~/code/clar
export CLAR_PATH=~/code/clar
```

3. Follow Quick Usage Overview from the README
```shell
mkdir tests
cp -r $CLAR_ROOT/clar.[ch] $CLAR_ROOT/clar/ tests
cp $CLAR_ROOT/test/main.c.sample tests/main.c
```

***Here's what `cat tests/adding.c` shows:***

```c

/* adding.c for the "Adding" suite */
#include "clar.h"

static int *answer;

void test_adding__initialize(void)
{
answer = malloc(sizeof(int));
cl_assert_(answer != NULL, "No memory left?");
*answer = 42;
}

void test_adding__cleanup(void)
{
free(answer);
}

void test_adding__make_sure_math_still_works(void)
{
cl_assert_(5 > 3, "Five should probably be greater than three");
cl_assert_(-5 < 2, "Negative numbers are small, I think");
cl_assert_(*answer == 42, "The universe is doing OK. And the initializer too.");
}
```

***Trying to get my FUNK ON here***

```shell
cd tests

$CLAR_PATH/generate.py .
Written `clar.suite` (1 tests in 1 suites)

gcc -I. clar.c main.c adding.c -o testit
clar.c:508:10: fatal error: 'clar/sandbox.h' file not found
#include "clar/sandbox.h"
^
1 error generated.
main.c:8:10: fatal error: 'clar_test.h' file not found
#include "clar_test.h"
^
1 error generated.
```

### The solution

```shell
env | grep CLAR
CLAR_PATH=/Users/chip/code/clar
CLAR_ROOT=/Users/chip/code/clar
mkdir tests
```

**Make a minor change to the copying commands** (per my commit)
```shell
cp -r $CLAR_ROOT/clar* tests
cp clar/test/clar_test.h tests
```

Resume the FUNK, which works fine this time around:
```shell
cp $CLAR_ROOT/test/main.c.sample tests/main.c
vi tests/adding.c
cd tests
$CLAR_PATH/generate.py .
Written `clar.suite` (1 tests in 1 suites)
gcc -I. clar.c main.c adding.c -o testit
./testit
Loaded 1 suites:
Started
.
```

I'll be happy to update this commit if there's a simpler way, or close it if I totally missed something. Thanks for this library! :+1: