srz-zumix / iutest Goto Github PK
View Code? Open in Web Editor NEWc++ testing framework
Home Page: http://iutest.osdn.jp/
License: BSD 3-Clause "New" or "Revised" License
c++ testing framework
Home Page: http://iutest.osdn.jp/
License: BSD 3-Clause "New" or "Revised" License
all_tests みたいに変更する
https://app.buddy.works/zumixcpp/iutest/pipelines/pipeline/128185/executions
まだビルドしかできてないので、qemu なりで実行できるようにする
現在
https://github.com/yumetodo/string_split
でiutest+shippableを利用しています。
iuwandbox.py ../../../test/test.cpp --boost nothing --default --encode utf-8-sig
のように--boost
を利用すると動きません。
D:\user\documents\git\string_split\iutest\tools\wandbox>iuwandbox.py ../../../te
st/test.cpp --boost 1.60 --default --encoding utf-8-sig -s
Traceback (most recent call last):
File "D:\user\documents\git\string_split\iutest\tools\wandbox\iuwandbox.py", l
ine 395, in <module>
main()
File "D:\user\documents\git\string_split\iutest\tools\wandbox\iuwandbox.py", l
ine 392, in main
run(options)
File "D:\user\documents\git\string_split\iutest\tools\wandbox\iuwandbox.py", l
ine 300, in run
r = run_wandbox(code, includes, options)
File "D:\user\documents\git\string_split\iutest\tools\wandbox\iuwandbox.py", l
ine 205, in run_wandbox
opt.append('boost-' + options.boost)
AttributeError: 'filter' object has no attribute 'append'
Windows 7 64bit
python 3.4.4(x86)
D:\user\documents\git\string_split\iutest\tools\wandbox>pip list
cycler (0.10.0)
matplotlib (1.5.0)
numpy (1.10.2)
pip (8.0.2)
pyparsing (2.1.0)
python-dateutil (2.4.2)
pytz (2015.7)
requests (2.10.0)
scipy (0.16.1)
setuptools (20.1.1)
six (1.10.0)
wheel (0.29.0)
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
iutest.hpp: In member function 'virtual void iutest::DefalutResultPrintListener::OnTestEnd(const iutest::TestInfo&)':
iutest.hpp:5006:0: note: -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers
#ifdef IUTEST_NOT_SUPPORT_STOPWATCH
~
そういえばこれって何なんでしょうか?
__cpp_noexcept_function_type >= 201510L
現行の CSV パラメータ生成器は残しつつ、行列でのパラメータ生成に対応する
まあincludeするだけのライブラリだけれども、
# - Try to find iutest include dirs
#
# Usage of this module as follows:
#
# find_package(IUTEST)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# IUTEST_ROOT_DIR Set this variable to the root installation of
# iutest if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# IUTEST_FOUND System has iutest, include dirs found
# IUTEST_INCLUDE_DIR The iutest include directories.
find_path(IUTEST_ROOT_DIR
NAMES include/iutest.hpp
)
find_path(IUTEST_INCLUDE_DIR
NAMES iutest.hpp
HINTS ${IUTEST_ROOT_DIR}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IUTEST DEFAULT_MSG
IUTEST_INCLUDE_DIR
)
のようなスクリプトがあると使いやすいと思うんですが、どうでしょうか?
CircleCI 2.0 対応をする
Last Build Status: Failed. Your build has failed due to the following reason. Please fix the error and upload the build again.
Error details: :Failed to retrieve tar file
ValuesGen を使って乱数から生成したときに、値の重複が起こる可能性がある。
これはテストとしては意味がない場合があるので、ユーザーが選択して重複を除外できるようにする。
https://www.bitrise.io/build/daf1bd5580ca5655
v1.16.2からv1.16.3にあげようとしたところ、
$git config --global core.autocrlf
false
$git config --local core.autocrlf
$git submodule update --init
Submodule path 'iutest': checked out '3b7ebd720cc22e4d25996ef1133118a729b65730'
$cd iutest
$git checkout v1.16.2
Previous HEAD position was 3b7ebd7... update tox.ini
HEAD is now at 6e307aa... version 1.16.2
$ cd ..
$git submodule status
+6e307aa60b6f620933d4597febcef04d6a778177 iutest (v1.16.2)
$cd iutest
$git checkout v1.16.3
Previous HEAD position was 6e307aa... version 1.16.2
HEAD is now at 8c65397... version 1.6.3
warning: CRLF will be replaced by LF in .gitignore.
The file will have its original line endings in your working directory.
$git status
HEAD detached at v1.16.3
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
modified: CHANGES
modified: LICENSE
modified: docs/.gitignore
modified: projects/cmake/CMakeLists.txt
modified: projects/nuget/iutest.nuspec
modified: test/.gitignore
no changes added to commit (use "git add" and/or "git commit -a")
warning: CRLF will be replaced by LF in .gitignore.
The file will have its original line endings in your working directory.
のようになる。CRLFが混入しているのではないか?
https://www.bitrise.io/build/53af5b490b9e55a8
サンプルのメンテナンスめんどくさいので、cmake から generate してビルドするようにする
OSDN に自動でパッケージデプロイする
Pairwise で禁則ルールを定義できるようにする
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wandbox.org', port=443): Max retries exceeded with url: /api/list.json
こんにちは、
毎日楽しく iutest を使って CI を回しております。
iutest をインクルードしたテストアプリケーションを Visual Studio でビルドするときに、iutest のヘッダーファイル内で次の警告が表示されます。
>c:\iutest\include\impl\../internal/iutest_debug.hpp(44): warning C4505: 'iutest::detail::iuDebugInitialize': unreferenced local function has been removed
>c:\iutest\include\impl\../internal/iutest_debug.hpp(53): warning C4505: 'iutest::detail::iuDebugBreakAlloc': unreferenced local function has been removed
コンパイラオプションで「警告をエラーとして扱う」ように設定しているので、テストアプリケーションのビルドが上手く通らず少々困っております。
>c:\iutest\include\impl\../internal/iutest_debug.hpp(44): error C2220: warning treated as error - no 'object' file generated
具体的なビルド環境は次の通りです:
_IUTEST_DEBUG
プリプロセッサは定義していません<gtest/iutest_switch.hpp>
と <iutest.hpp>
の 2 つをアプリケーション側でインクルードして使っています今は該当する警告を無視するオプション (/wd"4505"
) を追加してコンパイルしています。
警告を無視することなく、ビルドすることはできないでしょうか?よろしくお願いします。:relieved:
現在--expand_include
する場合はmake_code
関数が再帰処理するので確実にヘッダーファイルをコンパイルできるが、しない場合はそれができない。
たとえば
#include "../include/string_split.hpp"
とあったとして、現状ではこのヘッダーはwandboxに送られるものの、パスが違うのでincludeに失敗します。
現状の--expand_include
しない場合のルーチンは
make_code
関数が呼ばれる#include
を見つけるsetup_includes
関数でファイルを開くとなっていますが、これではincludeしているヘッダーからincludeしているファイルを追加できないのでまずいです。
includeしているヘッダーからincludeしていない場合は
#ifdef __WANDBOX__
#include "string_split.hpp"
#else
#include "../include/string_split.hpp"
#endif
のように対処できたりしますが。
--expand_include
すればいいだろ、という話は有りますが。
$ clang++-6.0 -Wall -Wextra -std=c++14 -g -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -O1 iutest/samples/simple.cpp iutest/samples/main.cpp
$ ./a.out
Uninitialized bytes in __interceptor_strlen at offset 4 inside [0x7ffdeeeec080, 5)
==15204==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7fdd7899fb57 (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x127b57)
#1 0x4bcd9d (/home/yumetodo/a.out+0x4bcd9d)
#2 0x4bca82 (/home/yumetodo/a.out+0x4bca82)
#3 0x4a2de8 (/home/yumetodo/a.out+0x4a2de8)
#4 0x41e41c (/home/yumetodo/a.out+0x41e41c)
#5 0x41f96d (/home/yumetodo/a.out+0x41f96d)
#6 0x4fc22c (/home/yumetodo/a.out+0x4fc22c)
#7 0x7fdd779857be (/lib/x86_64-linux-gnu/libc.so.6+0x207be)
#8 0x41fa98 (/home/yumetodo/a.out+0x41fa98)
Uninitialized value was created by an allocation of 'ref.tmp' in the stack frame of function '__cxx_global_var_init.7'
#0 0x41e2c0 (/home/yumetodo/a.out+0x41e2c0)
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x127b57)
Exiting
In file included from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_env.hpp:816:0,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_message.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_result.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_assertion.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_pred.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_internal.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_core_impl.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_result_reporter.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_core.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest.hpp:23,
from D:/user/documents/git/SigContrastFastAviUtl/test/test.cpp:2:
D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/impl/iutest_env.ipp: In static member function 'static bool iutest::TestEnv::ParseCommandLineElemA(const char*)':
D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/impl/iutest_env.ipp:239:54: warning: overflow in implicit constant conversion [-Woverflow]
TestFlag::SetFlag(TestFlag::SHOW_SPEC);
^
In file included from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_core_impl.hpp:246:0,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/internal/iutest_result_reporter.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest_core.hpp:20,
from D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/iutest.hpp:23,
from D:/user/documents/git/SigContrastFastAviUtl/test/test.cpp:2:
D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/impl/iutest_core_impl.ipp: In member function 'bool iutest::UnitTestImpl::PreRunner()':
D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/impl/iutest_core_impl.ipp:98:56: warning: overflow in implicit constant conversion [-Woverflow]
if( TestFlag::IsEnableFlag(TestFlag::SHOW_INFO_MASK) )
^
D:/user/documents/git/SigContrastFastAviUtl/3rd_party/iutest/include/impl/iutest_core_impl.ipp:112:55: warning: overflow in implicit constant conversion [-Woverflow]
if( TestFlag::IsEnableFlag(TestFlag::SHOW_SPEC) )
^
support for std::string_view for C++17
cmake が xcode scheme に対応したら test もできるようになるはず。
対応後に .yml にする。
CMake Xcode Schemes (!509) · Merge Requests · CMake / CMake · GitLab
CMake 3.9 で対応されそう?
対応されてたら、Bitrise の設定を更新する。
github https://github.com/google/googletest/releases から DL してテスト実行する
bat ファイルのように CRLF 必須のファイル以外は LF に統一する
ローカル Jenkins でやってることをクラウドでやる
iutest_charcode.ipp
のiutest::detail::UTF8ToSJIS
関数にて。
MultiByteToWideChar
の第4引数にsize_t
型の値を渡しているが、要求されているのはint
型なので
warning C4267: '引数': 'size_t' から 'int' に変換しました。データが失われているかもしれません。
という警告が出る。
https://circleci.com/gh/srz-zumix/iutest/622#tests/containers/1
sudo apt-get -qq install clang-3.9
E: Unable to locate package clang-3.9
E: Couldn't find any package by regex 'clang-3.9'
sudo apt-get -qq install clang-3.9 returned exit code 100
Action failed: sudo apt-get -qq install clang-3.9
その前の update で失敗しているので、リトライかなにかで回避したい。
Err http://apt.llvm.org llvm-toolchain-trusty-3.9 InRelease
Err http://apt.llvm.org llvm-toolchain-trusty-3.9 Release.gpg
Unable to connect to apt.llvm.org:http:
http://melpon.org/wandbox/permlink/WlbTScmW4ofzbE2E
のように複数の翻訳単位を作れるようなので将来的に対応してもいいかもしれない。具体的にはinclude解析部分に手を加える必要がある。
@kazatsuyu ほう、ますますstatic/extern/inlineまわりわかんねぇ・・・。
— yumetodo-C++erだけど化学科 (@yumetodo) 2016年10月16日
ところでwandboxで複数の翻訳単位作る方法あったのか・・・@srz_zumix 氏のiuwandboxつかっててヘッダーオンリーなものしか使えないイメージだった
Bitrise では yaml が使えるので、おいおい移行する
IUTEST_ASSERT(expression) -> IUTEST_ASSERT(...)
Scrutinizer config to yaml
CMake を使ったテストビルド、実行
NMake ビルドのジョブ分離
Visual Studio の各種バージョン対応
$ make Debug CXX=clang++
clang++ test.cpp -o test.out -g -O0 -Wall -Wextra -std=c++14
In file included from test.cpp:6:
In file included from ./../iutest/include/iutest.hpp:23:
In file included from ./../iutest/include/iutest_core.hpp:20:
In file included from ./../iutest/include/internal/iutest_result_reporter.hpp:20:
In file included from ./../iutest/include/internal/iutest_core_impl.hpp:20:
In file included from ./../iutest/include/internal/iutest_internal.hpp:20:
In file included from ./../iutest/include/internal/../iutest_pred.hpp:20:
In file included from ./../iutest/include/iutest_assertion.hpp:20:
In file included from ./../iutest/include/iutest_result.hpp:20:
In file included from ./../iutest/include/internal/iutest_message.hpp:20:
In file included from ./../iutest/include/internal/../iutest_env.hpp:20:
In file included from ./../iutest/include/internal/../impl/../internal/iutest_charcode.hpp:194:
In file included from ./../iutest/include/internal/../impl/iutest_charcode.ipp:22:
D:\msys64\mingw32\i686-w64-mingw32\include\uchar.h:34:24: error: cannot combine with previous 'type-name' declaration specifier
typedef uint_least16_t char16_t;
^
D:\msys64\mingw32\i686-w64-mingw32\include\uchar.h:35:24: error: cannot combine with previous 'type-name' declaration specifier
typedef uint_least32_t char32_t;
^
2 errors generated.
make: *** [Makefile:30: test.out] エラー 1
原因は./include/impl/iutest_charcode.ipp
で
// include
#include "../internal/iutest_charcode.hpp"
#if IUTEST_HAS_HDR_UCHAR
# include <uchar.h>
#endif
のようにuchar.h
がincludeされているため。msys2 mingw gccでは発生しない。
msys2-base-[アーキテクチャ]-[日付].tar.xz
をDLし展開するmsys2_shell.cmd
をダブルクリック、Close Window
と言われたらばってんを押して閉じるmsys2_shell.cmd
をダブルクリック、pacman -Syuu
と打ち実行、また閉じるmsys2_shell.cmd
をダブルクリック、pacman -S git mingw-w64-i686-clang mingw-w64-x86_64-clang
とと打ち実行、また閉じるmsys2_shell.cmd
のあるパスに移動し、call msys2_shell.cmd -mingw64
(64bit向けのコンパイル)またはcall msys2_shell.cmd -mingw32
(32bit向けのコンパイル)を実行$ git clone https://github.com/yumetodo/string_split.git
$ git submodule update --init
$ make Debug CXX=clang++
-f
オプションで
-f"-O2 -DNO_RDSEED"
のように渡すと
compiler_message:
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
cc1plus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast'
のように怒られる。
ex.) http://melpon.org/wandbox/permlink/LA263I1vQuyfMqlE
つまりspaceを\n
に置換する必要がある。
ただ、(ほとんど指定することないけど)-x c++
みたいなオプションもあるので置換が面倒そう。
現状、1commit 前との差分をみて更新必要かどうか判断しているため、
複数コミットを push すると更新が行われないことがある。
svn 同期処理と同じように commit メッセージに id つけて対応する。
Magnum CI の証明書切れを受けて、別の CI への移行を行う。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.