]> git.ozlabs.org Git - petitboot/commitdiff
test: Rename test/list to test/lib
authorGeoff Levand <geoff@infradead.org>
Sun, 28 Apr 2013 18:21:50 +0000 (11:21 -0700)
committerGeoff Levand <geoff@infradead.org>
Sun, 28 Apr 2013 18:21:50 +0000 (11:21 -0700)
Having a test/list directory is a little too specific, so rename
the test/list directory to test/lib as a place for any lib tests.

Signed-off-by: Geoff Levand <geoff@infradead.org>
configure.ac.in
test/Makefile.am
test/lib/Makefile.am [new file with mode: 0644]
test/lib/list-test.c [new file with mode: 0644]
test/list/Makefile.am [deleted file]
test/list/list-test.c [deleted file]

index 53f42baa159fdd4705d6c1f177dd7376df5856da..1b66244e98bbac222f827499cfb8772ebf63a8e2 100644 (file)
@@ -213,7 +213,7 @@ AC_CONFIG_FILES([
        lib/Makefile
        man/Makefile
        test/Makefile
-       test/list/Makefile
+       test/lib/Makefile
        test/parser/Makefile
        test/urls/Makefile
        ui/Makefile
index a32f79f5396e42e131251854fadae695d92d2847..f2f41761b58c40ceddfe0161e72d36930ee2cb1b 100644 (file)
@@ -12,7 +12,7 @@
 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 
-SUBDIRS = list parser urls
+SUBDIRS = lib parser urls
 
 noinst_SCRIPTS = hotplug-device.sh
 
diff --git a/test/lib/Makefile.am b/test/lib/Makefile.am
new file mode 100644 (file)
index 0000000..56fea5e
--- /dev/null
@@ -0,0 +1,30 @@
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; version 2 of the License.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+AUTOMAKE_OPTIONS = parallel-tests
+
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/lib \
+       -I$(includedir) \
+       $(DEFAULT_CPPFLAGS)
+
+AM_CFLAGS = \
+       $(DEFAULT_CFLAGS)
+
+list_test_SOURCES = list-test.c
+list_test_LDADD = ../../lib/libpbcore.la
+
+noinst_PROGRAMS = list-test
+
+MAINTAINERCLEANFILES = Makefile.in
diff --git a/test/lib/list-test.c b/test/lib/list-test.c
new file mode 100644 (file)
index 0000000..b4ef7ab
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ *  Copyright Geoff Levand <geoff@infradead.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <list/list.h>
+
+
+int main(void)
+{
+       struct item {
+               struct list_item list;
+               int value;
+       };
+       STATIC_LIST(tester);
+       struct item *item;
+       struct item *tmp;
+       int i;
+
+       for (i = 0; i < 5; i++) {
+               struct item *item = malloc(sizeof(struct item));
+
+               item->value = i;
+
+               list_add_tail(&tester, &item->list);
+       }
+       
+       i = 0;
+       fprintf(stderr, "-- list_for_each_entry --\n");
+       list_for_each_entry(&tester, item, list) {
+               fprintf(stderr, "%d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
+       }
+       
+       i = 0;
+       fprintf(stderr, "-- list_for_each_entry_safe --\n");
+       list_for_each_entry_safe(&tester, item, tmp, list) {
+               fprintf(stderr, "pos: %d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
+               fprintf(stderr, "tmp:       %p -> %p\n", tmp, (tmp ? tmp->list.next : NULL));
+               list_remove(&item->list);
+       }
+
+       i = 0;
+       fprintf(stderr, "-- list_for_each_entry --\n");
+       list_for_each_entry(&tester, item, list) {
+               fprintf(stderr, "%d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
+       }
+
+       fprintf(stderr, "-- done --\n");
+       return -1;
+}
diff --git a/test/list/Makefile.am b/test/list/Makefile.am
deleted file mode 100644 (file)
index 56fea5e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; version 2 of the License.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-AUTOMAKE_OPTIONS = parallel-tests
-
-AM_CPPFLAGS = \
-       -I$(top_srcdir) \
-       -I$(top_srcdir)/lib \
-       -I$(includedir) \
-       $(DEFAULT_CPPFLAGS)
-
-AM_CFLAGS = \
-       $(DEFAULT_CFLAGS)
-
-list_test_SOURCES = list-test.c
-list_test_LDADD = ../../lib/libpbcore.la
-
-noinst_PROGRAMS = list-test
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/test/list/list-test.c b/test/list/list-test.c
deleted file mode 100644 (file)
index b4ef7ab..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *  Copyright Geoff Levand <geoff@infradead.org>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; version 2 of the License.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#if defined(HAVE_CONFIG_H)
-#include "config.h"
-#endif
-
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <list/list.h>
-
-
-int main(void)
-{
-       struct item {
-               struct list_item list;
-               int value;
-       };
-       STATIC_LIST(tester);
-       struct item *item;
-       struct item *tmp;
-       int i;
-
-       for (i = 0; i < 5; i++) {
-               struct item *item = malloc(sizeof(struct item));
-
-               item->value = i;
-
-               list_add_tail(&tester, &item->list);
-       }
-       
-       i = 0;
-       fprintf(stderr, "-- list_for_each_entry --\n");
-       list_for_each_entry(&tester, item, list) {
-               fprintf(stderr, "%d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
-       }
-       
-       i = 0;
-       fprintf(stderr, "-- list_for_each_entry_safe --\n");
-       list_for_each_entry_safe(&tester, item, tmp, list) {
-               fprintf(stderr, "pos: %d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
-               fprintf(stderr, "tmp:       %p -> %p\n", tmp, (tmp ? tmp->list.next : NULL));
-               list_remove(&item->list);
-       }
-
-       i = 0;
-       fprintf(stderr, "-- list_for_each_entry --\n");
-       list_for_each_entry(&tester, item, list) {
-               fprintf(stderr, "%d: %d: %p -> %p\n", i++, item->value, item, item->list.next);
-       }
-
-       fprintf(stderr, "-- done --\n");
-       return -1;
-}