<commit_before>C, CUnit and Make
=================

Prerequisites
-------------

**gcc**:

To check if it is installed already:

    $ gcc -v
    gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) 

**CUnit 2.1-2**:

To download, build and install see [CUnit](http://cunit.sourceforge.net/).

After installing ensure that the `bin`, `include` and `lib`
directories holding the CUnit files are in your paths e.g.

    $ export C_INCLUDE_PATH=/home/user/bin/include:$C_INCLUDE_PATH
    $ export LIBRARY_PATH=/home/user/bin/lib:$LIBRARY_PATH
    $ export LD_LIBRARY_PATH=/home/user/bin/lib:$LD_LIBRARY_PATH

**xsltproc**:

To check if it is installed already:

    $ xsltproc -version
    Using libxml 20706, libxslt 10126 and libexslt 815
    xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
    libxslt 10126 was compiled against libxml 20706
    libexslt 815 was compiled against libxml 20706

**CUnit to JUnit XSL transform**:

This is provided.

* Files: `cunit-to-junit.xsl`.
* Version: Unspecified.
* Licence: Unspecified. Written by <NAME>.
* Web site: http://www.van-porten.de/2009/05/cunit-tests-in-hudson/. 
* Web site: https://bitbucket.org/mcdeck/cunit-to-junit

Usage
-----

Compile:

    $ make fibonacci

Run:

    $ ./fibonacci 30

Compile tests:

    $ make tests

Run tests:

    $ ./tests

View results as XML:

    $ CUnitAutomated-Results.xml 

Make and view an xUnit-style test report:

    $ make report
    $ cat Test-Results.xml

Clean up:

    $ make clean<commit_msg>Added CUnit build and install notes<commit_after>C, CUnit and Make
=================

Prerequisites
-------------

**gcc**:

To check if it is installed already:

    $ gcc -v
    gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) 

**CUnit 2.1-2**:

To download, build and install see [CUnit](http://cunit.sourceforge.net/).

After installing ensure that the `bin`, `include` and `lib`
directories holding the CUnit files are in your paths e.g.

    $ export C_INCLUDE_PATH=/home/user/bin/include:$C_INCLUDE_PATH
    $ export LIBRARY_PATH=/home/user/bin/lib:$LIBRARY_PATH
    $ export LD_LIBRARY_PATH=/home/user/bin/lib:$LD_LIBRARY_PATH

**xsltproc**:

To check if it is installed already:

    $ xsltproc -version
    Using libxml 20706, libxslt 10126 and libexslt 815
    xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
    libxslt 10126 was compiled against libxml 20706
    libexslt 815 was compiled against libxml 20706

**CUnit to JUnit XSL transform**:

This is provided.

* Files: `cunit-to-junit.xsl`.
* Version: Unspecified.
* Licence: Unspecified. Written by <NAME>.
* Web site: http://www.van-porten.de/2009/05/cunit-tests-in-hudson/. 
* Web site: https://bitbucket.org/mcdeck/cunit-to-junit

Usage
-----

Compile:

    $ make fibonacci

Run:

    $ ./fibonacci 30

Compile tests:

    $ make tests

Run tests:

    $ ./tests

View results as XML:

    $ CUnitAutomated-Results.xml 

Make and view an xUnit-style test report:

    $ make report
    $ cat Test-Results.xml

Clean up:

    $ make clean

Notes on how to install CUnit 2.1.2
-----------------------------------

For full instructions on how to download, build and install see
[CUnit](http://cunit.sourceforge.net/).

Download CUnit-2.1-2-src.tar.bz2

Install in `/home/user`:

    $ tar -xvjpf CUnit-2.1-2-src.tar.bz2  
    $ cd CUnit-2.1-2/
    $ ./configure --prefix=/home/user
    $ make
    $ make install
    $ ls /home/user/include
    CUnit
    $ ls /home/user/lib
    libcunit.a   libcunit.so    libcunit.so.1.0.1
    libcunit.la  libcunit.so.1  pkgconfig
{'fraction_non_alphanumeric': 0.13448660714285715, 'fraction_numerical': 0.04408482142857143, 'mean_word_length': 2.8714902807775378, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1138637', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1232, 'n_words': 363}