seed r821 - in trunk: . modules/Multiprocessing modules/canvas modules/example modules/readline modules/sqlite tests/c
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r821 - in trunk: . modules/Multiprocessing modules/canvas modules/example modules/readline modules/sqlite tests/c
- Date: Thu, 29 Jan 2009 19:22:19 +0000 (UTC)
Author: hortont
Date: Thu Jan 29 19:22:19 2009
New Revision: 821
URL: http://svn.gnome.org/viewvc/seed?rev=821&view=rev
Log:
More type tests, module profiling is optional now
Modified:
trunk/Makefile.am
trunk/config.h.in
trunk/configure.ac
trunk/modules/Multiprocessing/Makefile.am
trunk/modules/canvas/Makefile.am
trunk/modules/example/Makefile.am
trunk/modules/readline/Makefile.am
trunk/modules/sqlite/Makefile.am
trunk/tests/c/api-types.c
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Thu Jan 29 19:22:19 2009
@@ -44,21 +44,29 @@
profile: profile-reset test
cp libseed/*.c libseed/.libs/
+if PROFILE_MODULES
cp modules/readline/*.c modules/readline/.libs/
cp modules/example/*.c modules/example/.libs/
cp modules/sqlite/*.c modules/sqlite/.libs/
cp modules/canvas/*.c modules/canvas/.libs/
cp modules/Multiprocessing/*.c modules/Multiprocessing/.libs/
+endif
cd libseed/.libs ; gcov *.c
+if PROFILE_MODULES
cd modules/readline/.libs ; gcov *.c
cd modules/example/.libs ; gcov *.c
cd modules/sqlite/.libs ; gcov *.c
cd modules/canvas/.libs ; gcov *.c
cd modules/Multiprocessing/.libs ; gcov *.c
-
+endif
+
profile-gui: profile
- lcov --directory libseed/.libs --directory modules/readline/.libs --directory modules/example/.libs --directory modules/sqlite/.libs --capture --output-file seed.info
+if PROFILE_MODULES
+ $mods_prof = --directory modules/readline/.libs --directory modules/example/.libs --directory modules/sqlite/.libs
+endif
+
+ lcov --directory libseed/.libs $(mods_prof) --capture --output-file seed.info
cp seed.info /tmp/
cd /tmp ; genhtml seed.info ; gnome-open index.html
Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in (original)
+++ trunk/config.h.in Thu Jan 29 19:22:19 2009
@@ -58,6 +58,9 @@
*/
#undef LT_OBJDIR
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
/* Name of package */
#undef PACKAGE
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Jan 29 19:22:19 2009
@@ -189,15 +189,26 @@
[turn on profiling [default=no]]),
[enable_profile="yes"],[enable_profile="no"])
+AC_ARG_ENABLE(profile-modules,
+ AC_HELP_STRING([--enable-profile-modules],
+ [turn on profiling for modules [default=no]]),
+ [enable_profile_modules="yes"],[enable_profile_modules="no"])
+
if test "x$enable_profile" = "xyes"; then
SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
SEED_PROFILE_LDFLAGS="-lgcov"
CFLAGS="-O0"
fi
+if test "x$enable_profile" = "xno"; then
+ [enable_profile_modules="no"]
+fi
+
AC_SUBST(SEED_PROFILE_CFLAGS)
AC_SUBST(SEED_PROFILE_LDFLAGS)
+AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
+
dnl ===========================Darwin Build====================================
SEED_OSX_CFLAGS=
SEED_OSX_LDFLAGS=
@@ -266,6 +277,7 @@
Build Configuration:
Debug......................$enable_debug
Profiling/Coverage.........$enable_profile
+ Profiling for Modules......$enable_profile_modules
gtk-doc....................$enable_gtk_doc
Installation:
Modified: trunk/modules/Multiprocessing/Makefile.am
==============================================================================
--- trunk/modules/Multiprocessing/Makefile.am (original)
+++ trunk/modules/Multiprocessing/Makefile.am Thu Jan 29 19:22:19 2009
@@ -14,9 +14,14 @@
`pkg-config --cflags seed` \
`pkg-config --cflags glib-2.0` -g \
`pkg-config --cflags gobject-introspection-1.0` \
- $(SEED_DEBUG_CFLAGS) $(SEED_PROFILE_CFLAGS)
+ $(SEED_DEBUG_CFLAGS)
-AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS)
+AM_LDFLAGS =
+
+if PROFILE_MODULES
+ AM_CPPFLAGS += $(SEED_PROFILE_CFLAGS)
+ AM_LDFLAGS += $(SEED_PROFILE_LDFLAGS)
+endif
endif
Modified: trunk/modules/canvas/Makefile.am
==============================================================================
--- trunk/modules/canvas/Makefile.am (original)
+++ trunk/modules/canvas/Makefile.am Thu Jan 29 19:22:19 2009
@@ -15,9 +15,14 @@
`pkg-config --cflags glib-2.0` -g \
`pkg-config --cflags gobject-introspection-1.0` \
`pkg-config --cflags cairo` \
- $(SEED_DEBUG_CFLAGS) $(SEED_PROFILE_CFLAGS)
+ $(SEED_DEBUG_CFLAGS)
-AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS)
+AM_LDFLAGS =
+
+if PROFILE_MODULES
+ AM_CPPFLAGS += $(SEED_PROFILE_CFLAGS)
+ AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS)
+endif
endif
Modified: trunk/modules/example/Makefile.am
==============================================================================
--- trunk/modules/example/Makefile.am (original)
+++ trunk/modules/example/Makefile.am Thu Jan 29 19:22:19 2009
@@ -14,9 +14,14 @@
`pkg-config --cflags seed` \
`pkg-config --cflags glib-2.0` -g \
`pkg-config --cflags gobject-introspection-1.0` \
- $(SEED_DEBUG_CFLAGS) $(SEED_PROFILE_CFLAGS)
+ $(SEED_DEBUG_CFLAGS)
-AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS)
+AM_LDFLAGS =
+
+if PROFILE_MODULES
+ AM_CPPFLAGS += $(SEED_PROFILE_CFLAGS)
+ AM_LDFLAGS += $(SEED_PROFILE_LDFLAGS)
+endif
endif
Modified: trunk/modules/readline/Makefile.am
==============================================================================
--- trunk/modules/readline/Makefile.am (original)
+++ trunk/modules/readline/Makefile.am Thu Jan 29 19:22:19 2009
@@ -15,9 +15,14 @@
`pkg-config --cflags glib-2.0` -g \
`pkg-config --cflags gobject-introspection-1.0` \
`pkg-config --cflags libffi` \
- $(SEED_DEBUG_CFLAGS) $(SEED_PROFILE_CFLAGS)
+ $(SEED_DEBUG_CFLAGS)
-AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS) -lreadline
+AM_LDFLAGS = -lreadline
+
+if PROFILE_MODULES
+ AM_CPPFLAGS += $(SEED_PROFILE_CFLAGS)
+ AM_LDFLAGS += $(SEED_PROFILE_LDFLAGS)
+endif
endif
Modified: trunk/modules/sqlite/Makefile.am
==============================================================================
--- trunk/modules/sqlite/Makefile.am (original)
+++ trunk/modules/sqlite/Makefile.am Thu Jan 29 19:22:19 2009
@@ -14,9 +14,14 @@
`pkg-config --cflags seed` \
`pkg-config --cflags glib-2.0` -g \
`pkg-config --cflags gobject-introspection-1.0` \
- $(SEED_DEBUG_CFLAGS) $(SEED_PROFILE_CFLAGS)
+ $(SEED_DEBUG_CFLAGS)
-AM_LDFLAGS = $(SEED_PROFILE_LDFLAGS)
+AM_LDFLAGS =
+
+if PROFILE_MODULES
+ AM_CPPFLAGS += $(SEED_PROFILE_CFLAGS)
+ AM_LDFLAGS += $(SEED_PROFILE_LDFLAGS)
+endif
endif
Modified: trunk/tests/c/api-types.c
==============================================================================
--- trunk/tests/c/api-types.c (original)
+++ trunk/tests/c/api-types.c Thu Jan 29 19:22:19 2009
@@ -1,5 +1,8 @@
#include "../../libseed/seed.h"
#include "test-common.h"
+#include <string.h>
+
+// The biggest problem here is everything gets cast to a double in JSCore!
void basic_types(TestSimpleFixture * fixture, gconstpointer _data)
{
@@ -53,6 +56,46 @@
g_assert(uchar_test_in == uchar_test_out);
+ // long to/from JS equality
+
+ glong long_test_in = -454250;
+ SeedValue * long_test = seed_value_from_long(fixture->context,
+ long_test_in, NULL);
+ glong long_test_out = seed_value_to_long(fixture->context,
+ long_test, NULL);
+
+ g_assert(long_test_in == long_test_out);
+
+ // ulong to/from JS equality
+
+ gulong ulong_test_in = 250;
+ SeedValue * ulong_test = seed_value_from_ulong(fixture->context,
+ ulong_test_in, NULL);
+ gulong ulong_test_out = seed_value_to_ulong(fixture->context,
+ ulong_test, NULL);
+
+ g_assert(ulong_test_in == ulong_test_out);
+
+ // int64 to/from JS equality
+
+ gint64 int64_test_in = -54374;
+ SeedValue * int64_test = seed_value_from_int64(fixture->context,
+ int64_test_in, NULL);
+ gint64 int64_test_out = seed_value_to_int64(fixture->context,
+ int64_test, NULL);
+
+ g_assert(int64_test_in == int64_test_out);
+
+ // uint64 to/from JS equality
+
+ guint64 uint64_test_in = 2946623;
+ SeedValue * uint64_test = seed_value_from_uint64(fixture->context,
+ uint64_test_in, NULL);
+ guint64 uint64_test_out = seed_value_to_uint64(fixture->context,
+ uint64_test, NULL);
+
+ g_assert(uint64_test_in == uint64_test_out);
+
// float to/from JS equality
gfloat float_test_in = 1.618;
@@ -63,5 +106,37 @@
g_assert(float_test_in == float_test_out);
+ // double to/from JS equality
+
+ gdouble double_test_in = 1.6134857638;
+ SeedValue * double_test = seed_value_from_double(fixture->context,
+ double_test_in, NULL);
+ gdouble double_test_out = seed_value_to_double(fixture->context,
+ double_test, NULL);
+
+ g_assert(double_test_in == double_test_out);
+
+ // string to/from JS equality
+
+ gchar * string_test_in = "Hello, world!";
+ SeedValue * string_test = seed_value_from_string(fixture->context,
+ string_test_in, NULL);
+ gchar * string_test_out = seed_value_to_string(fixture->context,
+ string_test, NULL);
+
+ g_assert(strncmp(string_test_in, string_test_out,
+ strlen(string_test_in)) == 0);
+
+ // filename to/from JS equality
+
+ gchar * filename_test_in = "/bin";
+ SeedValue * filename_test = seed_value_from_filename(fixture->context,
+ filename_test_in,
+ NULL);
+ gchar * filename_test_out = seed_value_to_filename(fixture->context,
+ filename_test, NULL);
+
+ g_assert(strncmp(filename_test_in, filename_test_out,
+ strlen(filename_test_in)) == 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]