Test application for json-c.

Squashed commit of the following:

commit 1ad29ec164b9f07781f68fbe39276428105e3d8e
Author: Thomas Mayer <thomas@residuum.org>
Date:   Fri Aug 10 20:51:42 2012 +0200

    Test for json-c actually outputs something instead of just return 0 or 1.

commit 2650c38c79a627f25c7dda9e89dd1acaca8d3663
Author: Thomas Mayer <thomas@residuum.org>
Date:   Sat Aug 4 16:46:28 2012 +0200

    Test case for json-c.
pull/65/head
Thomas Mayer 12 years ago
parent 1bced16c88
commit 5763978027

@ -0,0 +1,23 @@
/*
* This file is part of MXE.
* See index.html for further information.
*/
#include <json/json.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
json_object *jobj;
(void)argc;
(void)argv;
jobj = json_object_new_object();
if (!jobj) {
return 1;
}
json_object_object_add(jobj, "key", json_object_new_string("value"));
printf("%s", json_object_to_json_string(jobj));
return 0;
}

@ -25,4 +25,9 @@ define $(PKG)_BUILD
--disable-shared
CFLAGS=-Wno-error
$(MAKE) -C '$(1)' -j '$(JOBS)' install
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-json-c.exe' \
`'$(TARGET)-pkg-config' json --cflags --libs`
endef

Loading…
Cancel
Save