diff options
author | Simon Busch <morphis@gravedo.de> | 2012-07-25 17:06:23 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2012-07-25 19:53:23 +0200 |
commit | cfc6b28b5707da3a63697a54435595f31f371569 (patch) | |
tree | 8f220f07df9fb579774df71dda2d2670cddaddb0 | |
parent | 3955006c73246c84392a4093bb744546f4afedec (diff) | |
download | cornucopia-cfc6b28b5707da3a63697a54435595f31f371569.tar.gz cornucopia-cfc6b28b5707da3a63697a54435595f31f371569.tar.bz2 cornucopia-cfc6b28b5707da3a63697a54435595f31f371569.zip |
libfsoframework: integrate tests from libfsosystem
-rw-r--r-- | libfsoframework/configure.ac | 1 | ||||
-rw-r--r-- | libfsoframework/tests/Makefile.am | 1 | ||||
-rw-r--r-- | libfsoframework/tests/fsosystem/Makefile.am | 47 | ||||
-rw-r--r-- | libfsoframework/tests/fsosystem/testpath.vala | 51 |
4 files changed, 100 insertions, 0 deletions
diff --git a/libfsoframework/configure.ac b/libfsoframework/configure.ac index e546822b..79eac42e 100644 --- a/libfsoframework/configure.ac +++ b/libfsoframework/configure.ac @@ -134,6 +134,7 @@ AC_CONFIG_FILES([ fsoframework/fsoframework-2.0.pc fsoframework/Makefile tests/Makefile + tests/fsosystem/Makefile tests/fsoframework/Makefile]) AC_OUTPUT diff --git a/libfsoframework/tests/Makefile.am b/libfsoframework/tests/Makefile.am index 95b044ef..a6bf66f3 100644 --- a/libfsoframework/tests/Makefile.am +++ b/libfsoframework/tests/Makefile.am @@ -2,6 +2,7 @@ include $(top_srcdir)/Makefile.decl NULL = SUBDIRS = \ + fsosystem \ fsoframework \ $(NULL) diff --git a/libfsoframework/tests/fsosystem/Makefile.am b/libfsoframework/tests/fsosystem/Makefile.am new file mode 100644 index 00000000..817d1928 --- /dev/null +++ b/libfsoframework/tests/fsosystem/Makefile.am @@ -0,0 +1,47 @@ +include $(top_srcdir)/Makefile.decl + +NULL = + +AM_CFLAGS = \ + $(GLIB_CFLAGS) \ + -I$(top_srcdir)/fsosystem \ + -include $(CONFIG_HEADER) + $(NULL) + +LDADD = \ + $(top_builddir)/fsosystem/libfsosystem.la \ + $(GLIB_LIBS) \ + $(NULL) + +AM_VALAFLAGS = \ + --basedir $(top_srcdir) \ + --vapidir $(top_srcdir)/fsosystem \ + --pkg posix \ + --pkg glib-2.0 \ + --pkg gio-2.0 \ + --pkg gee-1.0 \ + --pkg fsosystem-2.0 + $(NULL) + +noinst_PROGRAMS = \ + testpath \ + $(NULL) + +TEST_PROGS += $(noinst_PROGRAMS) + +testpath_SOURCES = \ + testpath.vala \ + $(NULL) + +CLEANFILES = \ + $(TEST_PROGS) \ + $(NULL) + +MAINTAINERCLEANFILES = \ + $(addsuffix .c,$(noinst_PROGRAMS)) \ + testpath_vala.stamp \ + $(NULL) + +EXTRA_DIST += \ + $(MAINTAINERCLEANFILES) \ + $(NULL) diff --git a/libfsoframework/tests/fsosystem/testpath.vala b/libfsoframework/tests/fsosystem/testpath.vala new file mode 100644 index 00000000..c2ba0eb7 --- /dev/null +++ b/libfsoframework/tests/fsosystem/testpath.vala @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2011-2012 Michael 'Mickey' Lauer <mlauer@vanille-media.de> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +using GLib; + +//=========================================================================== +void test_path_is_mount_point() +{ + var path = new FsoFramework.FileSystem.Path( "/sys" ); + assert( path.is_mount_point() == true ); +} + +//=========================================================================== +void test_path_is_absolute() +{ + var path = new FsoFramework.FileSystem.Path( "/is/absolut/path" ); + assert( path.is_absolute() == true ); + + path = new FsoFramework.FileSystem.Path( "is/relative/path" ); + assert( path.is_absolute() == false ); +} + +//=========================================================================== +void main( string[] args ) +//=========================================================================== +{ + Test.init( ref args ); + + Test.add_func( "/FileSystem/Path/IsMountpoint", test_path_is_mount_point ); + Test.add_func( "/FileSystem/Path/IsAbsolute", test_path_is_absolute ); + + Test.run(); +} + +// vim:ts=4:sw=4:expandtab |