Skip to content

Commit 7d396f0

Browse files
authored
Merge pull request #11 from Dushistov/appvoyer
appveyor support
2 parents ee07d6c + 3e270d5 commit 7d396f0

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,15 @@ target_link_libraries(qtmonkey_gui ${QT_LIBRARIES} common_app_lib)
117117

118118
if (USE_TESTS)
119119
enable_testing()
120+
# Prevent overriding the parent project's compiler/linker
121+
# settings on Windows
122+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
123+
120124
add_subdirectory(contrib/gtest/googletest)
121125
include_directories(contrib/gtest/googletest/include)
122126
add_executable(run_unit_tests tests/unit_tests.cpp)
123127
target_include_directories(run_unit_tests PRIVATE contrib/json11)
124-
target_link_libraries(run_unit_tests qtmonkey_agent gtest gtest_main ${QT_LIBRARIES} common_app_lib)
128+
target_link_libraries(run_unit_tests qtmonkey_agent gtest_main ${QT_LIBRARIES} common_app_lib)
125129
add_test(unit_tests run_unit_tests)
126130

127131
add_executable(json11_test contrib/json11/test.cpp)

README.org renamed to README.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#+OPTIONS: ^:nil
2-
[[https://travis-ci.org/Dushistov/qt_monkey][https://travis-ci.org/Dushistov/qt_monkey.svg?branch=master]]
3-
[[https://github.com/Dushistov/qt_monkey/blob/master/LICENSE][https://img.shields.io/badge/license-BSD-green.svg]]
1+
# Qt Monkey [![Travis build status](https://travis-ci.org/Dushistov/qt_monkey.svg?branch=master)](https://travis-ci.org/Dushistov/qt_monkey) [![Appveyor build status](https://ci.appveyor.com/api/projects/status/c6h10uayiqmnr465?svg=true)](https://ci.appveyor.com/project/Dushistov/qt-monkey) [![License](https://img.shields.io/badge/license-BSD-green.svg)](https://github.com/Dushistov/qt_monkey/blob/master/LICENSE)
2+
3+
## Introduction
44

5-
* Introduction
65
Qt Monkey is a tool to automate testing of Qt-based applications (widgets only).
76
It automates creation/modification and running of the tests.
87
Tests are written in Javascript (Qt supported dialect).
@@ -11,40 +10,39 @@ To write your tests, simply run your application (instrumented by Qt Monkey) and
1110
on widget, input text, etc. As a result, a script in Javascript will be generated
1211
(see https://github.com/Dushistov/qt_monkey/blob/master/tests/test1.js for example).
1312

14-
#+OPTIONS: ^:nil
15-
[[example of script][https://github.com/Dushistov/qt_monkey/blob/master/docs/qtmonkey_gui.png]]
13+
[![example of script](https://github.com/Dushistov/qt_monkey/blob/master/docs/qtmonkey_gui.png)]
1614

1715
After that you can add suitable asserts and run this script via command line or GUI tool.
1816

19-
#+OPTIONS: ^:nil
20-
[[example of work of runnig script][https://github.com/Dushistov/qt_monkey/blob/master/docs/script_run_demo.gif]]
17+
[![example of work of runnig script](https://github.com/Dushistov/qt_monkey/blob/master/docs/script_run_demo.gif)]
18+
19+
## Requirements
2120

22-
* Requirements
2321
Qt Monkey requires compiler with C++11 support and Qt 4.x or Qt 5.x.
2422

25-
* How to use
23+
## How to use
24+
2625
First, download and build Qt Monkey:
27-
#+BEGIN_SRC sh
26+
```sh
2827
git clone --recursive https://github.com/Dushistov/qt_monkey.git
2928
cd qt_monkey
3029
cmake -DQT_VARIANT="qt5" .
3130
cmake --build .
32-
#+END_SRC
31+
```
3332

3433
Also you can use -DQT_VARIANT="qt4" for building with Qt 4.x.
3534
Then, integrate Qt Monkey agent into your application:
3635
1. Make sure that you link your application with qtmonkey_agent library
37-
3836
2. Create object of class `qt_monkey_agent::Agent` in the main thread of your application:
39-
#+BEGIN_SRC c++
37+
```C++
4038
qt_monkey_agent::Agent agent;
41-
#+END_SRC
39+
```
4240

4341
That's all. Now you can run qtmonkey_gui application
4442
and record or run your own scripts. See https://github.com/Dushistov/qt_monkey/blob/master/tests/test_app/main.cpp
4543
for the more complex usage example.
4644

47-
* Internals
45+
## Internals
4846

4947
Qt Monkey consists of three parts: Qt Monkey's agent library (qtmonkey_agent),
5048
qtmonkey_app (tool that run test application and cooperates with agent) and qtmonkey_gui.

appveyor.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
environment:
2+
matrix:
3+
- PLATFORM: x64
4+
compiler: msvc2015_64
5+
install:
6+
- ps: git submodule -q update --init
7+
init:
8+
- set PATH=C:\Qt\5.10.1\%compiler%\bin;%PATH%
9+
- ps: dir C:\Qt
10+
- ps: qmake --version
11+
build_script:
12+
- if [%PLATFORM%]==[x64] cmake -G "Visual Studio 14 2015 Win64" -DQT_VARIANT="qt5" -DUSE_TESTS=True .
13+
- cmake --build .
14+
# gui tests failed for some reason, I need windows machine to debug
15+
- ctest -V -C "Debug" -I 1,2,1
16+
matrix:
17+
fast_finish: true

0 commit comments

Comments
 (0)