[Pkg-owncloud-commits] [owncloud-doc] 29/49: Added info about running unit tests with autotest.sh

David Prévot taffit at moszumanska.debian.org
Fri Jan 17 02:41:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud-doc.

commit 63b748cbaa4b0236115da9e4476244cb1a44bf2e
Author: Vincent Petry <PVince81 at yahoo.fr>
Date:   Thu Jan 9 12:35:29 2014 +0100

    Added info about running unit tests with autotest.sh
    
    - Fixes #3
    - Added minimum phpunit version
    - Added info about autotest.sh for the core app
---
 developer_manual/core/index.rst        | 15 ++++++++++++---
 developer_manual/core/unit-testing.rst | 26 +++++++++++++++++++++-----
 developer_manual/devenv/index.rst      |  4 ++--
 3 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/developer_manual/core/index.rst b/developer_manual/core/index.rst
index 09ac93a..a44efd4 100644
--- a/developer_manual/core/index.rst
+++ b/developer_manual/core/index.rst
@@ -3,17 +3,26 @@
 =================
 Core Developement
 =================
+
 .. toctree::
-   :hidden:
    :maxdepth: 1
+   :hidden:
 
-   configfile
    translation
-   theming
    unit-testing
+   theming
+   configfile
    ocs-share-api
 
+Intro
+-----
+
+Please make sure you have set up a development environment:
+
+* :ref:`devenv`
+
 Core related docs
+-----------------
 
 * :doc:`translation`
 * :doc:`unit-testing`
diff --git a/developer_manual/core/unit-testing.rst b/developer_manual/core/unit-testing.rst
index 9f9577f..29b870b 100644
--- a/developer_manual/core/unit-testing.rst
+++ b/developer_manual/core/unit-testing.rst
@@ -4,7 +4,9 @@ Unit-Testing
 Getting PHPUnit
 ---------------
 
-Owncloud uses PHPUnit for tests. To install it, either get it via your packagemanager::
+ownCloud uses PHPUnit >= 3.7 for unit testing.
+
+To install it, either get it via your packagemanager::
 
   sudo apt-get install phpunit
 
@@ -15,8 +17,8 @@ or install it via PEAR::
 
 After the installation the ''phpunit'' command is available.
 
-Writing unittests
------------------
+Writing unit tests
+------------------
 
 To get started, do the following:
  - Create a directory called ``tests`` in the top level of your application
@@ -63,9 +65,9 @@ In :file:`/srv/http/owncloud/apps/myapp/` you run the test with::
 
 For more resources on PHPUnit visit: http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html
 
-Bootstrapping Owncloud
+Bootstrapping ownCloud
 ----------------------
-If you use Owncloud functions or classes in your code, you'll need to make them available to your test by bootstrapping Owncloud.
+If you use ownCloud functions or classes in your code, you'll need to make them available to your test by bootstrapping ownCloud.
 
 To do this, you'll need to provide the ``--bootstrap`` argument when running PHPUnit
 
@@ -86,6 +88,20 @@ adjust your php.ini and file rights.
   su -c "chmod a+rx data/"
   su -c "chmod a+w data/owncloud.log"
 
+Running unit tests for the ownCloud core project
+------------------------------------------------
+The core project provides a script that runs all the core unit tests using different database backends like sqlite, mysql, oracle::
+
+  ./autotest.sh
+
+To run tests only for sqlite::
+
+  ./autotest.sh sqlite
+
+To run a specific test suite (note that the test file path is relative to the "tests" directory)::
+
+  ./autotest sqlite lib/share/share.php
+
 Further Reading
 ---------------
 - http://googletesting.blogspot.de/2008/08/by-miko-hevery-so-you-decided-to.html
diff --git a/developer_manual/devenv/index.rst b/developer_manual/devenv/index.rst
index d5e81bc..b1b5cdd 100644
--- a/developer_manual/devenv/index.rst
+++ b/developer_manual/devenv/index.rst
@@ -82,8 +82,8 @@ Open http://localhost/owncloud (or the corresponding URL) in your web browser to
 Start developing
 ~~~~~~~~~~~~~~~~
 
-* :doc:`App Development<app/index>`
-* :doc:`Core Development<core/index>`
+* :doc:`App Development<../app/index>`
+* :doc:`Core Development<../core/index>`
 
 
 .. _debugmode:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-doc.git



More information about the Pkg-owncloud-commits mailing list