8000 Add test project for Jinja2cpp/1.1.0 conan package · jinja2cpp/examples-build@5154fac · GitHub
[go: up one dir, main page]

Skip to content

Commit 5154fac

Browse files
committed
Add test project for Jinja2cpp/1.1.0 conan package
1 parent 75288f1 commit 5154fac

File tree

11 files changed

+74
-6
lines changed

11 files changed

+74
-6
lines changed

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,15 @@ addons:
1414
env:
1515
- EXAMPLE_PATH=conan/0.9.1 COMPILER_VERSION=6
1616
- EXAMPLE_PATH=conan/1.0.0 COMPILER_VERSION=6
17+
- EXAMPLE_PATH=conan/1.1.0 COMPILER_VERSION=6
1718
- EXAMPLE_PATH=conan/conan_build COMPILER_VERSION=6
1819
- EXAMPLE_PATH=external/internal COMPILER_VERSION=6
1920
- EXAMPLE_PATH=external/external_boost COMPILER_VERSION=6 USE_BOOST_PACKAGE=1
2021
- EXAMPLE_PATH=external/external COMPILER_VERSION=6 USE_BOOST_PACKAGE=1
2122
- EXAMPLE_PATH=subproject/internal COMPILER_VERSION=6
2223
- EXAMPLE_PATH=subproject/external_boost COMPILER_VERSION=6 USE_BOOST_PACKAGE=1
2324
- EXAMPLE_PATH=subproject/external COMPILER_VERSION=6 USE_BOOST_PACKAGE=1
24-
# SYSTEM_BOOST_PACKAGE=YES
2525

26-
before_install:
27-
# - if [[ "${USE_BOOST_PACKAGE}" != "" ]]; then sudo add-apt-repository -y ppa:samuel-bachmann/boost && sudo apt-get update -qq; fi
28-
# - sudo add-apt-repository -y ppa:samuel-bachmann/boost && sudo apt-get update -qq
2926

3027
install:
3128
# Install conan
@@ -37,7 +34,6 @@ install:
3734
- conan remote add manu https://api.bintray.com/conan/manu343726/conan-packages
3835
- conan remote add flexferrum https://api.bintray.com/conan/flexferrum/conan-packages
3936
- if [[ "${USE_BOOST_PACKAGE}" != "" ]]; then sudo apt-get install libboost-all-dev; fi
40-
# - sudo apt-get install libboost1.60-all-dev
4137

4238
script:
4339
- export CXX=g++-${COMPILER_VERSION}

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ environment:
2020
EXAMPLE_PATH: conan/0.9.1
2121
- BUILD_PLATFORM: x64
2222
EXAMPLE_PATH: conan/1.0.0
23+
- BUILD_PLATFORM: x64
24+
EXAMPLE_PATH: conan/1.1.0
2325
- BUILD_PLATFORM: x64
2426
EXAMPLE_PATH: conan/conan_build
2527
- BUILD_PLATFORM: x64
@@ -57,4 +59,3 @@ build_script:
5759
test_script:
5860
- cd C:\projects\examples-build\%EXAMPLE_PATH%
5961
- test.bat
60-
# - ctest -C Release -V

conan/1.1.0/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required (VERSION 3.0.0 FATAL_ERROR)
2+
project (Jinja2CppBuildTest CXX)
3+
4+
include (../../cmake/conan.cmake)
5+
if (NOT MSVC)
6+
set (CONAN_SETTINGS SETTINGS compiler.libcxx=libstdc++11)
7+
endif ()
8+
9+
conan_cmake_run(REQUIRES
10+
jinja2cpp/1.1.0
11+
gtest/[>=1.7.0]
12+
BASIC_SETUP
13+
${CONAN_SETTINGS}
14+
OPTIONS
15+
jinja2cpp:shared=False
16+
gtest:shared=False
17+
BUILD missing)
18+
19+
20+
set (TARGET_NAME jinja2cpp_build_test)
21+
22+
add_executable (${TARGET_NAME} main.cpp)
23+
24+
target_link_libraries (${TARGET_NAME} ${CONAN_LIBS})
25+
set_target_properties (${TARGET_NAME} PROPERTIES
26+
CXX_STANDARD 14
27+
CXX_STANDARD_REQUIRED ON)
28+
29+
enable_testing()
30+
31+
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
---
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Start testing: Mar 08 01:00 RTZ 2 (ceia)
2+
----------------------------------------------------------
3+
End testing: Mar 08 01:00 RTZ 2 (ceia)

conan/1.1.0/build.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mkdir .build
2+
cd .build
3+
cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release
4+
cmake --build . --config Release

conan/1.1.0/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
mkdir .build && cd .build
4+
cmake -DCMAKE_BUILD_TYPE=Release ..
5+
cmake --build .

conan/1.1.0/main.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
#include "gtest/gtest.h"
5+
6+
#include <jinja2cpp/template.h>
7+
8+
using namespace jinja2;
9+
10+
TEST(BasicTests, PlainSingleLineTemplateProcessing)
11+
{
12+
std::string source = "Hello World from Parser!";
13+
14+
Template tpl;
15+
ASSERT_TRUE(!!tpl.Load(source));
16+
17+
std::string result = tpl.RenderAsString(ValuesMap{}).value();
18+
std::cout << result << std::endl;
19+
std::string expectedResult = "Hello World from Parser!";
20+
EXPECT_STREQ(expectedResult.c_str(), result.c_str());
21+
}

conan/1.1.0/test.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ctest -C Release -V

conan/1.1.0/test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
cd .build
4+
ctest . -C Release -V

thirdparty/Jinja2Cpp-tojson

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit c3a89798fb353f032486dc7a93a8c786b24c2811

0 commit comments

Comments
 (0)
0