Pickler MVP is complete. Testing For Pickler is done. changed gitignore

This commit is contained in:
2025-01-24 10:59:05 -08:00
parent 5cd483c356
commit d22837fcb0
7 changed files with 212 additions and 12 deletions

View File

@@ -1,22 +1,74 @@
#ifndef Pickler_H
#define Pickler_H
#define PICKLER_CPP
struct pickle_obj{
struct pickle{
const char* name;
const char* message;
bool passed;
};
#ifdef PICKLER_CPP
struct pickle_jar {
struct pickle_obj functions[10];
const char* name;
pickle* functions;
int functionCount;
bool passed;
} ;
#endif
///
struct pickle_shelf {
struct pickle_jar* pickle_jars;
int pickle_jarCount = 0;
bool passed;
};
struct pickle_jar __pickle_add_jar(pickle_jar*, pickle, const char*);
struct pickle_shelf __pickle_jar_add_to_shelf(pickle_shelf*, pickle_jar);
int __pickle_shelf_run(pickle_shelf*);
#define PICKLE(x) struct pickle_obj x = [](struct pickle_jar&)
#define ADDPICKLE(x)
#define ADDJARTOSHLEF(x)
/// -----Operation functions-----
/// These operation functions alow quick
/// and easy comparesons.
/// So that the user can make tests fast.
/// Tests should be easy and to create and
/// simpile to create. More functions will
/// be on the way but right now we have the
/// following.
///
/// - DIFFERENT(value1, value2): this allows the
/// user to check if the value is differrent in
/// any way. (value1 != value2)
///
/// - SAME(value1, value2): this allows the user
/// to check if both values are the same.
/// (value1 == value2)
///
/// - ASSERT(message, value): allows for a custome
/// message to be displayed when testing. The value
/// is/needs to be a boolean.
#define DIFFERENT(value1, value2) (value1 != value2)
#define SAME(value1, value2) (value1 == value2)
#define ASSERT(message, value) return {"name",message, value }
/// ------Using Pickle------
/// When using pickle there are some
/// helper deffinitions to create your
/// testing envirment.
/// - First, Use _INSTALLSHELF_ to
/// install the pickle shelf.
/// - Second, we need to create pickle
/// jars so that we can put pickles in
/// those jars. To create a pickle jar
/// run _CREATEJAR_ to create a pickle
/// jar.
/// -Third, We can now start canning!
/// First we need to create Pickls.
/// To create a pickle we need to run
/// _PICKLE_ pickle takes a name.
///
#define INSTALLSHELF struct pickle_shelf __pickle_shelf__ = { 0, 0 };
#define CREATEJAR(jar_name) struct pickle_jar jar_name = {#jar_name, 0, 0, true};
#define PICKLE(name) struct pickle name = []() -> pickle
#define ADDPICKLE(jar,pickle) __pickle_add_jar(&jar, pickle, #pickle)
#define PUTJARONSHLEF(jar) __pickle_jar_add_to_shelf(&__pickle_shelf__,jar);
#endif