Merge remote-tracking branch 'origin/develop'
git@22656e818e6429139cc1f7ac9c77baee0f561e92
https://github.com/srz-zumix/iutest/commit/22656e818e6429139cc1f7ac9c77baee0f561e92
Merge remote-tracking branch 'origin/develop'
git@0e1758512a4a3f172e14836c1548109453973853
Merge remote-tracking branch 'origin/master' into develop
git@7f2a70c3cbb9e25a7ccd9c371d95cc775b685ada
fix .editorconfig
git@4d496be3e612d204dba6b9be2a470c7b48b47cbf
Merge branch 'develop' of github.com:srz-zumix/iutest into develop
git@91f96bd372e30d8dd981ad46cc2a3945fb52af83
Feature/editorconfig self lint (#170)
add editorconfig self lint #165
git@500407d3f54b51482599abad953d577d3f6cc73a
update msvc15
git@ae814edfd4a0ae0ea6f049084c14ce70fbfd9de8
add codefresh badge [ci skip]
git@08276ceb7ae170aafbb5a7c7451821bd2511d1ad
fix coverity url [ci skip]
git@4c4d25c37830f439dc88ac5993c48486a30e1efb
Merge pull request #169 from srz-zumix/azurepipelines/pr_filter
azure pipelines run PR #158
git@8d994a62c7d4847eb711c2624bde4cee97a99ed0
add editorconfig lint (#167)
git@95be381ab0215b44052c5a7e4bf76ce739f9bc61
update README.md [ci skip]
git@d6dc88cd6e0001bd0baa4c8c42e9b8a0e4c853f1
Merge remote-tracking branch 'origin/master' into develop
git@660b3c8bf64994680cd3ae1c641d2e4e97b732c3
Cirrusci/fix branch filter (#168)
Cirrus CI branch filter #158
* fix only_if
* auto_cancellation: true
git@5edf6fd0f3253569399e1b9be66a14bf7e4512ad
azure pipelines run PR #158
git@b703a6fc92f8d1fa91537406b8cd497d6f53a144
add editorconfig lint
git@5a36fd7fa4b16ed96a4da2e2e2e33569b088c86d
Update issue templates
git@ed3ff4a2513cd2f8fe22d8208d55cd9f86f703e6
travis ci branch filter #158
git@b58a2e58b3830033294c9e18a107c492e9b6a1e0
cirrus ci branch filter #158
git@25cad01a39eacea709cec482b481caef2928bc4f
circle ci branch filter #158
git@721758fe5d3c2dcfd7ca4c6bb46cc38d328b38b9
shippable branch filter #158
git@481209fe82ae58094aa11b5fc447c95b5df16dc9
Update issue templates [ci skip]
git@f9bd374e5f5178b8d6ce475ac4ffa3909f0c77ab
Merge pull request #164 from srz-zumix/feature/testresult_xml_to_files
Feature/testresult xml to files
git@f5363f86d53266487ad2af54a43df48b3ead9757
fix lint
git@16274b98f545ad18c430beeb2f153164f41239d6
Merge pull request #156 from srz-zumix/appveyor/merge_projects
merge appveyor project
git@228f101b33719f8e3e4e436aa88f9d8e9336f84c
fix nmake rule
git@a6e18cc6a018598e108beeb0ed1c09a35494b708
Merge remote-tracking branch 'origin/develop' into appveyor/merge_projects
git@1e931fbc0e2b17a06d40b9b4d27f4632d6f5e70b
Merge pull request #163 from srz-zumix/revert-114-feature/github_actions
Revert "hello github actions"
git@1482f6a57d871014ffb29468c392c977b386f041
Revert "hello github actions"
git@1157fb4e9a8d0d5441f76cea9aef0b6220166cc9
update appveyor.yml
git@bba325ea3fcff204f9e122e6f30d32c486c97a09
fix nmake tests run rule
git@47d7930a62292f51561ceb105126a720e13d6eff
add testsuites/testsuite user recored property
git@8bece8bb6136ac14570a7632870ae2d23c7aa526
nmake not target to compile error test
git@5f86025263e0a1dc24f1e5765732e82304161e82
get user props
git@82dc27db709072f12edf77526864d67869c2b605
git@53544e7d2eefeacdb1c36fa1a3b13b51486bfd12
fix test on nmake
git@09668751cb62122a10ca2abb3afe1ff9fc525309
Merge pull request #114 from srz-zumix/feature/github_actions
hello github actions #154
git@db779f14a0c0e7417b9378205516d0d6106eb115
Merge branch 'master' into feature/github_actions
git@396cef6d5ad2687d4cf69c899971a2dec05affd8
Update appveyor.yml
git@9b7848e607887a0f939eefab63516da137dff4b8
support skipped tag
git@b3aa40196a3e09d91785222854864ea20b5cb572
Merge remote-tracking branch 'origin/develop' into feature/testresult_xml_to_files
git@be7847250956083973c4fedb673ef95d0bcf4057
*.yml trim_trailing_whitespace
git@c1e94d3db69bb327775b3e66a910168afbc3024f
fix nmake and mingw
git@002c0ddc141a3367d8df17e479e31769324f3ef3
split disabled_tests
git@c6b5006a28762460bd6d2760e7b5422254a2336f
add disabled test
git@6ad4d5eab2e9468fbcd0078def3e451e54e7de6f
add verbose option
git@90c796fe750dc6cf361336b6ad4a751ba3912c5a
fix appveyor.yml syntax
git@0b20ac6371ffaf2c16de8146efd7086710297f9b
merge nmake project #141
git@c3bf25962fd23b40de50ff18294e267d4994f6b6
Update appveyor.yml
git@1591010016317ef1fb946ec7cc96c11915e42ccf
write test failure elements and clean directory
git@6fe80956f9162e8d86be0ee45b25c4ad38944ed5
fix prefast matrix
git@0451b4379f25db17d78b56e886878b404fa7f9f7
output file
git@3630fb2ba83d074043b01b9f860131660b2a7786
merge package project #141
git@21487dbfb221ba48845bd86a880d512f380ef734
merge prefast project #141
git@6d8d5e08fa33e3e352ebc61c5023febdc6903771
Merge pull request #157 from srz-zumix/buddy/update_arm_none_eabi_image
Buddy/update arm none eabi image
git@9c2a10d6da5c5774eeff3b497dad8390ba1e94c2
update xml2file.py
git@89f5347dbb2cb9476b643759a5c61a08e0b9dd7d
update arm-none-eabi image 8-2018q4
git@940ea57e8a46ce178d2ca7972dec71954be2c0e1
update arm-none-eabi docker image #155
git@4a914150d9abcb5c78933f742ade2dbe63baaf65
update buddy.yml
git@4b691ad2a81fec2b0c6c79dd2d2270b101858c43
merge appveyor project
git@b2157b85ca5a5dbd8d31f3d3f2bc39904b975e81
create xml2file.py base #153
git@486b682efcbcec2b663f0930145a6d9ca6a74736
hwllo github actions
git@5046d66f802f0232f15973f6dc3b0be412b1068c
@@ -75,3 +75,11 @@ | ||
75 | 75 | # osdn |
76 | 76 | .osdn.vars |
77 | 77 | osdn_*/ |
78 | + | |
79 | +# npm | |
80 | +node_modules/ | |
81 | +package-lock.json | |
82 | + | |
83 | +# python | |
84 | +# pyenv | |
85 | +.python-version |
@@ -6,6 +6,13 @@ | ||
6 | 6 | - clang |
7 | 7 | - gcc |
8 | 8 | |
9 | +branches: | |
10 | + only: | |
11 | + - master | |
12 | + - develop | |
13 | + - /feature.*/ | |
14 | + - /travisci.*/ | |
15 | + | |
9 | 16 | addons: |
10 | 17 | apt: &apt-global |
11 | 18 | sources: &apt-common-sources |
@@ -32,7 +39,7 @@ | ||
32 | 39 | export CXX=g++-8 |
33 | 40 | export CCOV=gcov-8 |
34 | 41 | export AR=gcc-ar-8 |
35 | - export RANLIB=gcc-ranlib-8 | |
42 | + export RANLIB=gcc-ranlib-8 | |
36 | 43 | #update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 |
37 | 44 | #update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90 |
38 | 45 | #update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-8 90 |
@@ -54,7 +61,7 @@ | ||
54 | 61 | if [ "${USE_COVERAGE}" = 'lcov' ]; then gem install lcoveralls; fi |
55 | 62 | fi |
56 | 63 | # gtest/gmock |
57 | - - if [ "${USE_GTEST}" = '1' ] || [ "${USE_GMOCK}" = '1' ]; then . .ci/travisci/install-gtest.sh; fi | |
64 | + - if [ "${USE_GTEST}" = '1' ] || [ "${USE_GMOCK}" = '1' ]; then . .ci/travisci/install-gtest.sh; fi | |
58 | 65 | # gmock |
59 | 66 | - if [ "${USE_GMOCK}" = '1' ]; then . .ci/travisci/install-gmock.sh; fi |
60 | 67 |
@@ -84,7 +91,7 @@ | ||
84 | 91 | # Coverage |
85 | 92 | - if [ "${USE_COVERALLS}" = '1' ]; then make send-coveralls; fi |
86 | 93 | - if [ "${USE_CODECOV}" = '1' ]; then make send-codecov; fi |
87 | - | |
94 | + | |
88 | 95 | env: |
89 | 96 | global: |
90 | 97 | # COVERITY_SCAN_TOKEN |
@@ -139,7 +146,7 @@ | ||
139 | 146 | sources: *apt-common-sources |
140 | 147 | packages: &apt-cmake-packages |
141 | 148 | - *apt-common-packages |
142 | - - cmake | |
149 | + - cmake | |
143 | 150 | # Google Test |
144 | 151 | #- compiler: gcc |
145 | 152 | # env: USE_GTEST=1 USE_GTEST_HEAD=1 USE_GNU_EXTENSION=1 |
@@ -168,7 +175,7 @@ | ||
168 | 175 | - google-mock |
169 | 176 | # MinGW |
170 | 177 | # - compiler: gcc |
171 | - # env: | |
178 | + # env: | |
172 | 179 | # - MINGW=1 HOST=WINE DEFS="-DIUTEST_HAS_STREAM_BUFFER=0" |
173 | 180 | # - COMPILER_CC=i686-w64-mingw32-gcc |
174 | 181 | # - COMPILER_CXX=i686-w64-mingw32-g++ |
@@ -230,7 +237,7 @@ | ||
230 | 237 | # - STDFLAG=-std=c++11 |
231 | 238 | # - DEFS="-DIUTEST_USE_OWN_IS_MEMBER_FUNCTION_POINTER=1 -DIUTEST_CHECK_STRICT=0 -DIUTEST_HAS_HDR_CXXABI=0" |
232 | 239 | # - CXXFLAGS="-lasan -fsanitize=address -fno-omit-frame-pointer" |
233 | - | |
240 | + | |
234 | 241 | notifications: |
235 | 242 | webhooks: |
236 | 243 | urls: |
@@ -8,3 +8,6 @@ | ||
8 | 8 | |
9 | 9 | fused: |
10 | 10 | make -C tools/fused |
11 | + | |
12 | +editorconfig: | |
13 | + make -C tools/python editorconfig |
@@ -4,11 +4,12 @@ | ||
4 | 4 | [![Buddy branch](https://app.buddy.works/zumixcpp/iutest/repository/branch/master/badge.svg?token=5e58135ab4831252209e7b1fe75bfe9de669b0dc7e95ed4316eebad2187d59a0 "buddy branch")](https://app.buddy.works/zumixcpp/iutest/repository/branch/master) |
5 | 5 | [![CircleCI](https://circleci.com/gh/srz-zumix/iutest/tree/master.svg?style=svg)](https://circleci.com/gh/srz-zumix/iutest/tree/master) |
6 | 6 | [![Cirrus Build Status](https://api.cirrus-ci.com/github/srz-zumix/iutest.svg?branch=master)](https://cirrus-ci.com/github/srz-zumix/iutest/master) |
7 | +[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/srz-zumix/srz-zumix%2Fiutest%2Fiutest_benchmark_test?branch=master&type=cf-2)]( https://g.codefresh.io/pipelines/iutest_benchmark_test/builds?repoOwner=srz-zumix&repoName=iutest&serviceName=srz-zumix%2Fiutest&filter=trigger:build~Build;branch:master;pipeline:58a933be9d1bd40100495882~iutest_benchmark_test) | |
7 | 8 | [![Codeship Status for srz-zumix/iutest](https://codeship.com/projects/5bc87030-5b41-0133-6000-4242aa07dce3/status?branch=master)](https://codeship.com/projects/110695) |
8 | 9 | [![GitLab CI pipeline status](https://gitlab.com/srz-zumix/iutest-test/badges/master/pipeline.svg)](https://gitlab.com/srz-zumix/iutest-test/commits/master) |
10 | +[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=master)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/master) | |
9 | 11 | [![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/master/badge.svg)](https://semaphoreci.com/srz_zumix/iutest) |
10 | 12 | [![Shippable Run Status](https://api.shippable.com/projects/541904d2ac22859af743f867/badge?branch=master)](https://app.shippable.com/github/srz-zumix/iutest) |
11 | -[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=master)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/master) | |
12 | 13 | [![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest) |
13 | 14 | [![Wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/bykey/d385156052aa4118a7f24affe4a8f851) |
14 | 15 |
@@ -105,8 +106,7 @@ | ||
105 | 106 | |
106 | 107 | |CI|master|develop|Tests| |
107 | 108 | |:--|:--|:--|:--| |
108 | -|[AppVeyor](https://www.appveyor.com/)|[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/master)|[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/develop?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/develop)|Windows, Visual Studio, Cygwin, MINGW, NuGet| | |
109 | -| |[![AppVeyor Build PREFAST status](https://ci.appveyor.com/api/projects/status/0w0wuhc58kre178q/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest-xsqun/branch/master)|[![AppVeyor Build PREFAST status](https://ci.appveyor.com/api/projects/status/0w0wuhc58kre178q/branch/develop?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest-xsqun/branch/develop)|Visual Studio PREFAST (Code Analysis)| | |
109 | +|[AppVeyor](https://www.appveyor.com/)|[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/master?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/master)|[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2gdmgo8ce8m0iy0e/branch/develop?svg=true)](https://ci.appveyor.com/project/srz-zumix/iutest/branch/develop)|Windows, Visual Studio, Cygwin, MINGW, NuGet, Visual Studio PREFAST (Code Analysis)| | |
110 | 110 | |[Azure Pipelines](https://dev.azure.com)|[![Build Status](https://dev.azure.com/srz-zumix/iutest/_apis/build/status/srz-zumix.iutest?branchName=master)](https://dev.azure.com/srz-zumix/iutest/_build/latest?definitionId=4)|[![Build Status](https://dev.azure.com/srz-zumix/iutest/_apis/build/status/srz-zumix.iutest?branchName=develop)](https://dev.azure.com/srz-zumix/iutest/_build/latest?definitionId=4)|Config matrix test| |
111 | 111 | |[Bitrise](https://www.bitrise.io/?referrer=a9c0b9baf7536067)|[![Bitrise iOS Build Status](https://app.bitrise.io/app/6903498632e89465/status.svg?token=siumhVNY6p6lklSZF6xGNA&branch=master)](https://app.bitrise.io/app/6903498632e89465?referrer=a9c0b9baf7536067)|[![Bitrise iOS Build Status](https://app.bitrise.io/app/6903498632e89465/status.svg?token=siumhVNY6p6lklSZF6xGNA&branch=develop)](https://app.bitrise.io/app/6903498632e89465?referrer=a9c0b9baf7536067)|iOS| |
112 | 112 | | |[![Bitrise Android Build Status](https://app.bitrise.io/app/f6bc69af3f6e2838/status.svg?token=eqd9m0stwgXuEff2FeLRQA&branch=master)](https://app.bitrise.io/app/f6bc69af3f6e2838?referrer=a9c0b9baf7536067)|[![Bitrise Android Build Status](https://app.bitrise.io/app/f6bc69af3f6e2838/status.svg?token=eqd9m0stwgXuEff2FeLRQA&branch=develop)](https://app.bitrise.io/app/f6bc69af3f6e2838?referrer=a9c0b9baf7536067)|Android| |
@@ -116,9 +116,9 @@ | ||
116 | 116 | |[Circle CI](https://circleci.com/)|[![CircleCI](https://circleci.com/gh/srz-zumix/iutest/tree/master.svg?style=svg)](https://circleci.com/gh/srz-zumix/iutest/tree/master)|[![CircleCI](https://circleci.com/gh/srz-zumix/iutest/tree/develop.svg?style=svg)](https://circleci.com/gh/srz-zumix/iutest/tree/develop)|Optimize options test| |
117 | 117 | |[Cirrus CI](https://cirrus-ci.org/)|[![Cirrus Build Status](https://api.cirrus-ci.com/github/srz-zumix/iutest.svg?branch=master)](https://cirrus-ci.com/github/srz-zumix/iutest/master)|[![Cirrus Build Status](https://api.cirrus-ci.com/github/srz-zumix/iutest.svg?branch=develop)](https://cirrus-ci.com/github/srz-zumix/iutest/develop)|g++ std=c++14,17...| |
118 | 118 | |[Codacy](https://www.codacy.com/)|[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e6407b63c9c844d080ed71c7707bded9?branch=master)](https://www.codacy.com/app/srz-zumix/iutest?utm_source=github.com&utm_medium=referral&utm_content=srz-zumix/iutest&utm_campaign=Badge_Grade)|[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e6407b63c9c844d080ed71c7707bded9?branch=develop)](https://www.codacy.com/app/srz-zumix/iutest?utm_source=github.com&utm_medium=referral&utm_content=srz-zumix/iutest&utm_campaign=Badge_Grade)|Shellcheck, Cppcheck, PyLint, etc...| |
119 | -|[Codefresh](https://codefresh.io/)|||| | |
119 | +|[Codefresh](https://codefresh.io/)|[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/srz-zumix/srz-zumix%2Fiutest%2Fiutest_benchmark_test?branch=master&type=cf-2)]( https://g.codefresh.io/pipelines/iutest_benchmark_test/builds?repoOwner=srz-zumix&repoName=iutest&serviceName=srz-zumix%2Fiutest&filter=trigger:build~Build;branch:master;pipeline:58a933be9d1bd40100495882~iutest_benchmark_test)|[![Codefresh build status]( https://g.codefresh.io/api/badges/pipeline/srz-zumix/srz-zumix%2Fiutest%2Fiutest_benchmark_test?branch=develop&type=cf-2)]( https://g.codefresh.io/pipelines/iutest_benchmark_test/builds?repoOwner=srz-zumix&repoName=iutest&serviceName=srz-zumix%2Fiutest&filter=trigger:build~Build;branch:develop;pipeline:58a933be9d1bd40100495882~iutest_benchmark_test)|Benchmark test| | |
120 | 120 | |[Codeship](https://codeship.com/)|[![Codeship Status for srz-zumix/iutest](https://app.codeship.com/projects/5bc87030-5b41-0133-6000-4242aa07dce3/status?branch=master)](https://app.codeship.com/projects/110695)|[![Codeship Status for srz-zumix/iutest](https://app.codeship.com/projects/5bc87030-5b41-0133-6000-4242aa07dce3/status?branch=develop)](https://app.codeship.com/projects/110695)|Update documents, Check coding standard of the project| |
121 | -|[Coverity Scan](https://codeship.com/)|[![Coverity Scan Build Status](https://scan.coverity.com/projects/1316/badge.svg)](https://scan.coverity.com/projects/srz-zumix-iutest)||Coverity Scan| | |
121 | +|[Coverity Scan](https://scan.coverity.com)|[![Coverity Scan Build Status](https://scan.coverity.com/projects/1316/badge.svg)](https://scan.coverity.com/projects/srz-zumix-iutest)||Coverity Scan| | |
122 | 122 | [GitLab CI](https://about.gitlab.com/product/continuous-integration/)|[![GitLab CI pipeline status](https://gitlab.com/srz-zumix/iutest-test/badges/master/pipeline.svg)](https://gitlab.com/srz-zumix/iutest-test/commits/master)|[![GitLab CI pipeline status](https://gitlab.com/srz-zumix/iutest-test/badges/develop/pipeline.svg)](https://gitlab.com/srz-zumix/iutest-test/commits/develop)|Google Test/Google Mock compatibility (HEAD)| |
123 | 123 | |[INSPECODE](https://rocro.com/)|[![Job Status](https://inspecode.rocro.com/badges/github.com/srz-zumix/iutest/status?token=wt0KUnRUG1-Ul2mLrg8ComR1RznZV3VoXecBJHW0EIk&branch=master)](https://inspecode.rocro.com/jobs/github.com/srz-zumix/iutest/latest?completed=true&branch=master)|[![Job Status](https://inspecode.rocro.com/badges/github.com/srz-zumix/iutest/status?token=wt0KUnRUG1-Ul2mLrg8ComR1RznZV3VoXecBJHW0EIk&branch=develop)](https://inspecode.rocro.com/jobs/github.com/srz-zumix/iutest/latest?completed=true&branch=develop)|Spell check, Cppcheck, cpplint, metrics, scan-build| |
124 | 124 | |[Scrutinizer](https://scrutinizer-ci.com/)|[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=master)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/master)|[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=develop)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/develop)|iuwandbox tests| |
@@ -1,6 +1,8 @@ | ||
1 | 1 | version: 1.0.{build} |
2 | + | |
2 | 3 | environment: |
3 | 4 | matrix: |
5 | + # Visual Studio | |
4 | 6 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 |
5 | 7 | PROJECT_DIR: msvc12 |
6 | 8 | CMAKE_GENERATOR_NAME: Visual Studio 12 2013 |
@@ -10,6 +12,7 @@ | ||
10 | 12 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 |
11 | 13 | PROJECT_DIR: msvc15 |
12 | 14 | CMAKE_GENERATOR_NAME: Visual Studio 15 2017 |
15 | + # Cygwin | |
13 | 16 | - BUILD_CYGWIN: yes |
14 | 17 | USE_GNU_EXTENSION: 0 |
15 | 18 | CYGWIN_PATH: C:\cygwin |
@@ -22,15 +25,38 @@ | ||
22 | 25 | USE_GNU_EXTENSION: 1 |
23 | 26 | CYGWIN_PATH: C:\cygwin64 |
24 | 27 | CYGWIN_SETUP_EXE: setup-x86_64.exe |
28 | + # MINGW64 | |
25 | 29 | - BUILD_MINGW: yes |
30 | + USE_GNU_EXTENSION: 0 | |
31 | + MAKE_OPTIONS: LIBS=ws2_32 | |
26 | 32 | MINGW_PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin |
27 | 33 | #MINGW_PATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1 |
28 | - MAKE_OPTIONS: LIBS=ws2_32 | |
29 | 34 | #APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 |
30 | - # MINGW32 | |
35 | + # MINGW64 GNU EXTENSION | |
31 | 36 | - BUILD_MINGW: yes |
32 | - #APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | |
37 | + USE_GNU_EXTENSION: 1 | |
38 | + MAKE_OPTIONS: LIBS=ws2_32 | |
39 | + MINGW_PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin | |
40 | + # MINGW32 | |
41 | + - BUILD_MINGW: yes | |
42 | + USE_GNU_EXTENSION: 0 | |
33 | 43 | MINGW_PATH: c:\mingw\bin |
44 | + # MINGW32 GNU EXTENSION | |
45 | + - BUILD_MINGW: yes | |
46 | + USE_GNU_EXTENSION: 1 | |
47 | + MINGW_PATH: c:\mingw\bin | |
48 | + # NMAKE | |
49 | + - BUILD_NMAKE: yes | |
50 | + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | |
51 | + # Prefast | |
52 | + - BUILD_PREFAST: yes | |
53 | + PROJECT_DIR: msvc14 | |
54 | + # Menu | |
55 | + - BUILD_MENU: yes | |
56 | + # Package Build | |
57 | + - BUILD_PACKAGE: yes | |
58 | + APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu | |
59 | + # Nuget | |
34 | 60 | - BUILD_NUGET: yes |
35 | 61 | |
36 | 62 | configuration: |
@@ -40,12 +66,30 @@ | ||
40 | 66 | matrix: |
41 | 67 | exclude: |
42 | 68 | - configuration: Debug |
43 | - BUILD_NUGET: yes | |
44 | - - configuration: Debug | |
45 | 69 | BUILD_CYGWIN: yes |
46 | 70 | - configuration: Debug |
47 | 71 | BUILD_MINGW: yes |
48 | - | |
72 | + - configuration: Debug | |
73 | + BUILD_NMAKE: yes | |
74 | + - configuration: Release | |
75 | + BUILD_PREFAST: yes | |
76 | + - configuration: Debug | |
77 | + BUILD_MENU: yes | |
78 | + - configuration: Debug | |
79 | + BUILD_PACKAGE: yes | |
80 | + - configuration: Debug | |
81 | + BUILD_NUGET: yes | |
82 | + | |
83 | +branches: | |
84 | + only: | |
85 | + - master | |
86 | + - develop | |
87 | + - /feature.*/ | |
88 | + - /appveyor.*/ | |
89 | + | |
90 | +# Do not build feature branch with open Pull Requests | |
91 | +skip_branch_with_pr: true | |
92 | + | |
49 | 93 | clone_depth: 1 |
50 | 94 | |
51 | 95 | init: |
@@ -71,25 +115,9 @@ | ||
71 | 115 | verbosity: minimal |
72 | 116 | |
73 | 117 | test_script: |
74 | - cmd: | | |
75 | - cd build | |
76 | - ctest -C %Configuration% -V | |
118 | + cmd: cd build && ctest -C %Configuration% -V | |
77 | 119 | |
78 | 120 | for: |
79 | -# NuGet | |
80 | -- | |
81 | - matrix: | |
82 | - only: | |
83 | - - configuration: Release | |
84 | - BUILD_NUGET: yes | |
85 | - before_build: | |
86 | - cmd: echo. | |
87 | - build_script: | |
88 | - ps: | | |
89 | - $nuspecPath = "projects\nuget\iutest.nuspec" | |
90 | - Write-Output "Building NuGet package" | |
91 | - nuget pack $nuspecPath -OutputDirectory ".\" | |
92 | - test: off | |
93 | 121 | # Cygwin |
94 | 122 | - |
95 | 123 | matrix: |
@@ -108,10 +136,9 @@ | ||
108 | 136 | g++ --version; clang++ --version; python --version |
109 | 137 | @echo. > foo.h && g++ -std=c++1z -dM -E -x c++ foo.h |
110 | 138 | uname |
111 | - make | |
139 | + make -j4 | |
112 | 140 | test_script: |
113 | - cmd: | | |
114 | - make test | |
141 | + cmd: make test | |
115 | 142 | # MINGW |
116 | 143 | - |
117 | 144 | matrix: |
@@ -127,12 +154,74 @@ | ||
127 | 154 | cd test |
128 | 155 | g++ --version |
129 | 156 | @echo. > foo.h && g++ -std=c++1z -dM -E -x c++ foo.h |
130 | - mingw32-make USE_GNU_EXTENSION=1 %MAKE_OPTIONS% | |
131 | - mingw32-make clean | |
132 | - mingw32-make %MAKE_OPTIONS% | |
157 | + mingw32-make -j4 %MAKE_OPTIONS% | |
133 | 158 | test_script: |
134 | 159 | cmd: mingw32-make test %MAKE_OPTIONS% |
135 | - | |
160 | +# NAMKE | |
161 | +- | |
162 | + matrix: | |
163 | + only: | |
164 | + - configuration: Release | |
165 | + BUILD_NMAKE: yes | |
166 | + before_build: | |
167 | + cmd: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd.bat"' | |
168 | + build_script: | |
169 | + cmd: cd test && nmake | |
170 | + test_script: | |
171 | + cmd: nmake test | |
172 | +# Prefast | |
173 | +- | |
174 | + matrix: | |
175 | + only: | |
176 | + - configuration: Debug | |
177 | + BUILD_PREFAST: yes | |
178 | + environment: | |
179 | + MSBUILD_LOGGER_OPTION: /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" | |
180 | + MSBUILD_PREFAST_OPTION: /p:RunCodeAnalysis=true /p:EnablePREfast=true /p:CodeAnalysisTreatWarningsAsErrors=true | |
181 | + before_build: | |
182 | + cmd: echo. | |
183 | + build_script: | |
184 | + cmd: msbuild "projects\%PROJECT_DIR%\iutest_sample.vcxproj" /m %MSBUILD_LOGGER_OPTION% %MSBUILD_PREFAST_OPTION% | |
185 | + test: off | |
186 | +# Menu | |
187 | +- | |
188 | + matrix: | |
189 | + only: | |
190 | + - configuration: Release | |
191 | + BUILD_MENU: yes | |
192 | + before_build: | |
193 | + cmd: echo. | |
194 | + build: | |
195 | + project: samples\windows\iutest_windows_sample.sln | |
196 | + parallel: true | |
197 | + verbosity: minimal | |
198 | + test: off | |
199 | +# Package Build | |
200 | +- | |
201 | + matrix: | |
202 | + only: | |
203 | + - configuration: Release | |
204 | + BUILD_PACKAGE: yes | |
205 | + before_build: | |
206 | + cmd: echo. | |
207 | + build_script: | |
208 | + sh: bash ./.ci/make-package.sh | |
209 | + test: off | |
210 | +# NuGet | |
211 | +- | |
212 | + matrix: | |
213 | + only: | |
214 | + - configuration: Release | |
215 | + BUILD_NUGET: yes | |
216 | + before_build: | |
217 | + cmd: echo. | |
218 | + build_script: | |
219 | + ps: | | |
220 | + $nuspecPath = "projects\nuget\iutest.nuspec" | |
221 | + Write-Output "Building NuGet package" | |
222 | + nuget pack $nuspecPath -OutputDirectory ".\" | |
223 | + test: off | |
224 | + | |
136 | 225 | on_failure: |
137 | 226 | ps: | |
138 | 227 | # rdp |
@@ -5,6 +5,7 @@ | ||
5 | 5 | - master |
6 | 6 | - develop |
7 | 7 | - azure-pipelines/* |
8 | + - azurepipelines/* | |
8 | 9 | paths: |
9 | 10 | exclude: |
10 | 11 | - "*.md" |
@@ -23,6 +24,12 @@ | ||
23 | 24 | - Jenkinsfile |
24 | 25 | - .editorconfig |
25 | 26 | |
27 | +pr: | |
28 | + branches: | |
29 | + include: | |
30 | + - master | |
31 | + - develop | |
32 | + | |
26 | 33 | jobs: |
27 | 34 | - job: syntax_test |
28 | 35 | pool: |
@@ -1,6 +1,6 @@ | ||
1 | 1 | - pipeline: "build-arm-none-eabi" |
2 | 2 | trigger_mode: "ON_EVERY_PUSH" |
3 | - ref_name: "(^(master|develop)*$)" | |
3 | + ref_name: "(^(master|develop|buddy/)*$)" | |
4 | 4 | ref_type: "WILDCARD" |
5 | 5 | # always_from_scratch: true |
6 | 6 | auto_clear_cache: true |
@@ -18,7 +18,7 @@ | ||
18 | 18 | docker_image_name: "srzzumix/arm-none-eabi-gcc-with-python" |
19 | 19 | docker_image_tag: "latest" |
20 | 20 | execute_commands: |
21 | - - "export PATH=$PATH:/usr/local/bin/gcc-arm-none-eabi-7-2017-q4-major/bin" | |
21 | + - "export PATH=$PATH:/usr/local/bin/gcc-arm-none-eabi-8-2018-q4-major/bin" | |
22 | 22 | - "arm-none-eabi-gcc --version" |
23 | 23 | - "cd test" |
24 | 24 | - "make CC=arm-none-eabi-gcc CXX=arm-none-eabi-g++ showcxxversion showcxxmacros DEFS=\"--specs=nosys.specs -mthumb -mcpu=cortex-m3\"" |
@@ -26,6 +26,8 @@ | ||
26 | 26 | mount_filesystem_path: "/buddy/iutest" |
27 | 27 | shell: "BASH" |
28 | 28 | trigger_condition: "ALWAYS" |
29 | + | |
30 | +# google test version detect test | |
29 | 31 | - pipeline: "gtest-version" |
30 | 32 | trigger_mode: "SCHEDULED" |
31 | 33 | ref_name: "develop" |
@@ -181,9 +183,11 @@ | ||
181 | 183 | mount_filesystem_path: "/buddy/iutest" |
182 | 184 | shell: "SH" |
183 | 185 | trigger_condition: "ALWAYS" |
186 | + | |
187 | +# released google test compatible test | |
184 | 188 | - pipeline: "gtest-compatible-released" |
185 | 189 | trigger_mode: "ON_EVERY_PUSH" |
186 | - ref_name: "master" | |
190 | + ref_name: "(^(master|buddy/)*$)" | |
187 | 191 | ref_type: "BRANCH" |
188 | 192 | actions: |
189 | 193 | - action: "release-1.8.1" |
@@ -2,7 +2,7 @@ | ||
2 | 2 | //----------------------------------------------------------------------- |
3 | 3 | /** |
4 | 4 | * @file iutest_switch_core.hpp |
5 | - * @brief コア機能定義切り替え ファイル | |
5 | + * @brief iutest|gtest core feature switch | |
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
@@ -153,7 +153,7 @@ | ||
153 | 153 | #define IUTEST_FRIEND_TYPED_TEST_P_DECLARATION(test_case_name, test_name) \ |
154 | 154 | namespace GTEST_SUITE_NAMESPACE_(test_case_name) { template<typename T>class test_name; } |
155 | 155 | #define IUTEST_FRIEND_TYPED_TEST_P(test_case_name, test_name) \ |
156 | - template<typename T>friend class GTEST_SUITE_NAMESPACE_(test_case_name)::test_name | |
156 | + template<typename T>friend class GTEST_SUITE_NAMESPACE_(test_case_name)::test_name | |
157 | 157 | #define IUTEST_SCOPED_TRACE SCOPED_TRACE |
158 | 158 | #define IUTEST_FLAG GTEST_FLAG |
159 | 159 |
@@ -227,7 +227,7 @@ | ||
227 | 227 | |
228 | 228 | inline iusupport::AssertionResultFailure AssertionFailure() |
229 | 229 | { |
230 | - return iusupport::AssertionResultFailure(); | |
230 | + return iusupport::AssertionResultFailure(); | |
231 | 231 | } |
232 | 232 | |
233 | 233 | } // end of namespace testing |
@@ -2,11 +2,11 @@ | ||
2 | 2 | //----------------------------------------------------------------------- |
3 | 3 | /** |
4 | 4 | * @file iutest_switch_filepath.hpp |
5 | - * @brief FilePath 切り替え ファイル | |
5 | + * @brief iutest|gtest FilePath switch | |
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
9 | - * Copyright (C) 2013-2016, Takazumi Shirayanagi\n | |
9 | + * Copyright (C) 2013-2019, Takazumi Shirayanagi\n | |
10 | 10 | * This software is released under the new BSD License, |
11 | 11 | * see LICENSE |
12 | 12 | */ |
@@ -24,19 +24,19 @@ | ||
24 | 24 | { |
25 | 25 | |
26 | 26 | inline bool operator == (const FilePath& lhs |
27 | - , const FilePath& rhs) | |
27 | + , const FilePath& rhs) | |
28 | 28 | { |
29 | 29 | return posix::StrCaseCmp(lhs.c_str(), rhs.c_str()) == 0; |
30 | 30 | } |
31 | 31 | |
32 | 32 | inline bool operator == (const FilePath& lhs |
33 | - , const char* rhs) | |
33 | + , const char* rhs) | |
34 | 34 | { |
35 | 35 | return posix::StrCaseCmp(lhs.c_str(), rhs) == 0; |
36 | 36 | } |
37 | 37 | |
38 | 38 | inline bool operator == (const char* lhs |
39 | - , const FilePath& rhs) | |
39 | + , const FilePath& rhs) | |
40 | 40 | { |
41 | 41 | return posix::StrCaseCmp(lhs, rhs.c_str()) == 0; |
42 | 42 | } |
@@ -0,0 +1,25 @@ | ||
1 | +{ | |
2 | + "name": "iutest", | |
3 | + "version": "1.0.0", | |
4 | + "description": "", | |
5 | + "dependencies": {}, | |
6 | + "devDependencies": { | |
7 | + "eclint": "^2.8.1", | |
8 | + "editorconfig-checker": "^1.3.3" | |
9 | + }, | |
10 | + "scripts": { | |
11 | + "lint:editorconfig": "editorconfig-checker --exclude-regexp \"\\.sln|\\..*proj\" .", | |
12 | + "lint:editorconfig-cpp": "editorconfig-checker src include", | |
13 | + "eclint": "eclint check * ./include" | |
14 | + }, | |
15 | + "repository": { | |
16 | + "type": "git", | |
17 | + "url": "git+https://github.com/srz-zumix/iutest.git" | |
18 | + }, | |
19 | + "author": "srz_zumix", | |
20 | + "license": "BSD-3-Clause", | |
21 | + "bugs": { | |
22 | + "url": "https://github.com/srz-zumix/iutest/issues" | |
23 | + }, | |
24 | + "homepage": "https://github.com/srz-zumix/iutest#readme" | |
25 | +} |
@@ -7,8 +7,11 @@ | ||
7 | 7 | parallelized_test: true |
8 | 8 | |
9 | 9 | branches: |
10 | - except: | |
11 | - - gh-pages | |
10 | + only: | |
11 | + - master | |
12 | + - develop | |
13 | + - feature/* | |
14 | + - shippable/* | |
12 | 15 | |
13 | 16 | build: |
14 | 17 | ci: |
@@ -81,6 +81,7 @@ | ||
81 | 81 | NAMESPACETESTS_TARGET=namespace_tests |
82 | 82 | |
83 | 83 | TARGETS1= \ |
84 | + also_run_disabled_tests \ | |
84 | 85 | assertion_return_tests \ |
85 | 86 | assume_tests \ |
86 | 87 | break_on_failure_nobreak_tests \ |
@@ -34,7 +34,8 @@ | ||
34 | 34 | !include <CommonMakefile.in> |
35 | 35 | |
36 | 36 | RUN_TARGETS = $(ALLTESTS_TARGET) $(EXTENSIONTESTS_TARGET) $(NAMESPACETESTS_TARGET) $(TARGETS1) $(TARGETS2) $(TARGETS_IUTEST_ONLY) |
37 | -BUILD_TARGETS = $(RUN_TARGETS) $(BUILD_ONLY) $(COMPILEERROR_TARGETS) | |
37 | +BUILD_TARGETS = $(RUN_TARGETS) $(BUILD_ONLY) | |
38 | +# BUILD_TARGETS = $(RUN_TARGETS) $(BUILD_ONLY) $(COMPILEERROR_TARGETS) | |
38 | 39 | TARGETS = $(BUILD_TARGETS) |
39 | 40 | |
40 | 41 | NAMESPACETESTS_TEST_SRCS = $(ALLTESTS_TEST_SRCS:.cpp=.ns.cpp) |
@@ -63,12 +64,12 @@ | ||
63 | 64 | showcxxversion: |
64 | 65 | -$(CXX) |
65 | 66 | |
66 | -$(RUNNER) : $(@:_run=) | |
67 | +$(RUNNER) : $(@:_tests_run=_tests) | |
67 | 68 | @echo $@ |
68 | 69 | !ifdef OUTPUTXML |
69 | - $(@:_run=) $(RUN_OPTION) --iutest_output=xml:$<.xml | |
70 | + $< $(RUN_OPTION) --iutest_output=xml:$<.xml | |
70 | 71 | !else |
71 | - $(@:_run=) $(RUN_OPTION) | |
72 | + $< $(RUN_OPTION) | |
72 | 73 | !endif |
73 | 74 | |
74 | 75 | # |
@@ -0,0 +1,47 @@ | ||
1 | +//====================================================================== | |
2 | +//----------------------------------------------------------------------- | |
3 | +/** | |
4 | + * @file also_run_disabled_tests.cpp | |
5 | + * @brief also_run_disabled_tests option test | |
6 | + * | |
7 | + * @author t.shirayanagi | |
8 | + * @par copyright | |
9 | + * Copyright (C) 2019, Takazumi Shirayanagi\n | |
10 | + * This software is released under the new BSD License, | |
11 | + * see LICENSE | |
12 | +*/ | |
13 | +//----------------------------------------------------------------------- | |
14 | +//====================================================================== | |
15 | + | |
16 | +//====================================================================== | |
17 | +// include | |
18 | +#include "iutest.hpp" | |
19 | +#include "disabled_testcases.cpp" | |
20 | + | |
21 | +#ifdef UNICODE | |
22 | +int wmain(int argc, wchar_t* argv[]) | |
23 | +#else | |
24 | +int main(int argc, char* argv[]) | |
25 | +#endif | |
26 | +{ | |
27 | + IUTEST_INIT(&argc, argv); | |
28 | +#if defined(OUTPUTXML) | |
29 | + // 失敗テストを含むので xml 出力しない | |
30 | + ::iutest::IUTEST_FLAG(output) = NULL; | |
31 | +#endif | |
32 | + ::iutest::IUTEST_FLAG(also_run_disabled_tests) = true; | |
33 | + const int ret = IUTEST_RUN_ALL_TESTS(); | |
34 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->disabled_test_count() == expected_disable_test_count ); | |
35 | +#if !defined(IUTEST_USE_GTEST) || (defined(GTEST_MINOR) && GTEST_MINOR >= 0x07) | |
36 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->reportable_disabled_test_count() == expected_disable_test_count ); | |
37 | +#endif | |
38 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->test_to_run_count() == expected_test_count ); | |
39 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->failed_test_count() == expected_disable_test_count ); | |
40 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->total_test_count() == expected_test_count ); | |
41 | +#if !defined(IUTEST_USE_GTEST) | |
42 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->skip_test_count() == 0 ); | |
43 | +#endif | |
44 | + if( ret == 0 ) return 1; | |
45 | + printf("*** Successful ***\n"); | |
46 | + return 0; | |
47 | +} |
@@ -6,7 +6,7 @@ | ||
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
9 | - * Copyright (C) 2018, Takazumi Shirayanagi\n | |
9 | + * Copyright (C) 2018-2019, Takazumi Shirayanagi\n | |
10 | 10 | * This software is released under the new BSD License, |
11 | 11 | * see LICENSE |
12 | 12 | */ |
@@ -59,16 +59,15 @@ | ||
59 | 59 | const int ret = IUTEST_RUN_ALL_TESTS(); |
60 | 60 | if( ret != 0 ) return 1; |
61 | 61 | #if IUTEST_HAS_STREAM_BUFFER && IUTEST_HAS_ASSERTION_RETURN |
62 | - IUTEST_ASSERT_STRIN("Unable to open file \"testdata/not-exist?.csv\".", stderr_capture.GetStreamString()) | |
62 | + ::std::string stderr_message = stderr_capture.GetStreamString(); | |
63 | + IUTEST_ASSERT_STRIN("Unable to open file \"testdata/not-exist?.csv\".", stderr_message) | |
63 | 64 | << ::iutest::AssertionReturn<int>(1); |
64 | - IUTEST_ASSERT_STRIN( | |
65 | 65 | #if IUTEST_HAS_FOPEN |
66 | - "Empty params file " | |
66 | + IUTEST_ASSERT_STRIN("Empty params file " "\"testdata/empty.csv\".", stderr_message) | |
67 | 67 | #else |
68 | - "Unable to open file " | |
68 | + IUTEST_ASSERT_STRIN("Unable to open file " "\"testdata/empty.csv\".", stderr_message) | |
69 | 69 | #endif |
70 | - "\"testdata/empty.csv\".", stderr_capture.GetStreamString() | |
71 | - ) << ::iutest::AssertionReturn<int>(1); | |
70 | + << ::iutest::AssertionReturn<int>(1); | |
72 | 71 | #endif |
73 | 72 | printf("*** Successful ***\n"); |
74 | 73 | #else |
@@ -0,0 +1,196 @@ | ||
1 | +//====================================================================== | |
2 | +//----------------------------------------------------------------------- | |
3 | +/** | |
4 | + * @file disabled_testcases.cpp | |
5 | + * @brief disabled tests testcase definitions | |
6 | + * | |
7 | + * @author t.shirayanagi | |
8 | + * @par copyright | |
9 | + * Copyright (C) 2019, Takazumi Shirayanagi\n | |
10 | + * This software is released under the new BSD License, | |
11 | + * see LICENSE | |
12 | +*/ | |
13 | +//----------------------------------------------------------------------- | |
14 | +//====================================================================== | |
15 | + | |
16 | +//====================================================================== | |
17 | +// include | |
18 | +#include "iutest.hpp" | |
19 | + | |
20 | +IUTEST(DISABLED_Foo, Bar) | |
21 | +{ | |
22 | + IUTEST_ASSERT_EQ(2, 3); | |
23 | +} | |
24 | + | |
25 | +IUTEST(Foo, DISABLED_Bar) | |
26 | +{ | |
27 | + IUTEST_ASSERT_EQ(2, 3); | |
28 | +} | |
29 | + | |
30 | +IUTEST(Foo, Bar) | |
31 | +{ | |
32 | + IUTEST_ASSERT_EQ(3, 3); | |
33 | +} | |
34 | + | |
35 | +IUTEST(Foo, Bar_DISABLED_) | |
36 | +{ | |
37 | + IUTEST_ASSERT_EQ(3, 3); | |
38 | +} | |
39 | + | |
40 | +#if IUTEST_HAS_PARAM_TEST | |
41 | + | |
42 | +class FooP : public ::iutest::TestWithParam< int > | |
43 | +{ | |
44 | +}; | |
45 | + | |
46 | +typedef FooP FooP_DISABLED_; | |
47 | +typedef FooP DISABLED_FooP; | |
48 | + | |
49 | +IUTEST_P(FooP_DISABLED_, Bar) | |
50 | +{ | |
51 | +} | |
52 | + | |
53 | +IUTEST_P(FooP, DISABLED_Bar) | |
54 | +{ | |
55 | + int v = GetParam(); | |
56 | + IUTEST_FAIL() << v; | |
57 | +} | |
58 | + | |
59 | +IUTEST_P(DISABLED_FooP, Bar) | |
60 | +{ | |
61 | + int v = GetParam(); | |
62 | + IUTEST_FAIL() << v; | |
63 | +} | |
64 | + | |
65 | +IUTEST_INSTANTIATE_TEST_CASE_P(A, FooP, ::iutest::Values(0, 2)); | |
66 | +IUTEST_INSTANTIATE_TEST_CASE_P(A, FooP_DISABLED_, ::iutest::Values(0, 2)); | |
67 | +IUTEST_INSTANTIATE_TEST_CASE_P(A, DISABLED_FooP , ::iutest::Values(0, 2)); | |
68 | + | |
69 | +#endif | |
70 | + | |
71 | +#if IUTEST_HAS_PARAM_METHOD_TEST | |
72 | + | |
73 | +void TestFunction(int x, int y) | |
74 | +{ | |
75 | + IUTEST_ASSERT_EQ(x, y); | |
76 | +} | |
77 | + | |
78 | +IUTEST_PMZ(ParamMethod_Foo_DISABLED_, EQ, TestFunction, 0, 0); | |
79 | +IUTEST_PMZ(ParamMethod_Foo, DISABLED_EQ, TestFunction, 0, 1); | |
80 | +IUTEST_PMZ(DISABLED_ParamMethod_Foo, EQ, TestFunction, 0, 1); | |
81 | + | |
82 | +class ParamMethodF_Foo : public ::iutest::Test {}; | |
83 | +typedef ParamMethodF_Foo ParamMethodF_Foo_DISABLED_; | |
84 | +typedef ParamMethodF_Foo DISABLED_ParamMethodF_Foo; | |
85 | + | |
86 | +IUTEST_PMZ_F(ParamMethodF_Foo_DISABLED_, EQ, TestFunction, 0, 0); | |
87 | +IUTEST_PMZ_F(ParamMethodF_Foo, DISABLED_EQ, TestFunction, 0, 1); | |
88 | +IUTEST_PMZ_F(DISABLED_ParamMethodF_Foo, EQ, TestFunction, 0, 1); | |
89 | + | |
90 | +#endif | |
91 | + | |
92 | +#if IUTEST_HAS_TYPED_TEST | |
93 | + | |
94 | +template<typename T> | |
95 | +class TypedFoo : public ::iutest::Test {}; | |
96 | +template<typename T> | |
97 | +class TypedFoo_DISABLED_ : public ::iutest::Test {}; | |
98 | +template<typename T> | |
99 | +class DISABLED_TypedFoo : public ::iutest::Test {}; | |
100 | + | |
101 | +typedef ::iutest::Types<int> TypedTestTypes; | |
102 | +IUTEST_TYPED_TEST_CASE(TypedFoo, TypedTestTypes); | |
103 | +IUTEST_TYPED_TEST_CASE(TypedFoo_DISABLED_, TypedTestTypes); | |
104 | +IUTEST_TYPED_TEST_CASE(DISABLED_TypedFoo , TypedTestTypes); | |
105 | + | |
106 | +IUTEST_TYPED_TEST(TypedFoo_DISABLED_, Bar) | |
107 | +{ | |
108 | +} | |
109 | + | |
110 | +IUTEST_TYPED_TEST(TypedFoo, DISABLED_Bar) | |
111 | +{ | |
112 | + IUTEST_FAIL(); | |
113 | +} | |
114 | + | |
115 | +IUTEST_TYPED_TEST(DISABLED_TypedFoo, Bar) | |
116 | +{ | |
117 | + IUTEST_FAIL(); | |
118 | +} | |
119 | + | |
120 | +#endif | |
121 | + | |
122 | +#if IUTEST_HAS_TYPED_TEST_P | |
123 | + | |
124 | +template<typename T> | |
125 | +class TypePFoo : public ::iutest::Test {}; | |
126 | +template<typename T> | |
127 | +class TypedPFoo_DISABLED_ : public ::iutest::Test {}; | |
128 | +template<typename T> | |
129 | +class DISABLED_TypedPFoo : public ::iutest::Test {}; | |
130 | + | |
131 | +IUTEST_TYPED_TEST_CASE_P(TypePFoo); | |
132 | +IUTEST_TYPED_TEST_CASE_P(TypedPFoo_DISABLED_); | |
133 | +IUTEST_TYPED_TEST_CASE_P(DISABLED_TypedPFoo); | |
134 | + | |
135 | +IUTEST_TYPED_TEST_P(TypedPFoo_DISABLED_, Bar) | |
136 | +{ | |
137 | +} | |
138 | + | |
139 | +IUTEST_TYPED_TEST_P(TypePFoo, DISABLED_Bar) | |
140 | +{ | |
141 | + IUTEST_FAIL(); | |
142 | +} | |
143 | + | |
144 | +IUTEST_TYPED_TEST_P(DISABLED_TypedPFoo, Bar) | |
145 | +{ | |
146 | + IUTEST_FAIL(); | |
147 | +} | |
148 | + | |
149 | +IUTEST_REGISTER_TYPED_TEST_CASE_P(TypedPFoo_DISABLED_, Bar); | |
150 | +IUTEST_REGISTER_TYPED_TEST_CASE_P(TypePFoo, DISABLED_Bar); | |
151 | +IUTEST_REGISTER_TYPED_TEST_CASE_P(DISABLED_TypedPFoo, Bar); | |
152 | + | |
153 | +IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, TypedPFoo_DISABLED_, int); | |
154 | +IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, TypePFoo, int); | |
155 | +IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, DISABLED_TypedPFoo, int); | |
156 | + | |
157 | +#endif | |
158 | + | |
159 | +int GetExpectedTestCount() | |
160 | +{ | |
161 | + int expected_test_count = 4; | |
162 | +#if IUTEST_HAS_PARAM_TEST | |
163 | + expected_test_count += 6; | |
164 | +#endif | |
165 | +#if IUTEST_HAS_PARAM_METHOD_TEST | |
166 | + expected_test_count += 6; | |
167 | +#endif | |
168 | +#if IUTEST_HAS_TYPED_TEST | |
169 | + expected_test_count += 3; | |
170 | +#endif | |
171 | +#if IUTEST_HAS_TYPED_TEST_P | |
172 | + expected_test_count += 3; | |
173 | +#endif | |
174 | + return expected_test_count; | |
175 | +} | |
176 | + | |
177 | +int GetExpectedDisableTestCount() | |
178 | +{ | |
179 | + int expected_disable_test_count = 2; | |
180 | +#if IUTEST_HAS_PARAM_TEST | |
181 | + expected_disable_test_count += 4; | |
182 | +#endif | |
183 | +#if IUTEST_HAS_PARAM_METHOD_TEST | |
184 | + expected_disable_test_count += 4; | |
185 | +#endif | |
186 | +#if IUTEST_HAS_TYPED_TEST | |
187 | + expected_disable_test_count += 2; | |
188 | +#endif | |
189 | +#if IUTEST_HAS_TYPED_TEST_P | |
190 | + expected_disable_test_count += 2; | |
191 | +#endif | |
192 | + return expected_disable_test_count; | |
193 | +} | |
194 | + | |
195 | +static const int expected_test_count = GetExpectedTestCount(); | |
196 | +static const int expected_disable_test_count = GetExpectedDisableTestCount(); |
@@ -2,11 +2,11 @@ | ||
2 | 2 | //----------------------------------------------------------------------- |
3 | 3 | /** |
4 | 4 | * @file disabled_tests.cpp |
5 | - * @brief also_run_disabled_tests 対応テスト | |
5 | + * @brief also_run_disabled_tests option test | |
6 | 6 | * |
7 | 7 | * @author t.shirayanagi |
8 | 8 | * @par copyright |
9 | - * Copyright (C) 2012-2016, Takazumi Shirayanagi\n | |
9 | + * Copyright (C) 2012-2019, Takazumi Shirayanagi\n | |
10 | 10 | * This software is released under the new BSD License, |
11 | 11 | * see LICENSE |
12 | 12 | */ |
@@ -16,147 +16,8 @@ | ||
16 | 16 | //====================================================================== |
17 | 17 | // include |
18 | 18 | #include "iutest.hpp" |
19 | +#include "disabled_testcases.cpp" | |
19 | 20 | |
20 | -IUTEST(DISABLED_Foo, Bar) | |
21 | -{ | |
22 | - IUTEST_ASSERT_EQ(2, 3); | |
23 | -} | |
24 | - | |
25 | -IUTEST(Foo, DISABLED_Bar) | |
26 | -{ | |
27 | - IUTEST_ASSERT_EQ(2, 3); | |
28 | -} | |
29 | - | |
30 | -IUTEST(Foo, Bar) | |
31 | -{ | |
32 | - IUTEST_ASSERT_EQ(3, 3); | |
33 | -} | |
34 | - | |
35 | -IUTEST(Foo, Bar_DISABLED_) | |
36 | -{ | |
37 | - IUTEST_ASSERT_EQ(3, 3); | |
38 | -} | |
39 | - | |
40 | -#if IUTEST_HAS_PARAM_TEST | |
41 | - | |
42 | -class FooP : public ::iutest::TestWithParam< int > | |
43 | -{ | |
44 | -}; | |
45 | - | |
46 | -typedef FooP FooP_DISABLED_; | |
47 | -typedef FooP DISABLED_FooP; | |
48 | - | |
49 | -IUTEST_P(FooP_DISABLED_, Bar) | |
50 | -{ | |
51 | -} | |
52 | - | |
53 | -IUTEST_P(FooP, DISABLED_Bar) | |
54 | -{ | |
55 | - int v = GetParam(); | |
56 | - IUTEST_FAIL() << v; | |
57 | -} | |
58 | - | |
59 | -IUTEST_P(DISABLED_FooP, Bar) | |
60 | -{ | |
61 | - int v = GetParam(); | |
62 | - IUTEST_FAIL() << v; | |
63 | -} | |
64 | - | |
65 | -IUTEST_INSTANTIATE_TEST_CASE_P(A, FooP, ::iutest::Values(0, 2)); | |
66 | -IUTEST_INSTANTIATE_TEST_CASE_P(A, FooP_DISABLED_, ::iutest::Values(0, 2)); | |
67 | -IUTEST_INSTANTIATE_TEST_CASE_P(A, DISABLED_FooP , ::iutest::Values(0, 2)); | |
68 | - | |
69 | -#endif | |
70 | - | |
71 | -#if IUTEST_HAS_PARAM_METHOD_TEST | |
72 | - | |
73 | -void TestFunction(int x, int y) | |
74 | -{ | |
75 | - IUTEST_ASSERT_EQ(x, y); | |
76 | -} | |
77 | - | |
78 | -IUTEST_PMZ(ParamMethod_Foo_DISABLED_, EQ, TestFunction, 0, 0); | |
79 | -IUTEST_PMZ(ParamMethod_Foo, DISABLED_EQ, TestFunction, 0, 1); | |
80 | -IUTEST_PMZ(DISABLED_ParamMethod_Foo, EQ, TestFunction, 0, 1); | |
81 | - | |
82 | -class ParamMethodF_Foo : public ::iutest::Test {}; | |
83 | -typedef ParamMethodF_Foo ParamMethodF_Foo_DISABLED_; | |
84 | -typedef ParamMethodF_Foo DISABLED_ParamMethodF_Foo; | |
85 | - | |
86 | -IUTEST_PMZ_F(ParamMethodF_Foo_DISABLED_, EQ, TestFunction, 0, 0); | |
87 | -IUTEST_PMZ_F(ParamMethodF_Foo, DISABLED_EQ, TestFunction, 0, 1); | |
88 | -IUTEST_PMZ_F(DISABLED_ParamMethodF_Foo, EQ, TestFunction, 0, 1); | |
89 | - | |
90 | -#endif | |
91 | - | |
92 | -#if IUTEST_HAS_TYPED_TEST | |
93 | - | |
94 | -template<typename T> | |
95 | -class TypedFoo : public ::iutest::Test {}; | |
96 | -template<typename T> | |
97 | -class TypedFoo_DISABLED_ : public ::iutest::Test {}; | |
98 | -template<typename T> | |
99 | -class DISABLED_TypedFoo : public ::iutest::Test {}; | |
100 | - | |
101 | -typedef ::iutest::Types<int> TypedTestTypes; | |
102 | -IUTEST_TYPED_TEST_CASE(TypedFoo, TypedTestTypes); | |
103 | -IUTEST_TYPED_TEST_CASE(TypedFoo_DISABLED_, TypedTestTypes); | |
104 | -IUTEST_TYPED_TEST_CASE(DISABLED_TypedFoo , TypedTestTypes); | |
105 | - | |
106 | -IUTEST_TYPED_TEST(TypedFoo_DISABLED_, Bar) | |
107 | -{ | |
108 | -} | |
109 | - | |
110 | -IUTEST_TYPED_TEST(TypedFoo, DISABLED_Bar) | |
111 | -{ | |
112 | - IUTEST_FAIL(); | |
113 | -} | |
114 | - | |
115 | -IUTEST_TYPED_TEST(DISABLED_TypedFoo, Bar) | |
116 | -{ | |
117 | - IUTEST_FAIL(); | |
118 | -} | |
119 | - | |
120 | -#endif | |
121 | - | |
122 | -#if IUTEST_HAS_TYPED_TEST_P | |
123 | - | |
124 | -template<typename T> | |
125 | -class TypePFoo : public ::iutest::Test {}; | |
126 | -template<typename T> | |
127 | -class TypedPFoo_DISABLED_ : public ::iutest::Test {}; | |
128 | -template<typename T> | |
129 | -class DISABLED_TypedPFoo : public ::iutest::Test {}; | |
130 | - | |
131 | -IUTEST_TYPED_TEST_CASE_P(TypePFoo); | |
132 | -IUTEST_TYPED_TEST_CASE_P(TypedPFoo_DISABLED_); | |
133 | -IUTEST_TYPED_TEST_CASE_P(DISABLED_TypedPFoo); | |
134 | - | |
135 | -IUTEST_TYPED_TEST_P(TypedPFoo_DISABLED_, Bar) | |
136 | -{ | |
137 | -} | |
138 | - | |
139 | -IUTEST_TYPED_TEST_P(TypePFoo, DISABLED_Bar) | |
140 | -{ | |
141 | - IUTEST_FAIL(); | |
142 | -} | |
143 | - | |
144 | -IUTEST_TYPED_TEST_P(DISABLED_TypedPFoo, Bar) | |
145 | -{ | |
146 | - IUTEST_FAIL(); | |
147 | -} | |
148 | - | |
149 | -IUTEST_REGISTER_TYPED_TEST_CASE_P(TypedPFoo_DISABLED_, Bar); | |
150 | -IUTEST_REGISTER_TYPED_TEST_CASE_P(TypePFoo, DISABLED_Bar); | |
151 | -IUTEST_REGISTER_TYPED_TEST_CASE_P(DISABLED_TypedPFoo, Bar); | |
152 | - | |
153 | -IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, TypedPFoo_DISABLED_, int); | |
154 | -IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, TypePFoo, int); | |
155 | -IUTEST_INSTANTIATE_TYPED_TEST_CASE_P(A, DISABLED_TypedPFoo, int); | |
156 | - | |
157 | -#endif | |
158 | - | |
159 | - | |
160 | 21 | #ifdef UNICODE |
161 | 22 | int wmain(int argc, wchar_t* argv[]) |
162 | 23 | #else |
@@ -164,56 +25,13 @@ | ||
164 | 25 | #endif |
165 | 26 | { |
166 | 27 | IUTEST_INIT(&argc, argv); |
167 | -#if defined(OUTPUTXML) | |
168 | - // 失敗テストを含むので xml 出力しない | |
169 | - ::iutest::IUTEST_FLAG(output) = NULL; | |
170 | -#endif | |
171 | - int expected_disable_test_count = 2; | |
172 | - int expected_test_count = 4; | |
173 | -#if IUTEST_HAS_PARAM_TEST | |
174 | - expected_disable_test_count += 4; | |
175 | - expected_test_count += 6; | |
176 | -#endif | |
177 | -#if IUTEST_HAS_PARAM_METHOD_TEST | |
178 | - expected_disable_test_count += 4; | |
179 | - expected_test_count += 6; | |
180 | -#endif | |
181 | -#if IUTEST_HAS_TYPED_TEST | |
182 | - expected_disable_test_count += 2; | |
183 | - expected_test_count += 3; | |
184 | -#endif | |
185 | -#if IUTEST_HAS_TYPED_TEST_P | |
186 | - expected_disable_test_count += 2; | |
187 | - expected_test_count += 3; | |
188 | -#endif | |
189 | - | |
190 | - { | |
191 | - const int ret = IUTEST_RUN_ALL_TESTS(); | |
192 | - if( ret != 0 ) return 1; | |
193 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->disabled_test_count() == expected_disable_test_count ); | |
28 | + const int ret = IUTEST_RUN_ALL_TESTS(); | |
29 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->disabled_test_count() == expected_disable_test_count ); | |
194 | 30 | #if !defined(IUTEST_USE_GTEST) || (defined(GTEST_MINOR) && GTEST_MINOR >= 0x07) |
195 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->reportable_disabled_test_count() == expected_disable_test_count ); | |
31 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->reportable_disabled_test_count() == expected_disable_test_count ); | |
196 | 32 | #endif |
197 | 33 | #if !defined(IUTEST_USE_GTEST) |
198 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->skip_test_count() == expected_disable_test_count ); | |
34 | + IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->skip_test_count() == expected_disable_test_count ); | |
199 | 35 | #endif |
200 | - } | |
201 | - | |
202 | - { | |
203 | - ::iutest::IUTEST_FLAG(also_run_disabled_tests) = true; | |
204 | - const int ret = IUTEST_RUN_ALL_TESTS(); | |
205 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->disabled_test_count() == expected_disable_test_count ); | |
206 | -#if !defined(IUTEST_USE_GTEST) || (defined(GTEST_MINOR) && GTEST_MINOR >= 0x07) | |
207 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->reportable_disabled_test_count() == expected_disable_test_count ); | |
208 | -#endif | |
209 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->test_to_run_count() == expected_test_count ); | |
210 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->failed_test_count() == expected_disable_test_count ); | |
211 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->total_test_count() == expected_test_count ); | |
212 | -#if !defined(IUTEST_USE_GTEST) | |
213 | - IUTEST_ASSERT_EXIT( ::iutest::UnitTest::GetInstance()->skip_test_count() == 0 ); | |
214 | -#endif | |
215 | - if( ret == 0 ) return 1; | |
216 | - } | |
217 | - printf("*** Successful ***\n"); | |
218 | - return 0; | |
36 | + return ret; | |
219 | 37 | } |
@@ -1,7 +1,7 @@ | ||
1 | 1 | # |
2 | 2 | # Makefile |
3 | 3 | |
4 | -.PHONY: sample clean | |
4 | +.PHONY: sample clean editorconfig | |
5 | 5 | TOOLS=eval_line.py |
6 | 6 | |
7 | 7 | sample: $(TOOLS) Makefile |
@@ -9,3 +9,6 @@ | ||
9 | 9 | |
10 | 10 | clean: |
11 | 11 | rm -rf pp_inc.h |
12 | + | |
13 | +editorconfig: | |
14 | + python editorconfig-lint.py ../../.editorconfig |
@@ -0,0 +1,53 @@ | ||
1 | +#!/usr/bin/env python | |
2 | +# | |
3 | +# editorconfig-lint.py | |
4 | +# | |
5 | +# Copyright (C) 2019, Takazumi Shirayanagi | |
6 | +# This software is released under the new BSD License, | |
7 | +# see LICENSE | |
8 | +# | |
9 | + | |
10 | +import sys | |
11 | +import os | |
12 | + | |
13 | +try: | |
14 | + from configparser import ConfigParser | |
15 | +except ImportError: | |
16 | + from ConfigParser import SafeConfigParser as ConfigParser | |
17 | + | |
18 | + | |
19 | +class EditorConfig(object): | |
20 | + def __init__(self, path): | |
21 | + self.name = os.path.basename(path) | |
22 | + self.fp = open(path) | |
23 | + self.first_head = True | |
24 | + | |
25 | + def readline(self): | |
26 | + if self.first_head: | |
27 | + self.first_head = False | |
28 | + return '[global]\n' | |
29 | + return self.fp.readline() | |
30 | + | |
31 | + def __iter__(self): | |
32 | + return self | |
33 | + | |
34 | + def __next__(self): | |
35 | + line = self.readline() | |
36 | + if not line: | |
37 | + raise StopIteration | |
38 | + return line | |
39 | + | |
40 | + next = __next__ # For Python 2 compatibility. | |
41 | + | |
42 | + | |
43 | +def main(): | |
44 | + path = sys.argv[1] | |
45 | + ini = ConfigParser() | |
46 | + if not os.path.exists(path): | |
47 | + sys.stderr.write('%s not found...' % path) | |
48 | + sys.exit(2) | |
49 | + ini.readfp(EditorConfig(path)) | |
50 | + sys.exit(0) | |
51 | + | |
52 | +if __name__ == '__main__': | |
53 | + main() |
@@ -0,0 +1,2 @@ | ||
1 | +tmp/ | |
2 | +*.xml |
@@ -0,0 +1,49 @@ | ||
1 | +# | |
2 | +# Makefile | |
3 | + | |
4 | +TMPDIR=tmp | |
5 | +OUTDIR=$(TMPDIR)/files | |
6 | +INPUTDIR=$(TMPDIR)/inputs | |
7 | +INPUT_XML1=$(INPUTDIR)/unit_tests.xml | |
8 | +INPUT_XML2=$(INPUTDIR)/matcher_tests.xml | |
9 | +INPUT_XML_RECORD_PROPERTY=$(INPUTDIR)/record_property_tests.xml | |
10 | +INPUT_XML_DISABLED=$(INPUTDIR)/disabled_tests.xml | |
11 | +INPUT_XML_FAILURE=$(INPUTDIR)/no_failure_fail_tests.xml | |
12 | +INPUT_XMLS=$(INPUT_XML1) $(INPUT_XML2) $(INPUT_XML_RECORD_PROPERTY) $(INPUT_XML_DISABLED) $(INPUT_XML_FAILURE) | |
13 | +XML2FILE=xml2file.py | |
14 | +# XML2FILE_OPTION+=--verbose | |
15 | +# XML2FILE_OPTION+=--debug | |
16 | +XML2FILE_EXEC=python $(XML2FILE) $(XML2FILE_OPTION) | |
17 | +XMLTYPE=junit | |
18 | +# XMLTYPE=default | |
19 | + | |
20 | +.PHONY: default clean all | |
21 | + | |
22 | +default: xml2file | |
23 | + | |
24 | +all: clean default record_prop disabled failed multi | |
25 | + | |
26 | +clean: | |
27 | + rm -rf $(TMPDIR) | |
28 | + make -C ../../test clean | |
29 | + | |
30 | +xml2file: $(INPUT_XML1) $(XML2FILE) | |
31 | + $(XML2FILE_EXEC) -o $(OUTDIR) $(INPUT_XML1) | |
32 | + | |
33 | +record_prop: $(INPUT_XML_RECORD_PROPERTY) $(XML2FILE) | |
34 | + $(XML2FILE_EXEC) -o $(OUTDIR) $(INPUT_XML_RECORD_PROPERTY) | |
35 | + | |
36 | +disabled: $(INPUT_XML_DISABLED) $(XML2FILE) | |
37 | + $(XML2FILE_EXEC) -o $(OUTDIR) $(INPUT_XML_DISABLED) | |
38 | + | |
39 | +failed: $(INPUT_XML_FAILURE) $(XML2FILE) | |
40 | + $(XML2FILE_EXEC) -o $(OUTDIR) $(INPUT_XML_FAILURE) | |
41 | + | |
42 | +multi: $(INPUT_XML1) $(INPUT_XML2) $(XML2FILE) | |
43 | + $(XML2FILE_EXEC) -o $(OUTDIR) $(INPUT_XML1) $(INPUT_XML2) | |
44 | + | |
45 | +$(INPUT_XMLS): | |
46 | + make -C ../../test $(@:$(INPUTDIR)/%.xml=%) | |
47 | + make -C ../../test OUTPUTXML=$(XMLTYPE) run_$(@:$(INPUTDIR)/%.xml=%) | |
48 | + mkdir -p $(INPUTDIR) | |
49 | + cp ../../test/$(@:$(INPUTDIR)/%.xml=%.xml) $@ |
@@ -0,0 +1,199 @@ | ||
1 | +#!/usr/bin/env python | |
2 | +# | |
3 | +# xml2file.py | |
4 | +# | |
5 | +# Copyright (C) 2019, Takazumi Shirayanagi | |
6 | +# This software is released under the new BSD License, | |
7 | +# see LICENSE | |
8 | +# | |
9 | + | |
10 | +import os | |
11 | +import errno | |
12 | +import json | |
13 | +import codecs | |
14 | +import shutil | |
15 | +import xml.etree.ElementTree as ET | |
16 | + | |
17 | +from argparse import ArgumentParser | |
18 | + | |
19 | +# command line option | |
20 | +def parse_command_line(): | |
21 | + parser = ArgumentParser() | |
22 | + parser.add_argument( | |
23 | + '-v', | |
24 | + '--version', | |
25 | + action='version', | |
26 | + version=u'%(prog)s version 0.1' | |
27 | + ) | |
28 | + parser.add_argument( | |
29 | + '-o', | |
30 | + '--output', | |
31 | + default=None, | |
32 | + help='output file path.' | |
33 | + ) | |
34 | + parser.add_argument( | |
35 | + '--no-time', | |
36 | + action='store_true', | |
37 | + help='no output time attribute' | |
38 | + ) | |
39 | + parser.add_argument( | |
40 | + '--verbose', | |
41 | + action='store_true', | |
42 | + help='log verbose' | |
43 | + ) | |
44 | + parser.add_argument( | |
45 | + '--encoding', | |
46 | + default=None, | |
47 | + help='output file encoding.' | |
48 | + ) | |
49 | + parser.add_argument( | |
50 | + '--debug', | |
51 | + action='store_true', | |
52 | + help='log debug' | |
53 | + ) | |
54 | + parser.add_argument( | |
55 | + 'file', | |
56 | + metavar='FILE', | |
57 | + nargs='+', | |
58 | + help='test result xml files' | |
59 | + ) | |
60 | + options = parser.parse_args() | |
61 | + return options | |
62 | + | |
63 | +cmdline_options = None | |
64 | + | |
65 | + | |
66 | +def log(msg): | |
67 | + if cmdline_options.verbose: | |
68 | + print(msg) | |
69 | + | |
70 | + | |
71 | +def logd(msg): | |
72 | + if cmdline_options.debug: | |
73 | + print(msg) | |
74 | + | |
75 | + | |
76 | +def mkdir_p(path): | |
77 | + try: | |
78 | + os.makedirs(path) | |
79 | + except OSError as exc: # Python >2.5 | |
80 | + if exc.errno == errno.EEXIST and os.path.isdir(path): | |
81 | + pass | |
82 | + else: | |
83 | + raise | |
84 | + | |
85 | + | |
86 | +def clean_dir(path): | |
87 | + if os.path.exists(path): | |
88 | + shutil.rmtree(path) | |
89 | + | |
90 | + | |
91 | +def fopen(path): | |
92 | + dir = os.path.dirname(path) | |
93 | + mkdir_p(dir) | |
94 | + f = codecs.open(path, 'w', cmdline_options.encoding) | |
95 | + return f | |
96 | + | |
97 | + | |
98 | +def make_rootpath(xml_filename, testsuites): | |
99 | + # root_name = testsuites.attrib['name'] | |
100 | + root_name = xml_filename | |
101 | + path = os.path.join(cmdline_options.output, root_name) | |
102 | + return path | |
103 | + | |
104 | + | |
105 | +def make_path(root_path, testsuite, testcase): | |
106 | + suite_name = testsuite.attrib['name'] | |
107 | + case_name = testcase.attrib['name'] | |
108 | + ext = '.json' | |
109 | + return os.path.join(os.path.join(root_path, suite_name), case_name + ext) | |
110 | + | |
111 | + | |
112 | +def get_properties_node(node): | |
113 | + users = {} | |
114 | + for prop in node: | |
115 | + if ('name' in prop.attrib) and ('value' in prop.attrib): | |
116 | + users[prop.attrib['name']] = prop.attrib['value'] | |
117 | + return users | |
118 | + | |
119 | + | |
120 | +def _get_user_properties(node, system_attributes): | |
121 | + users = {} | |
122 | + for a in node.attrib: | |
123 | + if a not in system_attributes: | |
124 | + users[a] = node.attrib[a] | |
125 | + return users | |
126 | + | |
127 | + | |
128 | +def get_user_properties(node): | |
129 | + system_attributes = { | |
130 | + "testsuites": [ | |
131 | + "name", "tests", "failures", "disabled", "skip", "errors", "time", "timestamp", "random_seed" | |
132 | + ], | |
133 | + "testsuite": [ | |
134 | + "name", "tests", "failures", "disabled", "skip", "errors", "time", "timestamp", "random_seed" | |
135 | + ], | |
136 | + "testcase": [ | |
137 | + "name", "status", "time", "classname", "type_param", "value_param" | |
138 | + ] | |
139 | + } | |
140 | + for k,v in system_attributes.items(): | |
141 | + if node.tag == k: | |
142 | + return _get_user_properties(node, v) | |
143 | + return node.attrib | |
144 | + | |
145 | + | |
146 | +def write_result(f, testsuites_user_attrib, testsuite_user_attrib, testcase): | |
147 | + d = testcase.attrib | |
148 | + if cmdline_options.no_time: | |
149 | + if 'time' in d: | |
150 | + del d['time'] | |
151 | + d['testsuites_attrib'] = testsuites_user_attrib | |
152 | + d['testsuite_attrib'] = testsuite_user_attrib | |
153 | + # failure and skipped ... | |
154 | + for child in testcase: | |
155 | + tag = child.tag | |
156 | + if tag not in d: | |
157 | + d[tag] = [] | |
158 | + fd = child.attrib | |
159 | + fd['text'] = child.text | |
160 | + d[tag].append(fd) | |
161 | + jt = json.dumps(d, indent=4, ensure_ascii=False) | |
162 | + logd(jt) | |
163 | + f.write(jt) | |
164 | + | |
165 | + | |
166 | +def xml2file(path): | |
167 | + tree = ET.parse(path) | |
168 | + root = tree.getroot() | |
169 | + testsuites = root | |
170 | + | |
171 | + basename = os.path.basename(path) | |
172 | + filename = os.path.splitext(basename)[0] | |
173 | + root_path = make_rootpath(filename, testsuites) | |
174 | + clean_dir(root_path) | |
175 | + | |
176 | + log(basename) | |
177 | + testsuites_user_attrib = get_user_properties(testsuites) | |
178 | + for testsuite in testsuites: | |
179 | + log(" " + testsuite.attrib['name']) | |
180 | + testsuite_user_attrib = get_user_properties(testsuite) | |
181 | + for testcase in testsuite: | |
182 | + if testcase.tag == 'testcase': | |
183 | + log(" " + testcase.attrib['name']) | |
184 | + f = fopen(make_path(root_path, testsuite, testcase)) | |
185 | + write_result(f, testsuites_user_attrib, testsuite_user_attrib, testcase) | |
186 | + f.close() | |
187 | + elif testcase.tag == 'properties': | |
188 | + testsuite_user_attrib.update(get_properties_node(testcase)) | |
189 | + | |
190 | + | |
191 | +def main(): | |
192 | + global cmdline_options | |
193 | + cmdline_options = parse_command_line() | |
194 | + for path in cmdline_options.file: | |
195 | + xml2file(path) | |
196 | + | |
197 | + | |
198 | +if __name__ == '__main__': | |
199 | + main() |