fuzzing NEW refactor harness to enable LLVM LibFuzzer and more granular fuzzing

Refactor the harness to call LLVMFuzzerTestOneInput when using
AFL, and simultaneously enable standalone fuzzing with LibFuzzer,
which disables the main function of the harness, and uses
LLVMFuzzerTestOneInput directly.
diff --git a/tests/fuzz/lys_parse_mem.c b/tests/fuzz/lys_parse_mem.c
new file mode 100644
index 0000000..6ab5e0b
--- /dev/null
+++ b/tests/fuzz/lys_parse_mem.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include "libyang.h"
+
+int LLVMFuzzerTestOneInput(uint8_t const *buf, size_t len)
+{
+	struct ly_ctx *ctx = NULL;
+	static bool log = false;
+	LY_ERR err;
+
+	if (!log) {
+		ly_log_options(0);
+		log = true;
+	}
+
+	err = ly_ctx_new(NULL, 0, &ctx);
+	if (err != LY_SUCCESS) {
+		fprintf(stderr, "Failed to create context\n");
+		exit(EXIT_FAILURE);
+	}
+
+	lys_parse_mem(ctx, buf, LYS_IN_YANG);
+	ly_ctx_destroy(ctx, NULL);
+	return 0;
+}