convert to unix EOL, README: add repo origin & mask emails
This commit is contained in:
451
README.md
451
README.md
@@ -1,224 +1,227 @@
|
|||||||
How To Use
|
Forked from: https://github.com/asimjalis/cutest
|
||||||
----------
|
Original work: https://sourceforge.net/projects/cutest/
|
||||||
|
|
||||||
Minimalist powerful C unit testing framework.
|
How To Use
|
||||||
|
----------
|
||||||
You can use CuTest to create unit tests to drive your development
|
|
||||||
in the style of Extreme Programming. You can also add unit tests to
|
Minimalist powerful C unit testing framework.
|
||||||
existing code to ensure that it works as you suspect.
|
|
||||||
|
You can use CuTest to create unit tests to drive your development
|
||||||
Your unit tests are an investment. They let you to change your
|
in the style of Extreme Programming. You can also add unit tests to
|
||||||
code and add new features confidently without worrying about
|
existing code to ensure that it works as you suspect.
|
||||||
accidentally breaking earlier features.
|
|
||||||
|
Your unit tests are an investment. They let you to change your
|
||||||
|
code and add new features confidently without worrying about
|
||||||
Licensing
|
accidentally breaking earlier features.
|
||||||
---------
|
|
||||||
|
|
||||||
For details on licensing see license.txt.
|
Licensing
|
||||||
|
---------
|
||||||
|
|
||||||
Getting Started
|
For details on licensing see license.txt.
|
||||||
---------------
|
|
||||||
|
|
||||||
To add unit testing to your C code the only files you need are
|
Getting Started
|
||||||
CuTest.c and CuTest.h.
|
---------------
|
||||||
|
|
||||||
CuTestTest.c and AllTests.c have been included to provide an
|
To add unit testing to your C code the only files you need are
|
||||||
example of how to write unit tests and then how to aggregate them
|
CuTest.c and CuTest.h.
|
||||||
into suites and into a single AllTests.c file. Suites allow you
|
|
||||||
to put group tests into logical sets. AllTests.c combines all the
|
CuTestTest.c and AllTests.c have been included to provide an
|
||||||
suites and runs them.
|
example of how to write unit tests and then how to aggregate them
|
||||||
|
into suites and into a single AllTests.c file. Suites allow you
|
||||||
You should not have to look inside CuTest.c. Looking in
|
to put group tests into logical sets. AllTests.c combines all the
|
||||||
CuTestTest.c and AllTests.c (for example usage) should be
|
suites and runs them.
|
||||||
sufficient.
|
|
||||||
|
You should not have to look inside CuTest.c. Looking in
|
||||||
After downloading the sources, run your compiler to create an
|
CuTestTest.c and AllTests.c (for example usage) should be
|
||||||
executable called AllTests.exe. For example, if you are using
|
sufficient.
|
||||||
Windows with the cl.exe compiler you would type:
|
|
||||||
|
After downloading the sources, run your compiler to create an
|
||||||
cl.exe AllTests.c CuTest.c CuTestTest.c
|
executable called AllTests.exe. For example, if you are using
|
||||||
AllTests.exe
|
Windows with the cl.exe compiler you would type:
|
||||||
|
|
||||||
On Unix you should type:
|
cl.exe AllTests.c CuTest.c CuTestTest.c
|
||||||
|
AllTests.exe
|
||||||
gcc AllTests.c CuTest.c CuTestTest.c
|
|
||||||
./a.out
|
On Unix you should type:
|
||||||
|
|
||||||
This will run all the unit tests associated with CuTest and print
|
gcc AllTests.c CuTest.c CuTestTest.c
|
||||||
the output on the console. You can replace cl.exe with gcc or
|
./a.out
|
||||||
your favorite compiler in the command above.
|
|
||||||
|
This will run all the unit tests associated with CuTest and print
|
||||||
|
the output on the console. You can replace cl.exe with gcc or
|
||||||
Detailed Example
|
your favorite compiler in the command above.
|
||||||
----------------
|
|
||||||
|
|
||||||
Here is a more detailed example. We will work through a simple
|
Detailed Example
|
||||||
test first exercise. The goal is to create a library of string
|
----------------
|
||||||
utilities. First, lets write a function that converts a
|
|
||||||
null-terminated string to all upper case.
|
Here is a more detailed example. We will work through a simple
|
||||||
|
test first exercise. The goal is to create a library of string
|
||||||
Ensure that CuTest.c and CuTest.h are accessible from your C
|
utilities. First, lets write a function that converts a
|
||||||
project. Next, create a file called StrUtil.c with these
|
null-terminated string to all upper case.
|
||||||
contents:
|
|
||||||
|
Ensure that CuTest.c and CuTest.h are accessible from your C
|
||||||
#include "CuTest.h"
|
project. Next, create a file called StrUtil.c with these
|
||||||
|
contents:
|
||||||
char* StrToUpper(char* str) {
|
|
||||||
return str;
|
#include "CuTest.h"
|
||||||
}
|
|
||||||
|
char* StrToUpper(char* str) {
|
||||||
void TestStrToUpper(CuTest *tc) {
|
return str;
|
||||||
char* input = strdup("hello world");
|
}
|
||||||
char* actual = StrToUpper(input);
|
|
||||||
char* expected = "HELLO WORLD";
|
void TestStrToUpper(CuTest *tc) {
|
||||||
CuAssertStrEquals(tc, expected, actual);
|
char* input = strdup("hello world");
|
||||||
}
|
char* actual = StrToUpper(input);
|
||||||
|
char* expected = "HELLO WORLD";
|
||||||
CuSuite* StrUtilGetSuite() {
|
CuAssertStrEquals(tc, expected, actual);
|
||||||
CuSuite* suite = CuSuiteNew();
|
}
|
||||||
SUITE_ADD_TEST(suite, TestStrToUpper);
|
|
||||||
return suite;
|
CuSuite* StrUtilGetSuite() {
|
||||||
}
|
CuSuite* suite = CuSuiteNew();
|
||||||
|
SUITE_ADD_TEST(suite, TestStrToUpper);
|
||||||
Create another file called AllTests.c with these contents:
|
return suite;
|
||||||
|
}
|
||||||
#include "CuTest.h"
|
|
||||||
|
Create another file called AllTests.c with these contents:
|
||||||
CuSuite* StrUtilGetSuite();
|
|
||||||
|
#include "CuTest.h"
|
||||||
void RunAllTests(void) {
|
|
||||||
CuString *output = CuStringNew();
|
CuSuite* StrUtilGetSuite();
|
||||||
CuSuite* suite = CuSuiteNew();
|
|
||||||
|
void RunAllTests(void) {
|
||||||
CuSuiteAddSuite(suite, StrUtilGetSuite());
|
CuString *output = CuStringNew();
|
||||||
|
CuSuite* suite = CuSuiteNew();
|
||||||
CuSuiteRun(suite);
|
|
||||||
CuSuiteSummary(suite, output);
|
CuSuiteAddSuite(suite, StrUtilGetSuite());
|
||||||
CuSuiteDetails(suite, output);
|
|
||||||
printf("%s\n", output->buffer);
|
CuSuiteRun(suite);
|
||||||
}
|
CuSuiteSummary(suite, output);
|
||||||
|
CuSuiteDetails(suite, output);
|
||||||
int main(void) {
|
printf("%s\n", output->buffer);
|
||||||
RunAllTests();
|
}
|
||||||
}
|
|
||||||
|
int main(void) {
|
||||||
Then type this on the command line:
|
RunAllTests();
|
||||||
|
}
|
||||||
gcc AllTests.c CuTest.c StrUtil.c
|
|
||||||
|
Then type this on the command line:
|
||||||
to compile. You can replace gcc with your favorite compiler.
|
|
||||||
CuTest should be portable enough to handle all Windows and Unix
|
gcc AllTests.c CuTest.c StrUtil.c
|
||||||
compilers. Then to run the tests type:
|
|
||||||
|
to compile. You can replace gcc with your favorite compiler.
|
||||||
./a.out
|
CuTest should be portable enough to handle all Windows and Unix
|
||||||
|
compilers. Then to run the tests type:
|
||||||
This will print an error because we haven't implemented the
|
|
||||||
StrToUpper function correctly. We are just returning the string
|
./a.out
|
||||||
without changing it to upper case.
|
|
||||||
|
This will print an error because we haven't implemented the
|
||||||
char* StrToUpper(char* str) {
|
StrToUpper function correctly. We are just returning the string
|
||||||
return str;
|
without changing it to upper case.
|
||||||
}
|
|
||||||
|
char* StrToUpper(char* str) {
|
||||||
Rewrite this as follows:
|
return str;
|
||||||
|
}
|
||||||
char* StrToUpper(char* str) {
|
|
||||||
char* p;
|
Rewrite this as follows:
|
||||||
for (p = str ; *p ; ++p) *p = toupper(*p);
|
|
||||||
return str;
|
char* StrToUpper(char* str) {
|
||||||
}
|
char* p;
|
||||||
|
for (p = str ; *p ; ++p) *p = toupper(*p);
|
||||||
Recompile and run the tests again. The test should pass this
|
return str;
|
||||||
time.
|
}
|
||||||
|
|
||||||
|
Recompile and run the tests again. The test should pass this
|
||||||
What To Do Next
|
time.
|
||||||
---------------
|
|
||||||
|
|
||||||
At this point you might want to write more tests for the
|
What To Do Next
|
||||||
StrToUpper function. Here are some ideas:
|
---------------
|
||||||
|
|
||||||
TestStrToUpper_EmptyString /* pass in "" */
|
At this point you might want to write more tests for the
|
||||||
TestStrToUpper_UpperCase /* pass in "HELLO WORLD" */
|
StrToUpper function. Here are some ideas:
|
||||||
TestStrToUpper_MixedCase /* pass in "HELLO world" */
|
|
||||||
TestStrToUpper_Numbers /* pass in "1234 hello" */
|
TestStrToUpper_EmptyString /* pass in "" */
|
||||||
|
TestStrToUpper_UpperCase /* pass in "HELLO WORLD" */
|
||||||
As you write each one of these tests add it to StrUtilGetSuite
|
TestStrToUpper_MixedCase /* pass in "HELLO world" */
|
||||||
function. If you don't the tests won't be run. Later as you write
|
TestStrToUpper_Numbers /* pass in "1234 hello" */
|
||||||
other functions and write tests for them be sure to include those
|
|
||||||
in StrUtilGetSuite also. The StrUtilGetSuite function should
|
As you write each one of these tests add it to StrUtilGetSuite
|
||||||
include all the tests in StrUtil.c
|
function. If you don't the tests won't be run. Later as you write
|
||||||
|
other functions and write tests for them be sure to include those
|
||||||
Over time you will create another file called FunkyStuff.c
|
in StrUtilGetSuite also. The StrUtilGetSuite function should
|
||||||
containing other functions unrelated to StrUtil. Follow the same
|
include all the tests in StrUtil.c
|
||||||
pattern. Create a FunkyStuffGetSuite function in FunkyStuff.c.
|
|
||||||
And add FunkyStuffGetSuite to AllTests.c.
|
Over time you will create another file called FunkyStuff.c
|
||||||
|
containing other functions unrelated to StrUtil. Follow the same
|
||||||
The framework is designed in the way it is so that it is easy to
|
pattern. Create a FunkyStuffGetSuite function in FunkyStuff.c.
|
||||||
organize a lot of tests.
|
And add FunkyStuffGetSuite to AllTests.c.
|
||||||
|
|
||||||
The Big Picture
|
The framework is designed in the way it is so that it is easy to
|
||||||
---------------
|
organize a lot of tests.
|
||||||
|
|
||||||
Each individual test corresponds to a CuTest. These are grouped
|
The Big Picture
|
||||||
to form a CuSuite. CuSuites can hold CuTests or other CuSuites.
|
---------------
|
||||||
AllTests.c collects all the CuSuites in the program into a single
|
|
||||||
CuSuite which it then runs as a single CuSuite.
|
Each individual test corresponds to a CuTest. These are grouped
|
||||||
|
to form a CuSuite. CuSuites can hold CuTests or other CuSuites.
|
||||||
The project is open source so feel free to take a peek under the
|
AllTests.c collects all the CuSuites in the program into a single
|
||||||
hood at the CuTest.c file to see how it works. CuTestTest.c
|
CuSuite which it then runs as a single CuSuite.
|
||||||
contains tests for CuTest.c. So CuTest tests itself.
|
|
||||||
|
The project is open source so feel free to take a peek under the
|
||||||
Since AllTests.c has a main() you will need to exclude this when
|
hood at the CuTest.c file to see how it works. CuTestTest.c
|
||||||
you are building your product. Here is a nicer way to do this if
|
contains tests for CuTest.c. So CuTest tests itself.
|
||||||
you want to avoid messing with multiple builds. Remove the main()
|
|
||||||
in AllTests.c. Note that it just calls RunAllTests(). Instead
|
Since AllTests.c has a main() you will need to exclude this when
|
||||||
we'll call this directly from the main program.
|
you are building your product. Here is a nicer way to do this if
|
||||||
|
you want to avoid messing with multiple builds. Remove the main()
|
||||||
Now in the main() of the actual program check to see if the
|
in AllTests.c. Note that it just calls RunAllTests(). Instead
|
||||||
command line option "--test" was passed. If it was then I call
|
we'll call this directly from the main program.
|
||||||
RunAllTests() from AllTests.c. Otherwise run the real program.
|
|
||||||
|
Now in the main() of the actual program check to see if the
|
||||||
Shipping the tests with the code can be useful. If you customers
|
command line option "--test" was passed. If it was then I call
|
||||||
complain about a problem you can ask them to run the unit tests
|
RunAllTests() from AllTests.c. Otherwise run the real program.
|
||||||
and send you the output. This can help you to quickly isolate the
|
|
||||||
piece of your system that is malfunctioning in the customer's
|
Shipping the tests with the code can be useful. If you customers
|
||||||
environment.
|
complain about a problem you can ask them to run the unit tests
|
||||||
|
and send you the output. This can help you to quickly isolate the
|
||||||
CuTest offers a rich set of CuAssert functions. Here is a list:
|
piece of your system that is malfunctioning in the customer's
|
||||||
|
environment.
|
||||||
void CuAssert(CuTest* tc, char* message, int condition);
|
|
||||||
void CuAssertTrue(CuTest* tc, int condition);
|
CuTest offers a rich set of CuAssert functions. Here is a list:
|
||||||
void CuAssertStrEquals(CuTest* tc, char* expected, char* actual);
|
|
||||||
void CuAssertIntEquals(CuTest* tc, int expected, int actual);
|
void CuAssert(CuTest* tc, char* message, int condition);
|
||||||
void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual);
|
void CuAssertTrue(CuTest* tc, int condition);
|
||||||
void CuAssertPtrNotNull(CuTest* tc, void* pointer);
|
void CuAssertStrEquals(CuTest* tc, char* expected, char* actual);
|
||||||
|
void CuAssertIntEquals(CuTest* tc, int expected, int actual);
|
||||||
The project is open source and so you can add other more powerful
|
void CuAssertPtrEquals(CuTest* tc, void* expected, void* actual);
|
||||||
asserts to make your tests easier to write and more concise.
|
void CuAssertPtrNotNull(CuTest* tc, void* pointer);
|
||||||
Please feel free to send me changes you make so that I can
|
|
||||||
incorporate them into future releases.
|
The project is open source and so you can add other more powerful
|
||||||
|
asserts to make your tests easier to write and more concise.
|
||||||
If you see any errors in this document please contact me at
|
Please feel free to send me changes you make so that I can
|
||||||
asimjalis@gmail.com.
|
incorporate them into future releases.
|
||||||
|
|
||||||
|
If you see any errors in this document please contact me at
|
||||||
Automating Test Suite Generation
|
asimjalis-nospam@gmail.com.
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
make-tests.sh will grep through all the .c files in the current
|
Automating Test Suite Generation
|
||||||
directory and generate the code to run all the tests contained in
|
--------------------------------
|
||||||
them. Using this script you don't have to worry about writing
|
|
||||||
AllTests.c or dealing with any of the other suite code.
|
make-tests.sh will grep through all the .c files in the current
|
||||||
|
directory and generate the code to run all the tests contained in
|
||||||
|
them. Using this script you don't have to worry about writing
|
||||||
Credits
|
AllTests.c or dealing with any of the other suite code.
|
||||||
-------
|
|
||||||
|
|
||||||
[02.23.2003] Dave Glowacki <dglo@hyde.ssec.wisc.edu> has added
|
Credits
|
||||||
(1) file name and line numbers to the error messages, (2)
|
-------
|
||||||
AssertDblEquals for doubles, (3) Assert<X>Equals_Msg version of
|
|
||||||
all the Assert<X>Equals to pass in optional message which is
|
[02.23.2003] Dave Glowacki <dglo-nospam@hyde.ssec.wisc.edu> has added
|
||||||
printed out on assert failure.
|
(1) file name and line numbers to the error messages, (2)
|
||||||
|
AssertDblEquals for doubles, (3) Assert<X>Equals_Msg version of
|
||||||
|
all the Assert<X>Equals to pass in optional message which is
|
||||||
|
printed out on assert failure.
|
||||||
|
392
index.html
392
index.html
@@ -1,196 +1,196 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<link href="style.css" rel="stylesheet" type="text/css">
|
<link href="style.css" rel="stylesheet" type="text/css">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>CuTest: The Cutest C Unit Testing Framework</title>
|
<title>CuTest: The Cutest C Unit Testing Framework</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<BODY>
|
<BODY>
|
||||||
|
|
||||||
<script type="text/javascript"><!--
|
<script type="text/javascript"><!--
|
||||||
google_ad_client = "pub-6301376840682363";
|
google_ad_client = "pub-6301376840682363";
|
||||||
google_ad_width = 728;
|
google_ad_width = 728;
|
||||||
google_ad_height = 90;
|
google_ad_height = 90;
|
||||||
google_ad_format = "728x90_as";
|
google_ad_format = "728x90_as";
|
||||||
google_ad_channel ="3703387138";
|
google_ad_channel ="3703387138";
|
||||||
google_color_border = "CCCCCC";
|
google_color_border = "CCCCCC";
|
||||||
google_color_bg = "FFFFFF";
|
google_color_bg = "FFFFFF";
|
||||||
google_color_link = "000000";
|
google_color_link = "000000";
|
||||||
google_color_url = "666666";
|
google_color_url = "666666";
|
||||||
google_color_text = "333333";
|
google_color_text = "333333";
|
||||||
//--></script>
|
//--></script>
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<HR>
|
<HR>
|
||||||
<FONT SIZE="-1">
|
<FONT SIZE="-1">
|
||||||
[
|
[
|
||||||
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=52240">Download Now</A>
|
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=52240">Download Now</A>
|
||||||
| <A HREF="http://sourceforge.net/project/stats/?group_id=52240&ugn=cutest">Download Statistics</A>
|
| <A HREF="http://sourceforge.net/project/stats/?group_id=52240&ugn=cutest">Download Statistics</A>
|
||||||
| <A HREF="http://sourceforge.net/cvs/?group_id=52240">Browse Source</A>
|
| <A HREF="http://sourceforge.net/cvs/?group_id=52240">Browse Source</A>
|
||||||
| <A HREF="http://sourceforge.net/projects/cutest">SourceForge</A>
|
| <A HREF="http://sourceforge.net/projects/cutest">SourceForge</A>
|
||||||
| <A HREF="http://asimjalis.blogspot.com">Blog</A>
|
| <A HREF="http://asimjalis.blogspot.com">Blog</A>
|
||||||
| <A HREF="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</A>
|
| <A HREF="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</A>
|
||||||
]
|
]
|
||||||
</FONT>
|
</FONT>
|
||||||
<HR>
|
<HR>
|
||||||
|
|
||||||
|
|
||||||
<H1>CuTest: C Unit Testing Framework</H1>
|
<H1>CuTest: C Unit Testing Framework</H1>
|
||||||
|
|
||||||
|
|
||||||
<h2>Overview</h2>
|
<h2>Overview</h2>
|
||||||
|
|
||||||
CuTest is a unit testing library for the C language. It can be
|
CuTest is a unit testing library for the C language. It can be
|
||||||
used to do Extreme Programming and Test-First Development in the
|
used to do Extreme Programming and Test-First Development in the
|
||||||
C language. It's a fun and cute library that will make your
|
C language. It's a fun and cute library that will make your
|
||||||
programming fun and productive.
|
programming fun and productive.
|
||||||
|
|
||||||
<h2>Benefits</h2>
|
<h2>Benefits</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li> Lower Defects. The tests ensure that your code keeps working
|
<li> Lower Defects. The tests ensure that your code keeps working
|
||||||
as you make small changes in it.
|
as you make small changes in it.
|
||||||
|
|
||||||
<li> Faster Debugging. The tests tell you which subroutine is
|
<li> Faster Debugging. The tests tell you which subroutine is
|
||||||
broken. You avoid spending hours trying to figure out what's
|
broken. You avoid spending hours trying to figure out what's
|
||||||
broken.
|
broken.
|
||||||
|
|
||||||
<li> Development Speed. You trust your old code and can keep
|
<li> Development Speed. You trust your old code and can keep
|
||||||
adding to it without worrying about bad interactions. If there is
|
adding to it without worrying about bad interactions. If there is
|
||||||
a bad interaction the tests will catch it.
|
a bad interaction the tests will catch it.
|
||||||
|
|
||||||
<li> Permanent Bug Fixes. If every time a bug is reported you
|
<li> Permanent Bug Fixes. If every time a bug is reported you
|
||||||
write a quick test, you will guarantee that the bug never
|
write a quick test, you will guarantee that the bug never
|
||||||
reappears again.
|
reappears again.
|
||||||
|
|
||||||
<li> Fun. As your bug count drops you will begin to enjoy
|
<li> Fun. As your bug count drops you will begin to enjoy
|
||||||
programming like you've never done before. Running the tests
|
programming like you've never done before. Running the tests
|
||||||
every few minutes and seeing them pass feels good.
|
every few minutes and seeing them pass feels good.
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2> Features </h2>
|
<h2> Features </h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li> Small. Consists of a single .c and .h file.
|
<li> Small. Consists of a single .c and .h file.
|
||||||
|
|
||||||
<li> Easy to Deploy. Just drop the two files into your source
|
<li> Easy to Deploy. Just drop the two files into your source
|
||||||
tree.
|
tree.
|
||||||
|
|
||||||
<li> Highly Portable. Works with all major compilers on Windows
|
<li> Highly Portable. Works with all major compilers on Windows
|
||||||
(Microsoft, Borland), Linux, Unix, PalmOS.
|
(Microsoft, Borland), Linux, Unix, PalmOS.
|
||||||
|
|
||||||
<li> Open Source. You can extend it to add more functionality.
|
<li> Open Source. You can extend it to add more functionality.
|
||||||
The source can be invaluable if you are trying to trace a test
|
The source can be invaluable if you are trying to trace a test
|
||||||
failure.
|
failure.
|
||||||
|
|
||||||
<li> Cuteness. Of all the testing frameworks CuTest has the
|
<li> Cuteness. Of all the testing frameworks CuTest has the
|
||||||
cutest name :-)
|
cutest name :-)
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h2>Licensing</h2>
|
<h2>Licensing</h2>
|
||||||
|
|
||||||
CuTest is distributed under the <a
|
CuTest is distributed under the <a
|
||||||
href="http://www.opensource.org/licenses/zlib-license.html">zlib/libpng
|
href="http://www.opensource.org/licenses/zlib-license.html">zlib/libpng
|
||||||
license</a>. See license.txt in the distribution for text of license. The
|
license</a>. See license.txt in the distribution for text of license. The
|
||||||
intent of the license is to:
|
intent of the license is to:
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li> Keep the license as simple as possible
|
<li> Keep the license as simple as possible
|
||||||
<li> Encourage the use of CuTest in both free and commercial applications and libraries
|
<li> Encourage the use of CuTest in both free and commercial applications and libraries
|
||||||
<li> Keep the source code together
|
<li> Keep the source code together
|
||||||
<li> Give credit to the CuTest contributors for their work
|
<li> Give credit to the CuTest contributors for their work
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
If you find CuTest useful we would like to hear about it.
|
If you find CuTest useful we would like to hear about it.
|
||||||
|
|
||||||
|
|
||||||
<h2>Getting Started</h2>
|
<h2>Getting Started</h2>
|
||||||
|
|
||||||
<p> For a detailed tutorial see README in the distribution. This shows you how
|
<p> For a detailed tutorial see README in the distribution. This shows you how
|
||||||
to organize your tests and how to autogenerate the AllTests.c file from your
|
to organize your tests and how to autogenerate the AllTests.c file from your
|
||||||
source files.
|
source files.
|
||||||
|
|
||||||
<p> To add unit testing to your C code the only files you need
|
<p> To add unit testing to your C code the only files you need
|
||||||
are CuTest.c and CuTest.h.
|
are CuTest.c and CuTest.h.
|
||||||
|
|
||||||
<p> CuTestTest.c and AllTests.c have been included to provide an
|
<p> CuTestTest.c and AllTests.c have been included to provide an
|
||||||
example of how to write unit tests and then how to aggregate them
|
example of how to write unit tests and then how to aggregate them
|
||||||
into suites and into a single AllTests.c file. Suites allow you
|
into suites and into a single AllTests.c file. Suites allow you
|
||||||
to put unit tests for different parts of your code in different
|
to put unit tests for different parts of your code in different
|
||||||
files. AllTests.c combines all the suites and runs them.
|
files. AllTests.c combines all the suites and runs them.
|
||||||
|
|
||||||
<p> You should not have to look inside CuTest.c. Looking in
|
<p> You should not have to look inside CuTest.c. Looking in
|
||||||
CuTestTest.c (for example usage) should be sufficient.
|
CuTestTest.c (for example usage) should be sufficient.
|
||||||
|
|
||||||
<p> After downloading the sources, run your compiler to create an
|
<p> After downloading the sources, run your compiler to create an
|
||||||
executable called AllTests.exe. For example, if you are using
|
executable called AllTests.exe. For example, if you are using
|
||||||
Windows you would type:
|
Windows you would type:
|
||||||
|
|
||||||
<PRE CLASS="CONSOLE">
|
<PRE CLASS="CONSOLE">
|
||||||
cl AllTests.c CuTest.c CuTestTest.c
|
cl AllTests.c CuTest.c CuTestTest.c
|
||||||
AllTests.exe
|
AllTests.exe
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
<p> This will run all the unit tests associated with CuTest and
|
<p> This will run all the unit tests associated with CuTest and
|
||||||
print the output on the console.
|
print the output on the console.
|
||||||
|
|
||||||
<p> For more details on how to use the library look at the README file included
|
<p> For more details on how to use the library look at the README file included
|
||||||
with the distribution.
|
with the distribution.
|
||||||
|
|
||||||
<h2>Contribute</h2>
|
<h2>Contribute</h2>
|
||||||
|
|
||||||
<p> We hope you CuTest saves you time and helps you produce high quality
|
<p> We hope you CuTest saves you time and helps you produce high quality
|
||||||
software.
|
software.
|
||||||
|
|
||||||
<p> If you find CuTest useful, let us know. Tell us what platform you are using
|
<p> If you find CuTest useful, let us know. Tell us what platform you are using
|
||||||
it on (Windows, Linux, etc), and what kinds of applications you are using it
|
it on (Windows, Linux, etc), and what kinds of applications you are using it
|
||||||
with.
|
with.
|
||||||
|
|
||||||
<p> If you would like to contribute documentation or tutorials to this project
|
<p> If you would like to contribute documentation or tutorials to this project
|
||||||
please send e-mail.
|
please send e-mail.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<font size="-1">
|
<font size="-1">
|
||||||
Copyright © 2002-2003, Asim Jalis (<a
|
Copyright © 2002-2003, Asim Jalis (<a
|
||||||
href="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</a>).
|
href="mailto:asimjalis(nospam)gmail.com">asimjalis(nospam)gmail.com</a>).
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
</font>
|
</font>
|
||||||
|
|
||||||
<SCRIPT language="JavaScript">
|
<SCRIPT language="JavaScript">
|
||||||
<!--
|
<!--
|
||||||
var re = /\(nospam\)/ig;
|
var re = /\(nospam\)/ig;
|
||||||
var str;
|
var str;
|
||||||
|
|
||||||
for(i = 0;i < document.links.length;i++)
|
for(i = 0;i < document.links.length;i++)
|
||||||
{
|
{
|
||||||
str = "" + document.links(i).href;
|
str = "" + document.links(i).href;
|
||||||
if(str.search(re) != -1)
|
if(str.search(re) != -1)
|
||||||
document.links(i).href = str.replace(re, "@");
|
document.links(i).href = str.replace(re, "@");
|
||||||
|
|
||||||
str = "" + document.links(i).innerHTML;
|
str = "" + document.links(i).innerHTML;
|
||||||
if(str.search(re) != -1)
|
if(str.search(re) != -1)
|
||||||
document.links(i).innerHTML = str.replace(re, "@");
|
document.links(i).innerHTML = str.replace(re, "@");
|
||||||
}
|
}
|
||||||
-->
|
-->
|
||||||
</SCRIPT>
|
</SCRIPT>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=52240&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>
|
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=52240&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo"></a>
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
|
76
license.txt
76
license.txt
@@ -1,38 +1,38 @@
|
|||||||
NOTE
|
NOTE
|
||||||
|
|
||||||
The license is based on the zlib/libpng license. For more details see
|
The license is based on the zlib/libpng license. For more details see
|
||||||
http://www.opensource.org/licenses/zlib-license.html. The intent of the
|
http://www.opensource.org/licenses/zlib-license.html. The intent of the
|
||||||
license is to:
|
license is to:
|
||||||
|
|
||||||
- keep the license as simple as possible
|
- keep the license as simple as possible
|
||||||
- encourage the use of CuTest in both free and commercial applications
|
- encourage the use of CuTest in both free and commercial applications
|
||||||
and libraries
|
and libraries
|
||||||
- keep the source code together
|
- keep the source code together
|
||||||
- give credit to the CuTest contributors for their work
|
- give credit to the CuTest contributors for their work
|
||||||
|
|
||||||
If you ship CuTest in source form with your source distribution, the
|
If you ship CuTest in source form with your source distribution, the
|
||||||
following license document must be included with it in unaltered form.
|
following license document must be included with it in unaltered form.
|
||||||
If you find CuTest useful we would like to hear about it.
|
If you find CuTest useful we would like to hear about it.
|
||||||
|
|
||||||
LICENSE
|
LICENSE
|
||||||
|
|
||||||
Copyright (c) 2003 Asim Jalis
|
Copyright (c) 2003 Asim Jalis
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
arising from the use of this software.
|
arising from the use of this software.
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
including commercial applications, and to alter it and redistribute it
|
including commercial applications, and to alter it and redistribute it
|
||||||
freely, subject to the following restrictions:
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
claim that you wrote the original software. If you use this software in
|
claim that you wrote the original software. If you use this software in
|
||||||
a product, an acknowledgment in the product documentation would be
|
a product, an acknowledgment in the product documentation would be
|
||||||
appreciated but is not required.
|
appreciated but is not required.
|
||||||
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not
|
2. Altered source versions must be plainly marked as such, and must not
|
||||||
be misrepresented as being the original software.
|
be misrepresented as being the original software.
|
||||||
|
|
||||||
3. This notice may not be removed or altered from any source
|
3. This notice may not be removed or altered from any source
|
||||||
distribution.
|
distribution.
|
||||||
|
42
style.css
42
style.css
@@ -1,21 +1,21 @@
|
|||||||
BODY {
|
BODY {
|
||||||
font-family: "Verdana,Arial,sans-serif";
|
font-family: "Verdana,Arial,sans-serif";
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
PRE.LIST {
|
PRE.LIST {
|
||||||
background: #CFD9FF;
|
background: #CFD9FF;
|
||||||
border: 1ex solid #AAAAE6;
|
border: 1ex solid #AAAAE6;
|
||||||
padding: 1ex;
|
padding: 1ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRE.SNIP {
|
PRE.SNIP {
|
||||||
background: #CFD9FF;
|
background: #CFD9FF;
|
||||||
padding: 1ex;
|
padding: 1ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRE.CONSOLE {
|
PRE.CONSOLE {
|
||||||
color: #CCCCCC;
|
color: #CCCCCC;
|
||||||
background: #000000;
|
background: #000000;
|
||||||
font-family: "Courier New,Courier";
|
font-family: "Courier New,Courier";
|
||||||
padding: 1ex;
|
padding: 1ex;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user