socsvn commit: r257111 - in soc2013/mattbw: . backend backend/query

mattbw at FreeBSD.org mattbw at FreeBSD.org
Sun Sep 8 10:57:27 UTC 2013


Author: mattbw
Date: Sun Sep  8 10:57:27 2013
New Revision: 257111
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257111

Log:
  Add job test to Makefile; update README.
  
  Also did a tiny bit of indent.
  

Modified:
  soc2013/mattbw/README
  soc2013/mattbw/backend/Makefile
  soc2013/mattbw/backend/query/check.c

Modified: soc2013/mattbw/README
==============================================================================
--- soc2013/mattbw/README	Sun Sep  8 09:46:22 2013	(r257110)
+++ soc2013/mattbw/README	Sun Sep  8 10:57:27 2013	(r257111)
@@ -35,6 +35,7 @@
     this involves clang33 being installed.)
   - Run `make install` as root to install the backend into PackageKit's backends
     directory.
+  - If you have ATF/kyua installed, run `make tests` to create the tests.
   - Edit /usr/local/PackageKit/PackageKit.conf such that "DefaultBackend=pkgng"
     (or manually invoke packagekitd with backend=pkgng).
 
@@ -45,24 +46,28 @@
 
 TESTING
 
-Currently, testing facilities are very limited.  Testing will likely occur in
-full after the basic featureset has been roughly implemented.
-
-There is currently one test, in the tests/get-details-output directory; this
-checks the GetDetails output from pkcon against a mockup built from `pkg query`
-to make sure it outputs sane data.  At the time of writing, it is not finished,
-but to run it cd to that directory, run `make`, ensure `pkcon` is set up to use
-pkgng as its backend, then run `./test.sh`.
+The backend has ATF unit tests.  To run these:
+  - Install ATF or kyua (should be in FreeBSD ports);
+  - Run `make tests` in the backend directory;
+  - Run `atf-run | atf-report` in the backend, backend/query and backend/jobs
+    directories.
+
+There are also some functional tests, in the form of shell scripts, scattered
+in the tests/ directory.  Generally these will require you to use the test
+repo (at timeof writing, http://www-student.cs.york.ac.uk/~mbw500/testrepo/).
+Make sure PackageKit is using pkgng as its backend.
 
 --------------------------------------------------------------------------------
 
 KNOWN BUGS
 
-- InstallPackages is not yet fully implemented.
 - Behaviour when a repository has multiple versions of a package is currently
   ill-defined (the first one in the iterator will be emitted).  This requires
   further work. 
 - Minor cosmetic issues (progress bars not updating properly, etc.) may exist.
+- Some options to actions (recursion in GetDetails, repo signing requirements,
+  etc) are not yet implemented.
+- Cancel is not implemented.
 
 --------------------------------------------------------------------------------
 

Modified: soc2013/mattbw/backend/Makefile
==============================================================================
--- soc2013/mattbw/backend/Makefile	Sun Sep  8 09:46:22 2013	(r257110)
+++ soc2013/mattbw/backend/Makefile	Sun Sep  8 10:57:27 2013	(r257111)
@@ -75,6 +75,7 @@
 		namever_test			\
 		pkgutils_test			\
 		repo_test			\
+		jobs/check_test			\
 		query/id_test			\
 		query/check_test		\
 
@@ -103,6 +104,12 @@
 tests: ${TESTPROGS}
 
 # TODO: Find a more BSD way of doing this
+jobs/check_test: jobs/check_test.o jobs/check.o namever.o testutils.o query/check.o query/id.o pkgutils.o repo.o
+	${CC} ${LDFLAGS} ${TESTLDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LIBS} ${TESTLIBS}
+
+jobs/check_test.o: jobs/check_test.c
+	${CC} ${CFLAGS} ${TESTCFLAGS} -o ${.TARGET} -c ${.ALLSRC}
+
 query/id_test: query/id_test.o query/id.o namever.o testutils.o
 	${CC} ${LDFLAGS} ${TESTLDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LIBS} ${TESTLIBS}
 

Modified: soc2013/mattbw/backend/query/check.c
==============================================================================
--- soc2013/mattbw/backend/query/check.c	Sun Sep  8 09:46:22 2013	(r257110)
+++ soc2013/mattbw/backend/query/check.c	Sun Sep  8 10:57:27 2013	(r257111)
@@ -34,14 +34,14 @@
 
 /* Attempts to match a set of QueryIDs into packages. */
 
-static bool string_match(const char *left, const char *right);
+static bool	string_match(const char *left, const char *right);
 
 /* Returns true if the given package matches the given query ID. */
 bool
 query_check_package(struct pkg *package, struct query_id *query_id)
 {
 	bool		matches;
-	char	       *namever;
+	char           *namever;
 	const char     *arch;
 	const char     *name;
 	const char     *repo;
@@ -66,8 +66,8 @@
 
 		/*
 		 * Allow raw names to match the Query ID namever, as well as
-		 * the full package namevers.
-		 * This allows Resolve to work properly.
+		 * the full package namevers. This allows Resolve to work
+		 * properly.
 		 */
 		namever_matches_name = string_match(query_id->namever, name);
 		namever_matches_namever = string_match(query_id->namever,


More information about the svn-soc-all mailing list