#! /bin/bash
# -*- coding: utf-8 -*-
# Regression tests on travis emulator
#
READLINK=$(which greadlink 2>/dev/null) || READLINK=$(which readlink 2>/dev/null)
export READLINK
# Based on template 2.0.0
THIS=$(basename "$0")
TDIR=$(readlink -f $(dirname $0))
[ $BASH_VERSINFO -lt 4 ] && echo "This script $0 requires bash 4.0+!" && exit 4
if [[ -z $HOME_DEVEL || ! -d $HOME_DEVEL ]]; then
  [[ -d $HOME/odoo/devel ]] && HOME_DEVEL="$HOME/odoo/devel" || HOME_DEVEL="$HOME/devel"
fi
[[ -x $TDIR/../bin/python3 ]] && PYTHON=$(readlink -f $TDIR/../bin/python3) || [[ -x $TDIR/python3 ]] && PYTHON="$TDIR/python3" || PYTHON=$(which python3 2>/dev/null) || PYTHON="python"
[[ -z $PYPATH ]] && PYPATH=$(echo -e "import os,sys\no=os.path\na=o.abspath\nj=o.join\nd=o.dirname\nb=o.basename\nf=o.isfile\np=o.isdir\nC=a('"$TDIR"')\nD='"$HOME_DEVEL"'\nif not p(D) and '/devel/' in C:\n D=C\n while b(D)!='devel':  D=d(D)\nN='venv_tools'\nU='setup.py'\nO='tools'\nH=o.expanduser('~')\nT=j(d(D),O)\nR=j(d(D),'pypi') if b(D)==N else j(D,'pypi')\nW=D if b(D)==N else j(D,'venv')\nS='site-packages'\nX='scripts'\ndef pt(P):\n P=a(P)\n if b(P) in (X,'tests','travis','_travis'):\n  P=d(P)\n if b(P)==b(d(P)) and f(j(P,'..',U)):\n  P=d(d(P))\n elif b(d(C))==O and f(j(P,U)):\n  P=d(P)\n return P\ndef ik(P):\n return P.startswith((H,D,K,W)) and p(P) and p(j(P,X)) and f(j(P,'__init__.py')) and f(j(P,'__main__.py'))\ndef ak(L,P):\n if P not in L:\n  L.append(P)\nL=[C]\nK=pt(C)\nfor B in ('z0lib','zerobug','odoo_score','clodoo','travis_emulator'):\n for P in [C]+sys.path+os.environ['PATH'].split(':')+[W,R,T]:\n  P=pt(P)\n  if B==b(P) and ik(P):\n   ak(L,P)\n   break\n  elif ik(j(P,B,B)):\n   ak(L,j(P,B,B))\n   break\n  elif ik(j(P,B)):\n   ak(L,j(P,B))\n   break\n  elif ik(j(P,S,B)):\n   ak(L,j(P,S,B))\n   break\nak(L,os.getcwd())\nprint(' '.join(L))\n"|$PYTHON)
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "PYPATH=$PYPATH"
for d in $PYPATH /etc; do
  if [[ -e $d/z0librc ]]; then
    . $d/z0librc
    Z0LIBDIR=$(readlink -e $d)
    break
  fi
done
[[ -z "$Z0LIBDIR" ]] && echo "Library file z0librc not found in <$PYPATH>!" && exit 72
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "Z0LIBDIR=$Z0LIBDIR"
TESTDIR=$(findpkg "" "$TDIR . .." "tests")
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "TESTDIR=$TESTDIR"
RUNDIR=$(readlink -e $TESTDIR/..)
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "RUNDIR=$RUNDIR"
Z0TLIBDIR=$(findpkg z0testrc "$PYPATH" "zerobug")
[[ -z "$Z0TLIBDIR" ]] && echo "Library file z0testrc not found!" && exit 72
. $Z0TLIBDIR
Z0TLIBDIR=$(dirname $Z0TLIBDIR)
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "Z0TLIBDIR=$Z0TLIBDIR"

CFG_init "ALL"
link_cfg_def
link_cfg $DIST_CONF $TCONF
[[ $TRAVIS_DEBUG_MODE -ge 8 ]] && echo "DIST_CONF=$DIST_CONF" && echo "TCONF=$TCONF"
get_pypi_param ALL
RED="\e[1;31m"
GREEN="\e[1;32m"
CLR="\e[0m"

__version__=2.0.8


__test_01() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_TMPDIR/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_TMPDIR/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
TEST_TRAVIS
===========


EOF
      cat <<EOF >$TESTRES
[![Build Status](https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0)](https://travis-ci.org/zeroincombenze/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0)
[![OCA_project](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-oca-9.svg)](https://github.com/OCA/l10n_italy/tree/9.0)
[![Tech Doc](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/dev)
[![Help](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI)
[![try it](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-try-it-9.svg)](https://erp9.zeroincombenze.it)


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS
===========


[//]: # (copyright)

----

**Odoo** is a trademark of [Odoo S.A.](https://www.odoo.com/) (formerly OpenERP, formerly TinyERP)

**OCA**, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of [SHS-AV s.r.l.](http://www.shs-av.com/)
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.

[//]: # (end copyright)



[![chat with us](https://www.shs-av.com/wp-content/chat_with_us.gif)](https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b)
EOF
      pushd $LCLTEST_TMPDIR >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 1" "$TESTOUT" "$TESTRES" "diff"
}

__test_02() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_TMPDIR/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_TMPDIR/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
|license agpl|_

TEST_TRAVIS II
==============


EOF
      cat <<EOF >$TESTRES
|build status|_
|license agpl|_
|coverage status|_
|codecov status|_
|oca project|_
|technical doc|_
|help zeroincombenze|_
|try it|_


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS II
==============


.. [//]: # (copyright)

----

**Odoo** is a trademark of  \`Odoo S.A.
<https://www.odoo.com/>\`_.
(formerly OpenERP, formerly TinyERP)

**OCA**, or the  \`Odoo Community Association
<http://odoo-community.org/>\`_.
is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of \`SHS-AV s.r.l.
<http://www.shs-av.com/>\`_.
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.


.. [//]: # (end copyright)



.. |build status| image:: https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0
.. _build status: https://travis-ci.org/zeroincombenze/l10n_italy
.. |license agpl| image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
.. _license agpl: http://www.gnu.org/licenses/agpl-3.0.html
.. |coverage status| image:: https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0
.. _coverage status: https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0
.. |codecov status| image:: https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg
.. _codecov status: https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0
.. |oca project| image::
.. _oca project:
.. |technical doc| image:: http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg
.. _technical doc: http://wiki.zeroincombenze.org/en/Odoo/9.0/dev
.. |help zeroincombenze| image:: http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg
.. _help zeroincombenze: http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI
.. |try it| image::
.. _try it:
.. image:: https://www.shs-av.com/wp-content/chat_with_us.gif
   :target: https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b
EOF
      pushd $LCLTEST_TMPDIR >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 2" "$TESTOUT" "$TESTRES" "diff"
}

__test_03() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_TMPDIR/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_TMPDIR/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
[![Build Status](https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0)](https://travis-ci.org/zeroincombenze/l10n_italy/)
TEST_TRAVIS III
===============

[//]: # (copyright)

----

Test style Copyright
[//]: # (end copyright)

[![chat with us](http://www.shs-av.com/wp-content/chat_with_us.png)](https://www.zeroincombenze.it/chi-siamo/contatti/)
EOF
      cat <<EOF >$TESTRES
[![Build Status](https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0)](https://travis-ci.org/zeroincombenze/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0)
[![OCA_project](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-oca-9.svg)](https://github.com/OCA/l10n_italy/tree/9.0)
[![Tech Doc](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/dev)
[![Help](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI)
[![try it](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-try-it-9.svg)](https://erp9.zeroincombenze.it)


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS III
===============

[//]: # (copyright)

----

**Odoo** is a trademark of [Odoo S.A.](https://www.odoo.com/) (formerly OpenERP, formerly TinyERP)

**OCA**, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of [SHS-AV s.r.l.](http://www.shs-av.com/)
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.

[//]: # (end copyright)



[![chat with us](https://www.shs-av.com/wp-content/chat_with_us.gif)](https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b)
EOF
      pushd $LCLTEST_TMPDIR >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 3" "$TESTOUT" "$TESTRES" "diff"
}

__test_04() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_TMPDIR/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_TMPDIR/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
|build status|_
|license agpl|_

TEST_TRAVIS IV
==============

.. |build status| image:: https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0
.. _build status: https://travis-ci.org/zeroincombenze/l10n_italy
.. |license agpl| image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
.. _license agpl: http://www.gnu.org/licenses/agpl-3.0.html
.. image::  http://www.shs-av.com/wp-content/chat_with_us.png
   :alt: Join the chat at https://www.zeroincombenze.it/chi-siamo/contatti/
   :target:  https://www.zeroincombenze.it/chi-siamo/contatti/
EOF
      cat <<EOF >$TESTRES
|build status|_
|license agpl|_
|coverage status|_
|codecov status|_
|oca project|_
|technical doc|_
|help zeroincombenze|_
|try it|_


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS IV
==============

.. [//]: # (copyright)

----

**Odoo** is a trademark of  \`Odoo S.A.
<https://www.odoo.com/>\`_.
(formerly OpenERP, formerly TinyERP)

**OCA**, or the  \`Odoo Community Association
<http://odoo-community.org/>\`_.
is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of \`SHS-AV s.r.l.
<http://www.shs-av.com/>\`_.
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.


.. [//]: # (end copyright)



.. |build status| image:: https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0
.. _build status: https://travis-ci.org/zeroincombenze/l10n_italy
.. |license agpl| image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
.. _license agpl: http://www.gnu.org/licenses/agpl-3.0.html
.. |coverage status| image:: https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0
.. _coverage status: https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0
.. |codecov status| image:: https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg
.. _codecov status: https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0
.. |oca project| image::
.. _oca project:
.. |technical doc| image:: http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg
.. _technical doc: http://wiki.zeroincombenze.org/en/Odoo/9.0/dev
.. |help zeroincombenze| image:: http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg
.. _help zeroincombenze: http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI
.. |try it| image::
.. _try it:
.. image:: https://www.shs-av.com/wp-content/chat_with_us.gif
   :target: https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b
EOF
      pushd $LCLTEST_TMPDIR >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 4" "$TESTOUT" "$TESTRES" "diff"
}

__test_05() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_TMPDIR/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_TMPDIR/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
[![Build Status](https://travis-ci.org/OCA/l10n_italy.svg?branch=9.0)](https://travis-ci.org/OCA/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/OCA/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/OCA/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/OCA/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n_italy/branch/9.0)
[![Tech Doc](http://www.odoo.com/button/button-docs-travis_emulator.svg)](http://www.odoo.com/documentation/travis_emulator)
[![Help](https://www.odoo.com/forum/button/button-help-travis_emulator.svg)](https://www.odoo.com/forum/travis_emulator/help)


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS V
=============

[//]: # (addons)
Invalid text
Should be deleted
[//]: # (end addons)


[![it](http://www.shs-av.com/wp-content/it_IT.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS V
=============
Differenze rispetto localizzazione ufficiale Odoo/OCA

Descrizione | Odoo Italia | OCA
--- | --- | ---
Coverage | [![codecov](https://codecov.io/gh/zeroincombenze/l10n-italy/branch/7.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n-italy/branch/7.0) | [![codecov](https://codecov.io/gh/OCA/l10n-italy/branch/7.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n-italy/branch/7.0)
Test con repository OCA e Odoo | Boh! | Boh!

[//]: # (copyright)

----

Test style Copyright
[//]: # (end copyright)

[![chat with us](http://www.shs-av.com/wp-content/chat_with_us.png)](https://www.zeroincombenze.it/chi-siamo/contatti/)
EOF
      cat <<EOF >$TESTRES
[![Build Status](https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0)](https://travis-ci.org/zeroincombenze/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0)
[![OCA_project](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-oca-9.svg)](https://github.com/OCA/l10n_italy/tree/9.0)
[![Tech Doc](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/dev)
[![Help](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI)
[![try it](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-try-it-9.svg)](https://erp9.zeroincombenze.it)


[![en](https://github.com/zeroincombenze/grymb/blob/master/flags/en_US.png)](https://www.facebook.com/groups/openerp.italia/)

TEST_TRAVIS V
=============

[//]: # (addons)

[//]: # (end addons)


[![it](https://github.com/zeroincombenze/grymb/blob/master/flags/it_IT.png)](https://www.facebook.com/groups/openerp.italia/)

TEST_TRAVIS V
=============
Differenze rispetto localizzazione ufficiale Odoo/OCA

Descrizione | Odoo Italia | OCA
--- | --- | ---
Coverage |  [![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0) | [![codecov](https://codecov.io/gh/OCA/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n_italy/branch/9.0)
Test compatibilità OCA e Odoo | :white_check_mark: | :white_check_mark:

[//]: # (copyright)

----

**Odoo** is a trademark of [Odoo S.A.](https://www.odoo.com/) (formerly OpenERP, formerly TinyERP)

**OCA**, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of [SHS-AV s.r.l.](http://www.shs-av.com/)
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.

[//]: # (end copyright)


[![chat with us](https://www.shs-av.com/wp-content/chat_with_us.gif)](https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b)
EOF
      pushd $LCLTEST_TMPDIR >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 5" "$TESTOUT" "$TESTRES" "diff"
}

__test_06() {
    local TESTOUT TESTRES TESTFN
    TESTFN=README
    TESTSRC=$LCLTEST_PRJPATH/$TESTFN
    TESTRES=$TESTDIR/res/$TESTFN.test
    TESTOUT=$LCLTEST_PRJPATH/$TESTFN.tmp
    if [ ${opt_dry_run:-0} -eq 0 ]; then
      rm -f $LCLTEST_TMPDIR/*.tmp
      cat <<EOF >$TESTSRC
[![Build Status](https://travis-ci.org/OCA/l10n_italy.svg?branch=9.0)](https://travis-ci.org/OCA/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/OCA/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/OCA/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/OCA/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n_italy/branch/9.0)
[![Tech Doc](http://www.odoo.com/button/button-docs-travis_emulator.svg)](http://www.odoo.com/documentation/travis_emulator)
[![Help](https://www.odoo.com/forum/button/button-help-travis_emulator.svg)](https://www.odoo.com/forum/travis_emulator/help)


[![en](http://www.shs-av.com/wp-content/en_US.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

[![icon](static/src/img/icon.png)](https://travis-ci.org/zeroincombenze)

TEST_TRAVIS VI
==============

[//]: # (addons)
Invalid text
Should be deleted
[//]: # (end addons)


[![it](http://www.shs-av.com/wp-content/it_IT.png)](http://wiki.zeroincombenze.org/it/Odoo/7.0/man)

TEST_TRAVIS VI
==============

Differenze rispetto localizzazione ufficiale Odoo/OCA

Descrizione | Odoo Italia | OCA
--- | --- | ---
Coverage | [![codecov](https://codecov.io/gh/zeroincombenze/l10n-italy/branch/7.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n-italy/branch/7.0) | [![codecov](https://codecov.io/gh/OCA/l10n-italy/branch/7.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n-italy/branch/7.0)
Test con repository OCA e Odoo | Boh! | Boh!

Installation
------------

* pip install zerobug

Usage
-----

For furthermore information, please visit http://wiki.zeroincombenze.org/it/Odoo

Credits
-------

### Contributors

* Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>

### Funders

This module has been financially supported by

* SHS-AV s.r.l. <https://www.zeroincombenze.it/>

### Maintainer

[//]: # (copyright)

----

Test style Copyright
[//]: # (end copyright)

[![chat with us](http://www.shs-av.com/wp-content/chat_with_us.png)](https://www.zeroincombenze.it/chi-siamo/contatti/)
EOF
      cat <<EOF >$TESTRES
[![Build Status](https://travis-ci.org/zeroincombenze/l10n_italy.svg?branch=9.0)](https://travis-ci.org/zeroincombenze/l10n_italy)
[![license agpl](https://img.shields.io/badge/licence-AGPL--3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0.html)
[![Coverage Status](https://coveralls.io/repos/github/zeroincombenze/l10n_italy/badge.svg?branch=9.0)](https://coveralls.io/github/zeroincombenze/l10n_italy?branch=9.0)
[![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0)
[![OCA_project](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-oca-9.svg)](https://github.com/OCA/l10n_italy/tree/9.0)
[![Tech Doc](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-docs-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/dev)
[![Help](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-help-9.svg)](http://wiki.zeroincombenze.org/en/Odoo/9.0/man/FI)
[![try it](http://www.zeroincombenze.it/wp-content/uploads/ci-ct/prd/button-try-it-9.svg)](https://erp9.zeroincombenze.it)


[![en](https://github.com/zeroincombenze/grymb/blob/master/flags/en_US.png)](https://www.facebook.com/groups/openerp.italia/)

[![icon](static/src/img/icon.png)](https://travis-ci.org/zeroincombenze)

TEST_TRAVIS VI
==============

[//]: # (addons)


Available addons
----------------
addon | version | summary
--- | --- | ---
[l10n_it_base](l10n_it_base/) |  | TravisEm Test

[//]: # (end addons)


[![it](https://github.com/zeroincombenze/grymb/blob/master/flags/it_IT.png)](https://www.facebook.com/groups/openerp.italia/)

TEST_TRAVIS VI
==============

Differenze rispetto localizzazione ufficiale Odoo/OCA

Descrizione | Odoo Italia | OCA
--- | --- | ---
Coverage |  [![codecov](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/zeroincombenze/l10n_italy/branch/9.0) | [![codecov](https://codecov.io/gh/OCA/l10n_italy/branch/9.0/graph/badge.svg)](https://codecov.io/gh/OCA/l10n_italy/branch/9.0)
Test compatibilità OCA e Odoo | :white_check_mark: | :white_check_mark:

Installation
------------

* pip install zerobug

Configuration
-------------

Usage
-----

For furthermore information, please visit http://wiki.zeroincombenze.org/it/Odoo

Known issues / Roadmap
----------------------

Bug Tracker
-----------

Credits
-------

### Contributors

* Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>

### Funders

This module has been financially supported by

* SHS-AV s.r.l. <https://www.zeroincombenze.it/>

### Maintainer

[//]: # (copyright)

----

**Odoo** is a trademark of [Odoo S.A.](https://www.odoo.com/) (formerly OpenERP, formerly TinyERP)

**OCA**, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

**zeroincombenze®** is a trademark of [SHS-AV s.r.l.](http://www.shs-av.com/)
which distributes and promotes **Odoo** ready-to-use on own cloud infrastructure.
[Zeroincombenze® distribution of Odoo](http://wiki.zeroincombenze.org/en/Odoo)
is mainly designed for Italian law and markeplace.
Users can download from [Zeroincombenze® distribution](https://github.com/zeroincombenze/OCB) and deploy on local server.

[//]: # (end copyright)


[![chat with us](https://www.shs-av.com/wp-content/chat_with_us.gif)](https://tawk.to/85d4f6e06e68dd4e358797643fe5ee67540e408b)
EOF
      pushd $LCLTEST_PRJPATH >/dev/null
      $RUNDIR/please -qt distribution zero
      popd >/dev/null
    fi
    test_result "please distribution 6" "$TESTOUT" "$TESTRES" "diff"
}


Z0BUG_setup() {
    local VERSION=9.0
    LCLTEST_PRJNAME="Odoo"
    LCLTEST_REPOSNAME=l10n_italy
    LCLTEST_PKGNAME=l10n_it_base
    LCLTEST_TMPDIR0=~/dev/odoo/$VERSION
    LCLTEST_PRJPATH=$LCLTEST_TMPDIR0/$LCLTEST_REPOSNAME
    LCLTEST_TMPDIR=$LCLTEST_PRJPATH/$LCLTEST_PKGNAME
    mkdir -p $LCLTEST_TMPDIR0
    mkdir -p $LCLTEST_TMPDIR0/openerp
    touch $LCLTEST_TMPDIR0/openerp-server
    mkdir -p $LCLTEST_PRJPATH
    mkdir -p $LCLTEST_TMPDIR
    cat <<EOF >$LCLTEST_TMPDIR/__openerp__.py
# Odoo manifest for TravisEm $(date +%Y-%m-%d)
{
     'name': 'TravisEm Test',
     'author': 'SHS-AV s.r.l.',
     'maintainer': 'Antonio Maria Vigliotti <antoniomaria.vigliotti@gmail.com>',
}
EOF
}

Z0BUG_teardown() {
    rm -fR $LCLTEST_TMPDIR
    rm -fR $LCLTEST_PRJPATH
    rm -fR $LCLTEST_TMPDIR0
}


Z0BUG_init
parseoptest -l$TESTDIR/test_travis_emulator.log "$@"
sts=$?
[[ $sts -ne 127 ]] && exit $sts
for p in z0librc odoorc travisrc zarrc z0testrc; do
  if [[ -f $RUNDIR/$p ]]; then
    [[ $p == "z0librc" ]] && Z0LIBDIR="$RUNDIR" && source $RUNDIR/$p
    [[ $p == "odoorc" ]] && ODOOLIBDIR="$RUNDIR" && source $RUNDIR/$p
    [[ $p == "travisrc" ]] && TRAVISLIBDIR="$RUNDIR" && source $RUNDIR/$p
    [[ $p == "zarrc" ]] && ZARLIB="$RUNDIR" && source $RUNDIR/$p
    [[ $p == "z0testrc" ]] && Z0TLIBDIR="$RUNDIR" && source $RUNDIR/$p
  fi
done


UT1_LIST=""
UT_LIST=""
[[ "$(type -t Z0BUG_setup)" == "function" ]] && Z0BUG_setup
Z0BUG_main_file "$UT1_LIST" "$UT_LIST"
sts=$?
[[ "$(type -t Z0BUG_teardown)" == "function" ]] && Z0BUG_teardown
exit $sts


