[fix rts unit tests
John Meacham <john@repetae.net>**20120217035045
 Ignore-this: 460d7eadde056908b668ea27d5a69aa5
] addfile ./rts/test/hs_fake.c
hunk ./rts/rts/gc_jgc.c 56
-
-static unsigned number_gcs;             // number of garbage collections
-static unsigned number_allocs;          // number of allocations since last garbage collection
-
hunk ./rts/rts/gc_jgc.c 61
-static struct s_arena *new_arena(void);
hunk ./rts/rts/gc_jgc.c 62
-static void print_cache(struct s_cache *sc);
hunk ./rts/rts/gc_jgc.c 143
+        debugf(" # ");
+        struct StablePtr *sp;
+        LIST_FOREACH(sp, &root_StablePtrs, link) {
+            gc_add_grey(&stack, sp);
+            debugf(" %p", root_stack.stack[i]);
+        }
+
hunk ./rts/rts/gc_jgc.c 470
-static struct s_cache *
+struct s_cache *
hunk ./rts/rts/gc_jgc.h 5
+#include "sys/queue.h"
hunk ./rts/rts/gc_jgc.h 7
+struct sptr;
hunk ./rts/rts/gc_jgc.h 22
+void print_cache(struct s_cache *sc);
+struct s_cache *new_cache(struct s_arena *arena, unsigned short size,
+                          unsigned short num_ptrs);
+struct s_arena *new_arena(void);
hunk ./rts/rts/gc_jgc.h 31
-        for(int i = 0; i < n; i++) gc[i] = (sptr_t)ptrs[i]; gc_t sgc = gc;  gc_t gc = sgc + n;
+        for(int i = 0; i < n; i++) gc[i] = (sptr_t)ptrs[i]; \
+        gc_t sgc = gc;  gc_t gc = sgc + n;
+
+struct StablePtr {
+    LIST_ENTRY(StablePtr) link;
+    struct sptr* contents;
+};
+
+extern LIST_HEAD(StablePtr_list, StablePtr) root_StablePtrs;
hunk ./rts/rts/stableptr.c 2
+#include "jhc_rts_header.h"
hunk ./rts/rts/stableptr.c 4
-struct StablePtr {
-    LIST_ENTRY(StablePtr) link;
-    sptr_t contents;
-};
-
-LIST_HEAD(, StablePtr) root_StablePtrs = LIST_HEAD_INITIALIZER();
+struct StablePtr_list root_StablePtrs = LIST_HEAD_INITIALIZER();
hunk ./rts/test/Makefile 4
-CFLAGS=-I.. -I../.. -std=gnu99 -g -O2
+CFLAGS=-I.. -I../.. -std=gnu99 -g -O2  \
+       -D_JHC_GC=_JHC_GC_JGC  -DJHC_UNIT -D_JHC_STANDALONE=0 \
+       -DJHC_VALGRIND=1
hunk ./rts/test/Makefile 8
-all: slab_test stableptr_test
+TESTS=slab_test stableptr_test
+all: $(TESTS)
hunk ./rts/test/Makefile 11
-slab_test: slab_test.c
+RTSFILES=hs_fake.c ../rts/profile.c ../rts/jhc_rts.c ../rts/gc_jgc.c \
+	 ../rts/stableptr.c ../rts/gc_none.c ../rts/rts_support.c
+
+slab_test: slab_test.c $(RTSFILES)
hunk ./rts/test/Makefile 17
-	rm -f slab_test
+	rm -f $(TESTS)
hunk ./rts/test/Makefile 23
-stableptr_test: stableptr_test.c seatest.c
+stableptr_test: stableptr_test.c seatest.c  $(RTSFILES)
hunk ./rts/test/hs_fake.c 1
+// dummy values for things the rts expects the compiled program to provide.
+
+#include "jhc_rts_header.h"
+
+char jhc_c_compile[] = "(compile)";
+char jhc_command[] = "(command)";
+char jhc_version[] = "(version)";
+
+void jhc_hs_init(void) {}
+const void * const nh_stuff[] = { NULL };
hunk ./rts/test/slab_test.c 1
-char jhc_c_compile[] = "(compile)";
-char jhc_command[] = "(command)";
-char jhc_version[] = "(version)";
-
hunk ./rts/test/slab_test.c 7
-#include "jhc_rts2.c"
hunk ./rts/test/slab_test.c 11
-static void jhc_hs_init(void) {}
-static const void * const nh_stuff[] = { NULL };
-
hunk ./rts/test/stableptr_test.c 1
-char jhc_c_compile[] = "(compile)";
-char jhc_command[] = "(command)";
-char jhc_version[] = "(version)";
-
-#define JHC_VALGRIND 1
-
-#define _JHC_STANDALONE 0
-#define _JHC_GC _JHC_GC_JGC
-
hunk ./rts/test/stableptr_test.c 2
-#include "jhc_rts2.c"
-#include "rts/stableptr.c"
+#include "sys/queue.h"
hunk ./rts/test/stableptr_test.c 6
-static void jhc_hs_init(void) {}
-static const void * const nh_stuff[] = { NULL };
-