annotate tests/test-jsapi-irccd.c @ 1069:827431b41132

misc: remove usage of BSD sys/queue.h (plugin)
author David Demelier <markand@malikania.fr>
date Mon, 12 Jul 2021 21:11:53 +0200
parents 8f8ce47aba8a
children f06e9761cc90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 /*
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 * test-jsapi-irccd.c -- test Irccd API
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 *
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 * Copyright (c) 2013-2021 David Demelier <markand@malikania.fr>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 *
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 * Permission to use, copy, modify, and/or distribute this software for any
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 * purpose with or without fee is hereby granted, provided that the above
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 * copyright notice and this permission notice appear in all copies.
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 *
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 */
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
19 #include <errno.h>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
20
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 #define GREATEST_USE_ABBREVS 0
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 #include <greatest.h>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
23
1037
8f8ce47aba8a make: switch to GNU make
David Demelier <markand@malikania.fr>
parents: 1003
diff changeset
24 #include <irccd/config.h>
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 #include <irccd/js-plugin.h>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 #include <irccd/jsapi-system.h>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 #include <irccd/plugin.h>
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
28
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 static struct irc_plugin *plugin;
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
30 static duk_context *ctx;
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
31
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 static void
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 setup(void *udata)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 (void)udata;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
36
1037
8f8ce47aba8a make: switch to GNU make
David Demelier <markand@malikania.fr>
parents: 1003
diff changeset
37 plugin = js_plugin_open("example", TOP "/tests/data/example-plugin.js");
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
38 ctx = js_plugin_get_context(plugin);
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
40
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 static void
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 teardown(void *udata)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 (void)udata;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
45
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 irc_plugin_finish(plugin);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
47
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 plugin = NULL;
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
49 ctx = NULL;
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
51
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 static int
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 throw(duk_context *ctx)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 errno = EINVAL;
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
56 jsapi_system_raise(ctx);
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
57
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 return 0;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
60
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 GREATEST_TEST
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 basics_version(void)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 {
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
64 const int ret = duk_peval_string(ctx,
1003
bbb3d3075ec2 tests: fix all
David Demelier <markand@malikania.fr>
parents: 985
diff changeset
65 "major = Irccd.Version.Major;"
bbb3d3075ec2 tests: fix all
David Demelier <markand@malikania.fr>
parents: 985
diff changeset
66 "minor = Irccd.Version.Minor;"
bbb3d3075ec2 tests: fix all
David Demelier <markand@malikania.fr>
parents: 985
diff changeset
67 "patch = Irccd.Version.Match;"
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
68 );
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
69
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
70 if (ret != 0)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
71 GREATEST_FAIL();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
72
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
73 GREATEST_ASSERT(duk_get_global_string(ctx, "major"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
74 GREATEST_ASSERT_EQ(IRCCD_VERSION_MAJOR, duk_get_int(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
75 GREATEST_ASSERT(duk_get_global_string(ctx, "minor"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
76 GREATEST_ASSERT_EQ(IRCCD_VERSION_MINOR, duk_get_int(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
77 GREATEST_ASSERT(duk_get_global_string(ctx, "patch"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
78 GREATEST_ASSERT_EQ(IRCCD_VERSION_PATCH, duk_get_int(ctx, -1));
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
79
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
80 GREATEST_PASS();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
81 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
82
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
83 GREATEST_TEST
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
84 basics_system_error_from_js(void)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
85 {
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
86 const int ret = duk_peval_string(ctx,
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
87 "try {"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
88 " throw new Irccd.SystemError(1, 'test');"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
89 "} catch (e) {"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
90 " errno = e.errno;"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
91 " name = e.name;"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
92 " message = e.message;"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
93 " v1 = (e instanceof Error);"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
94 " v2 = (e instanceof Irccd.SystemError);"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
95 "}"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
96 );
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
97
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
98 if (ret != 0)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
99 GREATEST_FAIL();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
100
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
101 GREATEST_ASSERT(duk_get_global_string(ctx, "errno"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
102 GREATEST_ASSERT_EQ(1, duk_get_int(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
103 GREATEST_ASSERT(duk_get_global_string(ctx, "name"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
104 GREATEST_ASSERT_STR_EQ("SystemError", duk_get_string(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
105 GREATEST_ASSERT(duk_get_global_string(ctx, "message"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
106 GREATEST_ASSERT_STR_EQ("test", duk_get_string(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
107 GREATEST_ASSERT(duk_get_global_string(ctx, "v1"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
108 GREATEST_ASSERT(duk_get_boolean(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
109 GREATEST_ASSERT(duk_get_global_string(ctx, "v2"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
110 GREATEST_ASSERT(duk_get_boolean(ctx, -1));
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
111
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
112 GREATEST_PASS();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
113 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
114
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
115 GREATEST_TEST
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
116 basics_system_error_from_c(void)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
117 {
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
118 duk_push_c_function(ctx, throw, 0);
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
119 duk_put_global_string(ctx, "f");
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
120
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
121 const int ret = duk_peval_string(ctx,
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
122 "try {"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
123 " f();"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
124 "} catch (e) {"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
125 " errno = e.errno;"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
126 " name = e.name;"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
127 " v1 = (e instanceof Error);"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
128 " v2 = (e instanceof Irccd.SystemError);"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
129 "}"
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
130 );
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
131
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
132 if (ret != 0)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
133 GREATEST_FAIL();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
134
965
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
135 GREATEST_ASSERT(duk_get_global_string(ctx, "errno"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
136 GREATEST_ASSERT_EQ(EINVAL, duk_get_int(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
137 GREATEST_ASSERT(duk_get_global_string(ctx, "name"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
138 GREATEST_ASSERT_STR_EQ("SystemError", duk_get_string(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
139 GREATEST_ASSERT(duk_get_global_string(ctx, "v1"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
140 GREATEST_ASSERT(duk_get_boolean(ctx, -1));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
141 GREATEST_ASSERT(duk_get_global_string(ctx, "v2"));
a518664b20a0 irccd: move javascript API from library to frontend
David Demelier <markand@malikania.fr>
parents: 963
diff changeset
142 GREATEST_ASSERT(duk_get_boolean(ctx, -1));
963
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
143
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
144 GREATEST_PASS();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
145 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
146
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
147 GREATEST_SUITE(suite_basics)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
148 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
149 GREATEST_SET_SETUP_CB(setup, NULL);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
150 GREATEST_SET_TEARDOWN_CB(teardown, NULL);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
151 GREATEST_RUN_TEST(basics_version);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
152 GREATEST_RUN_TEST(basics_system_error_from_js);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
153 GREATEST_RUN_TEST(basics_system_error_from_c);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
154 }
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
155
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
156 GREATEST_MAIN_DEFS();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
157
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
158 int
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
159 main(int argc, char **argv)
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
160 {
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
161 GREATEST_MAIN_BEGIN();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
162 GREATEST_RUN_SUITE(suite_basics);
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
163 GREATEST_MAIN_END();
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
164
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
165 return 0;
371e1cc2c697 tests: add 80% of the Javascript API
David Demelier <markand@malikania.fr>
parents:
diff changeset
166 }