arnaudbrejeon / cspec Goto Github PK
View Code? Open in Web Editor NEWBehavior driven development in C
License: Other
Behavior driven development in C
License: Other
The Readme is very lacking in the specifics of how to get started with building cspec. Here's what I tried:
$ ./autogen.sh
$ ./configure # also attempted with --prefix=/usr
$ make
$ sudo make install
In my project that I'll be testing, I created a test.c file as described in your README, with code copied from examples/sample/main.c:
#include <stdio.h>
#include <string.h>
#include <cspec.h>
#include <cspec_output_header.h>
#include <cspec_output_verbose.h>
#include <cspec_output_unit.h>
DESCRIBE(strcmp, "int strcmp ( const char * str1, const char * str2 )")
IT( "returns 0 only when strings are equal" )
SHOULD_EQUAL( strcmp("hello", "hello"), 0)
SHOULD_NOT_BE_NULL( strcmp("hello", "world") )
END_IT
IT( "returns a negative integer when str1 is less than str2" )
SHOULD_BE_TRUE( strcmp("hello", "world") < 0 )
SHOULD_BE_TRUE( strcmp("0123", "1321431") < 0 )
END_IT
IT( "returns a positive integer if str1 is greater than str2" )
SHOULD_BE_TRUE( strcmp("yellow", "world") > 0 )
SHOULD_BE_TRUE( strcmp("9", "789") > 0 )
END_IT
END_DESCRIBE
int main() {
CSpec_Run( DESCRIPTION( strcmp ), CSpec_NewOutputHeader() );
return 0;
}
Building test.c with gcc -o test test.c
yields the following errors:
test.o: In function `strcmp_describe':
/vagrant/gtthreads/test.c:14: undefined reference to `CSpec_StartDescribe'
/vagrant/gtthreads/test.c:16: undefined reference to `CSpec_StartIt'
/vagrant/gtthreads/test.c:17: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:18: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:19: undefined reference to `CSpec_EndIt'
/vagrant/gtthreads/test.c:21: undefined reference to `CSpec_StartIt'
/vagrant/gtthreads/test.c:22: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:23: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:24: undefined reference to `CSpec_EndIt'
/vagrant/gtthreads/test.c:26: undefined reference to `CSpec_StartIt'
/vagrant/gtthreads/test.c:27: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:28: undefined reference to `CSpec_Eval'
/vagrant/gtthreads/test.c:29: undefined reference to `CSpec_EndIt'
/vagrant/gtthreads/test.c:31: undefined reference to `CSpec_EndDescribe'
test.o: In function `main':
/vagrant/gtthreads/test.c:34: undefined reference to `CSpec_NewOutputHeader'
/vagrant/gtthreads/test.c:34: undefined reference to `CSpec_Run'
collect2: ld returned 1 exit status
make: *** [test] Error 1```
I attempted these steps on both OSX 10.9.2 and Ubuntu Linux with standard build tools installed and had the same results.
Am I installing cspec properly? Are there build flags that I am missing? Please point me in the right direction.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.