Pickler

Pickler is a testing sweet centered around pickles.

How To Use

To init the Pickler Lib first include Pickler.h

#include "Pickler.h"

After includeing Pickler next we need to init Pickler. This is vary simple. Just add into your int main() CREATESHELF This creates a safe place to put your pickle jars.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();
}

Once The shelf is created we can create Pickle Jars. To Create a pickle jar call CREATEJAR(name) This will create a pickle jar. The Pickle Jar must be created after the shelf. The Pickle Jar requires a name. This name should be entererd in plain text and with no speshial characters and should be treated like a varaible name.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();
    // Creating Pickle Jar
    CREATEJAR(jar_name);
}

Next we can make Pickles. To Create a Pickle just use the `PICKLE' macro. Treate this like a lambda expretion. A Pickle should look like this.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    }();
    PICKLE(pickle_name2) {
    // test contents.
    }();
}

To make the pickle functions not throw a error you must add a ASSERT(message, passed). The assert will reporte to the pickle jar to tell the pickle jar to see if the pickle was droped or was pickled. (Faled or Successed). Here is how to use the ASSERT(message, passed).

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    ASSERT("This is a test that will faile", false)
    }();
    PICKLE(pickle_name2) {
    // test contents.
    ASSERT("This is a test that will successed", true)
    }();
}

There are two objects that will make the assert a little easier to use. There is SAME(value1,value2) and DIFFERENT(value1,value2) that will test to see if the objects are the same or they are different.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    ASSERT("This is a test that will successed", DIFFERENT(1,2))
    }();
    PICKLE(pickle_name2) {
    // test contents.
    ASSERT("This is a test that will successed", SAME(2,2))
    }();
}

Now we need to add pickles to the pickle jar. To add pickles to the pickle jar use ADDPICKLETOJAR(jar,pickle) to add a pickle to a pickle jar.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    ASSERT("This is a test that will successed", DIFFERENT(1,2))
    }();
    PICKLE(pickle_name2) {
    // test contents.
    ASSERT("This is a test that will successed", SAME(2,2))
    }();
    
    // Adding pickls to pickle jar
    ADDPICKLETOJAR(jar_name, pickle_name);
    ADDPICKLETOJAR(jar_name, pickle_name2);
}

The pickles have now been added to the pickle jar, but now we need to add the pickle jar to the pickle shelf. To do this just simply add ADDJARTOSHELF(jar). This macro will add the pickle jar to the shelf.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    ASSERT("This is a test that will successed", DIFFERENT(1,2))
    }();
    PICKLE(pickle_name2) {
    // test contents.
    ASSERT("This is a test that will successed", SAME(2,2))
    }();
    
    // Adding pickls to pickle jar
    ADDPICKLETOJAR(jar_name, pickle_name);
    ADDPICKLETOJAR(jar_name, pickle_name2);

    // Adding pickle jar to pickle shelf.
    ADDJARTOSHELF(jar_name);
}

Now The last step to use Pickler. For the return of main just return PICKLESHELF. Thats it.

#include "Pickler.h"

int main() {
    // init the shelf
    CREATESHELF();

    // Creating Pickle Jar
    CREATEJAR(jar_name);

    // Creating a pickle
    PICKLE(pickle_name) {
    // test contents.
    ASSERT("This is a test that will successed", DIFFERENT(1,2))
    }();
    PICKLE(pickle_name2) {
    // test contents.
    ASSERT("This is a test that will successed", SAME(2,2))
    }();
    
    // Adding pickls to pickle jar
    ADDPICKLETOJAR(jar_name, pickle_name);
    ADDPICKLETOJAR(jar_name, pickle_name2);

    // Adding pickle jar to pickle shelf.
    ADDJARTOSHELF(jar_name);

    return PICKLESHELF;
}

Now you are a master of pickling software. Use these skills as a Pickler master wizly because now you hold a great power of pickling software.

Description
No description provided
Readme 45 KiB
Languages
C++ 61.8%
C 26.7%
CMake 11.5%