GithubHelp home page GithubHelp logo

ate's Introduction

ATE

Automated Test Environment.

Contents

  1. Prepare build environment
  2. Build and install
  3. Options
    1. ATE_BUILD_CLIENT
    2. ATE_BUILD_SERVER
    3. ATE_COVERAGE
    4. ATE_TESTING
    5. ATE_PACKAGE
    6. ATE_INSTALL_SERVER_SERVICE
    7. CMAKE_TOOLCHAIN_FILE
  4. Targets
    1. default
    2. check
    3. test
    4. coverage
    5. coverage-html
    6. package
    7. install
  5. Examples
  6. Usage
  7. Build dependencies

Prepare build environment

Linux (VDP board or Desktop Ubuntu 18.04)

  1. Install tools and dependencies:

    • Desktop Ubuntu 18.04:

      1. Run:
        sudo apt update
        sudo apt install git cmake libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdbus-glib-1-dev libglib2.0-dev python2.7-dev
    • VDP board TX1:

      1. Add entries to /etc/apt/sources.list:
        deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe multiverse
        deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe multiverse
        
      2. Run:
        sudo apt update
        sudo apt install git cmake libdbus-glib-1-dev libglib2.0-dev python2.7-dev
  2. Clone, build and install VHAT dependencies:

  3. Clone repository and init submodules:

    git clone [email protected]:VHAT/ATE.git
    git -C ATE submodule update --init

Windows 10 PC

  1. Download and install Python 2.7 with latest bugfix https://www.python.org/download/releases/2.7/
  2. Download and install latest CMake https://cmake.org/download/
  3. Download and install latest git https://git-scm.com/downloads/
  4. Download and install Visual Studio 2015 or later https://visualstudio.microsoft.com/downloads/.
  5. In Visual Studio Installer select Desktop development with C++ and install latest MSVC build tools and Windows 10 SDK.
  6. Clone, build and install ThirdParty.

Build and install

Linux (VDP board or Desktop Ubuntu 18.04)

  1. Create build dir and generate build tool files there:

    mkdir build && cd build
    cmake ../ATE
  2. Build:

    cmake --build .
  3. Install:

    sudo cmake --build . --target install

Windows 10 PC

Only ATE client is supported on Windows platform.

  1. Create build dir and generate build tool files there:

    md build
    cd build
    cmake ..\ATE
    
  2. Build

    • Debug:

      cmake --build . --config Debug
      
    • Release:

      cmake --build . --config Release
      
  3. Install

    • Debug:
      cmake --build . --target install --config Debug
      
    • Release:
      cmake --build . --target install --config Release
      

Options

  • ATE_BUILD_CLIENT (default: ON)

    cmake path/to/sources -DATE_BUILD_CLIENT=ON [other options ...]
  • ATE_BUILD_SERVER (default: ON)

    cmake path/to/sources -DATE_BUILD_SERVER=ON [other options ...]
  • ATE_COVERAGE (default: OFF)

    cmake path/to/sources -DATE_COVERAGE=ON [other options ...]

    Turns on the coverage target which performs code coverage measurement.

  • ATE_TESTING (default: ON)

    cmake path/to/sources -DATE_TESTING=OFF [other options ...]

    Provides the ability to turn off unit testing and hence the check target. As a result, the code coverage measurement is also turned off (see Code coverage).

  • ATE_PACKAGE (default: OFF)

    cmake path/to/sources -DCMAKE_INSTALL_PREFIX=/usr -DATE_PACKAGE=ON [other options ...]

    Turns on the package target which allow create deb package.

    It is highly recommended to create Debian package that would intall into /usr. For now, packaging prefix is strongly tied to the install prefix.

  • ATE_INSTALL_SERVER_SERVICE (default: OFF)

    cmake path/to/sources -DATE_INSTALL_SERVER_SERVICE=ON [other options ...]
  • CMAKE_TOOLCHAIN_FILE

    cmake path/to/sources -DCMAKE_TOOLCHAIN_FILE=path/to/toolchain/file [other options ...]

Targets

  • Default

    cmake --build path/to/build/directory
    cmake --build path/to/build/directory --target all

    If a target is not specified (which is equivalent to the all target), it builds everything possible including unit tests and also calls the check target.

  • check

    cmake --build path/to/build/directory --target check

    Launches built (and builds if not yet) unit tests. Enabled by default.

    • On Windows must specify --config Debug or --config Release option. e.g.:

      cmake --build . --config Debug --target check

    See also test.

  • test

    cmake --build path/to/build/directory --target test

    Launches built (and builds if not yet) unit tests. Enabled by default.

    See also check.

  • coverage

    cmake --build path/to/build/directory --target coverage

    Analyzes run unit tests (and runs is not yet) using gcovr.

    Target is only available if ATE_COVERAGE option is on.

    See also check and 'test'.

  • coverage-html

    cmake --build path/to/build/directory --target coverage_html

    Generate html (index.html) report in binary directory.

    Analyzes run unit tests (and runs is not yet) using gcovr.

    Target is only available if ATE_COVERAGE option is on.

    See also check and 'test'.

  • package

    cmake path/to/sources -DATE_PACKAGE=ON
    cmake --build path/to/build/directory --target package

    Creating package for install.

    Target is only available if ATE_PACKAGE option is on.

  • install

    cmake path/to/sources -DCMAKE_INSTALL_PREFIX=/usr
    cmake --build path/to/build/directory --target install

    Installing ATE to CMAKE_INSTALL_PREFIX folder.

    The correct installation method is to install the package!

Examples

  • Build Debug:

    cmake path/to/sources -DCMAKE_BUILD_TYPE=Debug 
    cmake --build <path/to/build/directory>
  • Building the project in the debug mode and measure a test coverage

    cmake path/to/sources -DCMAKE_BUILD_TYPE=Debug -DATE_COVERAGE=ON
    cmake --build path/to/build/directory --target coverage
  • Build only client and disable unit tests:

    cmake path/to/sources -DATE_BUILD_SERVER=OFF -DATE_TESTING=OFF
    cmake --build path/to/build/directory>
    
  • Build project with ninja generator:

    cmake path/to/sources -GNinja
    cmake --build path/to/build/directory>
    
  • Build and install into /usr:

      cmake path/to/sources -DCMAKE_INSTALL_PREFIX=/usr
      sudo cmake --build path/to/build/directory --target install
    
    The correct installation method is to install the package!
  • Building the project in the release mode with creating a package (see target package).

    cmake path/to/sources -DCMAKE_BUILD_TYPE=Release -DATE_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=path/to/installed/dependencies
    cmake --build path/to/build/directory --target package
  • System install and deploy package

    1. Enable server service install, install icon storage and create package :

       cmake path/to/sources -DCMAKE_INSTALL_PREFIX=/usr -DATE_INSTALL_SERVER_SERVICE=ON -DATE_PACKAGE=ON
       cmake --build path/to/build/directory --target package
    2. You can use dpkg package manager to install this package. This command will also replace the previous installation of ATE:

      sudo dpkg -i ate-X.Y.Z.deb
      
  • Running the unit tests

     cmake path/to/sources -DATE_TESTING=ON
     cmake --build path/to/build/directory --target test

    or

     cmake path/to/sources -DATE_TESTING=ON
     cmake --build path/to/build/directory --target check

Usage

Run ATE server on LVDS board

  1. Open server config for edit:

    <install prefix>/etc/ate_server.ini
    
  2. Set up video stream:

    [VIDEO_STREAM]
    FrameWidth = <TDK display resolution width>
    FrameHeight = <TDK display resolution height>
    
  3. Select icon storage:

    [DB]
    Target = <TDK Sync version (sync3 | sync4)>
    Build = <TDK Sync software build version>
    CollectionMode = <Current Sync display theme(day_mode | night_mode)>
    
  4. Save the ate_server.ini and run ATE server:

    <install prefix>/bin/ate_server
    

ATE server need to be restarted in order to apply any config or icon storage changes.

Run ATE server outside the LVDS board (debug purpose only)

  1. Open server config for edit:

    <install prefix>/etc/ate_server.ini
    
  2. Set up video stream source:

    [VIDEO_STREAM]
    Source = RTSP
    Path = rtsp://127.0.0.1:8554/lvds
    
  3. Either set up path to send touch events to TDK via VDP server:

    [INTERACTION]
    Type = VDP
    Address = <ip address of LVDS board running VDP server>
    Port = <port of VDP server on LVDS board>
    DisplayType = <type of HMI display as configured on TDK>
    

    Or just stub it:

    [INTERACTION]
    Type = Dummy
    
  4. Select icon storage:

    [DB]
    Target = <TDK sync version (sync3 | sync4)>
    Build = <Sync software build version>
    CollectionMode = <Current Sync display theme(day_mode | night_mode)>
    
  5. Save the ate_server.ini and run ATE server:

    <install prefix>/bin/ate_server
    

For full video stream support you will also need to set up webrtc client which is not covered by this project.

Use ATE client on LVDS board

Import vhat_client.so from <install prefix>/lib/python2.7/dist-packages into your Python 2.7 code.

If <install prefix> was set to a standard system resource directory (i.e. /usr or /usr/local) then vhat_client.so could be looked up from any point of a system.

Otherwise you'd like to add module location to PYTHONPATH or look it up manually.

No additional configuration is needed.

Use ATE client outside LVDS board

  1. Open client config for edit:
    <install prefix>/etc/ate_client.ini
    
  2. Set IP address of LVDS board running ATE server:
    [BOARD]
    Address = <IP address>
    
  3. Import vhat_client.so from <install prefix>/lib/python2.7/dist-packages into your Python 2.7 code. Module look up rules are the same as for LVDS board case above.

Build dependencies

Linux

  1. Build tools and libs provided by Ubuntu dev packages are automatically installed by setup-environment.sh script.
  2. DBManagerLib
  3. RecognitionLib
  4. JsonCpp
  5. GoogleTest
  6. (LVDS board only) GStreamer

Windows

TBD

ate's People

Contributors

kvgrygoriev avatar s-lisovenko avatar serhiimuchychka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.