1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
This is the "money example" from the Check tutorial.
This demonstrates using Check along with one of two build systems:
autotools and CMake.
========================
Autotools:
You need the following programs installed on your system:
-- Autoconf 2.59
-- Automake 1.9.6
-- Libtool 1.5.22
-- Check 0.9.9
Somewhat earlier versions of these programs might work.
Then, do as follows:
$ autoreconf --install
$ ./configure
$ make
$ make check
Don't do "make install" unless you want to install the money example.
money.c and money.h are built as a library. src/main.c:main() is a
client of libmoney.la, just as tests/check_money.c:main() is a client
of libmoney.la
To use the autotools example in another project, start with the following
files:
example
|--- configure.ac
|--- Makefile.am
|--- src
| |--- Makefile.am
|--- tests
|--- Makefile.am
Please send bug reports to check-devel AT lists.sourceforge.net.
========================
CMake:
You need the following programs installed on your system:
-- CMake 2.8
-- Check 0.9.9
-- (pkg-config 0.26 is optional)
Somewhat earlier versions of these programs might work.
NOTE: If pkg-config is not installed on the system, and MSVC is being used,
the install location of Check must be inserted manually into the
tests/CMakeLists.txt file, by setting the variable CHECK_INSTALL_DIR
to the install location. Look at the tests/CMakeLists.txt file for
a commented out example.
Then, do as follows for a Unix-compatible shell:
$ cmake .
$ make
$ make test
or the following for MSVC:
$ cmake -G "NMake Makefiles" .
$ nmake
$ nmake test
Don't do "make install" or "nmake install" unless you want to install the money example.
money.c and money.h are built as a library. src/main.c:main() is a
client of libmoney.la, just as tests/check_money.c:main() is a client
of libmoney.la
To use the CMake example in another project, start with the following files:
example
|--- CMakeFiles.txt
|--- cmake
| |--- config.h.in
| |--- FindCheck.cmake
|--- src
| |--- CMakeFiles.txt
|--- tests
|--- CMakeFiles.txt
Please send bug reports to check-devel AT lists.sourceforge.net.
|