-testprogs = thread
+testprogs = thread1 thread2 thread3 thread4 thread5
TESTS = $(testprogs)
check_PROGRAMS = $(testprogs)
-# we have nothing but apps here, we can do this safely
-thread_LDADD = $(GST_LIBS)
-thread_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+LDADD = $(GST_LIBS)
+CFLAGS = $(GST_CFLAGS)
+
+thread1_SOURCES = thread.c
+thread1_CFLAGS = -DTESTNUM=1
+thread2_SOURCES = thread.c
+thread2_CFLAGS = -DTESTNUM=2
+thread3_SOURCES = thread.c
+thread3_CFLAGS = -DTESTNUM=3
+thread4_SOURCES = thread.c
+thread4_CFLAGS = -DTESTNUM=4
+thread5_SOURCES = thread.c
+thread5_CFLAGS = -DTESTNUM=5
#include <gst/gst.h>
+/*
+ * FIXME:
+ * these tests should have a maximum run length, so that they get killed
+ * if they lock up, which they're bound to do.
+ */
+
void
usage (void)
{
- g_print ("usage: thread <testnum> \n"
- " available testnums: \n"
+ g_print ("compile this test with TESTNUM defined.\n"
+ " available TESTNUMs: \n"
" 1: stress test state change \n"
" 2: iterate once \n"
" 3: iterate twice \n"
gst_element_set_state (pipeline, GST_STATE_NULL);
}
-gint
+int
main (gint argc, gchar *argv[])
{
GstElement *pipeline;
- gint testnum;
gst_init (&argc, &argv);
- if (argc < 2) {
- usage();
- return 0;
- }
+#ifndef TESTNUM
+ usage ();
+ return -1;
+#endif
- testnum = atoi (argv[1]);
-
pipeline = gst_pipeline_new ("main_pipeline");
construct_pipeline (pipeline);
- if (testnum == 1) {
- g_print ("stress test state changes...\n");
+ if (TESTNUM == 1) {
+ g_print ("thread test 1: stress test state changes...\n");
g_print ("NULL\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 2 || testnum == 3) {
+ if (TESTNUM == 2 || TESTNUM == 3) {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_print ("running ...\n");
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 3) {
+ if (TESTNUM == 3) {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_print ("running2 ...\n");
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 4) {
+ if (TESTNUM == 4) {
gint run;
gst_element_set_state (pipeline, GST_STATE_PLAYING);
}
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 5) {
+ if (TESTNUM == 5) {
GstElement *sink;
sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
-testprogs = thread
+testprogs = thread1 thread2 thread3 thread4 thread5
TESTS = $(testprogs)
check_PROGRAMS = $(testprogs)
-# we have nothing but apps here, we can do this safely
-thread_LDADD = $(GST_LIBS)
-thread_CFLAGS = $(GST_CFLAGS) $(GNOME_CFLAGS) $(XML_CFLAGS)
+LDADD = $(GST_LIBS)
+CFLAGS = $(GST_CFLAGS)
+
+thread1_SOURCES = thread.c
+thread1_CFLAGS = -DTESTNUM=1
+thread2_SOURCES = thread.c
+thread2_CFLAGS = -DTESTNUM=2
+thread3_SOURCES = thread.c
+thread3_CFLAGS = -DTESTNUM=3
+thread4_SOURCES = thread.c
+thread4_CFLAGS = -DTESTNUM=4
+thread5_SOURCES = thread.c
+thread5_CFLAGS = -DTESTNUM=5
#include <gst/gst.h>
+/*
+ * FIXME:
+ * these tests should have a maximum run length, so that they get killed
+ * if they lock up, which they're bound to do.
+ */
+
void
usage (void)
{
- g_print ("usage: thread <testnum> \n"
- " available testnums: \n"
+ g_print ("compile this test with TESTNUM defined.\n"
+ " available TESTNUMs: \n"
" 1: stress test state change \n"
" 2: iterate once \n"
" 3: iterate twice \n"
gst_element_set_state (pipeline, GST_STATE_NULL);
}
-gint
+int
main (gint argc, gchar *argv[])
{
GstElement *pipeline;
- gint testnum;
gst_init (&argc, &argv);
- if (argc < 2) {
- usage();
- return 0;
- }
+#ifndef TESTNUM
+ usage ();
+ return -1;
+#endif
- testnum = atoi (argv[1]);
-
pipeline = gst_pipeline_new ("main_pipeline");
construct_pipeline (pipeline);
- if (testnum == 1) {
- g_print ("stress test state changes...\n");
+ if (TESTNUM == 1) {
+ g_print ("thread test 1: stress test state changes...\n");
g_print ("NULL\n");
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 2 || testnum == 3) {
+ if (TESTNUM == 2 || TESTNUM == 3) {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_print ("running ...\n");
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 3) {
+ if (TESTNUM == 3) {
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_print ("running2 ...\n");
while (gst_bin_iterate (GST_BIN (pipeline)));
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 4) {
+ if (TESTNUM == 4) {
gint run;
gst_element_set_state (pipeline, GST_STATE_PLAYING);
}
gst_element_set_state (pipeline, GST_STATE_NULL);
}
- if (testnum == 5) {
+ if (TESTNUM == 5) {
GstElement *sink;
sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");