Skip to content

Commit c3c76d6

Browse files
committed
Merge branch 'master' of github.com:baidu/Paddle into opensource
2 parents 5209fcc + 81c86f9 commit c3c76d6

File tree

7 files changed

+65
-5
lines changed

7 files changed

+65
-5
lines changed

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
language: cpp
2+
cache: ccache
3+
sudo: required
4+
dist: trusty
5+
addons:
6+
apt:
7+
packages:
8+
- gcc-4.8
9+
- g++-4.8
10+
- wget
11+
- git
12+
- build-essential
13+
- libatlas-base-dev
14+
- python
15+
- python-pip
16+
- python2.7-dev
17+
- m4
18+
- libprotobuf-dev
19+
- protobuf-compiler
20+
- python-protobuf
21+
- python-numpy
22+
- python-wheel
23+
- libgoogle-glog-dev
24+
- libgflags-dev
25+
- libgtest-dev
26+
before_install:
27+
- pip install wheel protobuf
28+
- sudo paddle/scripts/travis/before_install.sh
29+
script:
30+
- paddle/scripts/travis/build.sh
31+
- paddle/scripts/travis/unittest.sh
32+
notifications:
33+
email:
34+
on_success: change
35+
on_failure: always

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ option(WITH_TIMER "Compile PaddlePaddle use timer" OFF)
3737
option(WITH_TESTING "Compile and run unittest for PaddlePaddle" ${GTEST_FOUND})
3838
option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
3939
option(WITH_SWIG_PY "Compile PaddlePaddle with py PaddlePaddle prediction api" ${SWIG_FOUND})
40+
option(ON_TRAVIS "Running test on travis-ci or not." OFF)
4041
if(NOT CMAKE_BUILD_TYPE)
4142
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
4243
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# PaddlePaddle
2+
[![Build Status](https://travis-ci.org/baidu/Paddle.svg?branch=master)](https://travis-ci.org/baidu/Paddle)
23

34
Welcome to the PaddlePaddle GitHub.
45

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
pushd /usr/src/gtest
4+
cmake .
5+
make
6+
sudo cp *.a /usr/lib
7+
popd

paddle/scripts/travis/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
cd `dirname $0`
4+
cd ../../../
5+
set -e
6+
mkdir build
7+
cd build
8+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_GPU=OFF -DWITH_DOC=OFF -DWITH_TESTING=ON -DON_TRAVIS=ON
9+
make -j `nproc`

paddle/scripts/travis/unittest.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
cd `dirname $0`
4+
cd ../../../build
5+
env CTEST_OUTPUT_ON_FAILURE=1 make test ARGS="-j `nproc`"
6+

paddle/trainer/tests/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ add_test(NAME test_CompareTwoOpts
5353
################# test_CompareSparse ##################
5454
add_unittest_without_exec(test_CompareSparse
5555
test_CompareSparse.cpp)
56-
add_test(NAME test_CompareSparse
57-
COMMAND ${PROJ_ROOT}/paddle/.set_python_path.sh -d ${PROJ_ROOT}/python/
58-
./.set_port.sh -p port -n 6
59-
${CMAKE_CURRENT_BINARY_DIR}/test_CompareSparse
56+
if(NOT ON_TRAVIS)
57+
add_test(NAME test_CompareSparse
58+
COMMAND ${PROJ_ROOT}/paddle/.set_python_path.sh -d ${PROJ_ROOT}/python/
59+
./.set_port.sh -p port -n 6
60+
${CMAKE_CURRENT_BINARY_DIR}/test_CompareSparse
6061
WORKING_DIRECTORY ${PROJ_ROOT}/paddle/)
61-
62+
endif()
6263
################# test_recurrent_machine_generation ###############
6364
add_unittest_without_exec(test_recurrent_machine_generation
6465
test_recurrent_machine_generation.cpp)

0 commit comments

Comments
 (0)