clear-code / cutter Goto Github PK
View Code? Open in Web Editor NEWAn easy to write and debug unit testing framework for C and C++.
Home Page: http://cutter.sourceforge.net/
An easy to write and debug unit testing framework for C and C++.
Home Page: http://cutter.sourceforge.net/
# -*- rd -*- = README --- An introduction of Cutter, a Unit Testing Framework for C and C++ == Name Cutter == Author === Program * Kouhei Sutou <[email protected]> * Hiroyuki Ikezoe <[email protected]> * Yuto Hayamizu <[email protected]> === Kinotan Icons * Mayu & Co. == License * Source: LGPLv3 or later. (detail: ((<"license/lgpl-3.txt"|URL:http://www.gnu.org/licenses/lgpl.html>))) * Document and kinotan icons: Triple license: LGPL, GFDL and/or CC. * LGPL: v3 or later. (detail: ((<"license/lgpl-3.txt"|URL:http://www.gnu.org/licenses/lgpl.html>))) * GFDL: v1.3 or later. (detail: ((<"license/gfdl-1.3.txt"|URL:http://www.gnu.org/licenses/fdl.html>))) * CC: ((<BY-SA|URL:http://creativecommons.org/licenses/by-sa/3.0/>)) * Exceptions: * glib-compatible/glibintl.h, glib-compatible/gregex.*, glib-compatible/gscripttable.h, glib-compatible/gsequence.*, glib-compatible/gstring.*, glib-compatible/gunicode.h, glib-compatible/guniprop.c: LGPL v2.0 or later. (detail: ((<"glib-compatible/COPYING"|URL:http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html>))) * glib-compatible/pcre/: PCRE LICENSE. (detail: ((<"glib-compatible/pcre/COPYING"|URL:http://www.pcre.org/licence.txt>))) * html/blog.*, html/download.*, html/heading-mark.* html/install.*, html/readme.*, html/reference.*, html/tango-logo.png, html/tutorial.*, html/mini-*.svg: Public domain. They are deliverables by ((<Tango Desktop Project|URL:http://tango.freedesktop.org/>)). (Some of them are modified.) * html/ja.png, html/us.png, html/famfamfam-logo.png: Public domain. They are distributed by ((<famfamfam.com|URL:http://famfamfam.com/>)). == What's this? Cutter is a xUnit family Unit Testing Framework for C and C++. This is a list of features of Cutter: * easy to write tests. * outputs result with useful format for debugging. * tests are built as shared libraries. See ((<FEATURES>)) for more details. == Dependency libraries * GLib >= 2.16 == Install See ((<Install>)). == Repository There is the repository at ((<"clear-code/cutter on GitHub"|URL:https://github.com/clear-code/cutter/>)). % git clone https://github.com/clear-code/cutter.git == Usage % cutter [OPTION ...] TEST_DIRECTORY TEST_DIRECTORY should have test_*.so. test_*.so are searched recursively. See ((<cutter|"doc/cutter.rd">)) for more details. == How to test Executing flow of test is the following. (1) Write a test. (2) Compile it and build test_*.so. (3) Execute cutter. It loads test_*.so and runs them. See ((<a tutorial|TUTORIAL>)) and sample/stack/. == Test result Here is an example test result: ..........F................................................. 1) Failure: test_test_case_count <1 == cut_test_case_get_n_tests(test_object, NULL)> expected: <1> but was: <0> test/test-cut-test-case.c:143: test_test_case_count() Finished in 0.020857 seconds 60 test(s), 253 assertion(s), 1 failure(s), 0 error(s), 0 pending(s), 0 notification(s) === Progress A part that contains "." and "F" of the test result shows test progress: ..........F................................................. Each "." and "F" shows a test case (test function). "." shows a test case that is succeeded and "F" shows a test case that is failed. There are "E", "P" and "N". They shows error, pending and notification respectively. Here is a summary of test case marks: : . A succeeded test : F A failed test : E A test that had an error : P A test that is marked as pending : N A test that had an notification The above marks are showed after each test is finished. We can confirm the test progress from the output in testing. === Summary of test result Cutter outputs a summary of test result after all tests are finished. The first of a summary is a list of a detail of test result of non-succeeded test. In the example, cutter outputs a detail of test result because there is a failure. 1) Failure: test_test_case_count <1 == cut_test_case_get_n_tests(test_object, NULL)> expected: <1> but was: <0> test/test-cut-test-case.c:143: test_test_case_count() In the example, test_test_case_count test case is failed. We expected that cut_test_case_get_n_tests(test_object, NULL) is 1 but was 0. The failed assertion is in test_test_case_count() function in test/test-cut-test-case.c at 143th line. Elapsed time for testing is showed after a list of a detail of test result: Finished in 0.020857 seconds The last line is an summary of test result: 60 test(s), 253 assertion(s), 1 failure(s), 0 error(s), 0 pending(s), 0 notification(s) Here are the means of each output: : n test(s) n test case(s) (test function(s)) are run. : n assertion(s) n assertion(s) are passed. : n failure(s) n assertion(s) are failed. : n error(s) n error(s) are occurred (cut_error() is used n times) : n pending(s) n test case(s) are pending (cut_pending() is used n times) : n notification(s) n notification(s) are occurred (cut_notification() is used n times) In the example, 60 test cases are run, 253 assertions are passed and an assertion is failed. There are no error, pending, notification. === XML report Cutter reports test result as XML format if --xml-report option is specified. A reported XML has the following structure: <report> <!-- "result" tag is generated for a test result. Normally, a "result" tag is generated for a test. If you use cut_message(), you will get two or more "result" tags for a test. --> <result> <test-case> <name>TEST CASE NAME</name> <description>DESCRIPTION OF TEST CASE (if exists)</description> <start-time>START TIME OF TEST CASE (ISO 8601 format) [e.g.: 2013-11-12T03:32:56.691676Z]</start-time> <elapsed>ELAPSED TIME OF TEST CASE (in seconds) [e.g.: 0.030883]</elapsed> </test-case> <test> <name>TEST NAME</name> <description>DESCRIPTION OF TEST CASE (if exists)</description> <start-time>START TIME OF TEST (ISO 8601 format) [e.g.: 2013-11-12T03:32:56.691823Z]</start-time> <elapsed>ELAPSED TIME OF TEST (in seconds) [e.g.: 0.030883]</elapsed> <option><!-- ATTRIBUTE INFORMATION (if exists) --> <name>ATTRIBUTE NAME [e.g.: bug]</name> <value>ATTRIBUTE VALUE [e.g.: 1234]</value> </option> <option> ... </option> ... </test> <status>TEST RESULT (one of them: success, notification, omission, pending, failure, error, crash)</status> <detail>DETAIL OF TEST RESULT (if exists)</detail> <backtrace><!-- BACKTRACE (if exists) --> <entry> <file>FILE NAME</file> <line>LINE</line> <info>ADDITIONAL INFORMATION</info> </entry> <entry> ... </entry> </backtrace> <start-time>START TIME OF TEST (ISO 8601 format) [e.g.: 2013-11-12T03:32:56.691823Z]</start-time> <elapsed>ELAPSED TIME OF TEST (in seconds) [e.g.: 0.030883]</elapsed> </result> <result> ... </result> ... </report> === Test coverage You can see the code coverage with Cutter if your system have ((<LTP tools|URL:http://ltp.sourceforge.net/>)). To see the coverage, add the followling line in your configure.ac and type "make coverage". AC_CHECK_COVERAGE == References === Assertions See ((<"cutter/cut-assertions.h"|cutter-cut-assertions.html>)). === Attributes You can add attributes to your test to get more useful information on failure. For example, you can add Bug ID like the following void attributes_invalid_input(void); void test_invalid_input(void); void attributes_invalid_input (void) { cut_set_attributes("bug", "123"); } void test_invalid_input (void) { cut_assert_equal("OK", get_input()); } In the above example, test_invalid_input test has an attribute that the test is for Bug #123. You need to define a function whose name is "attributes_#{TEST_NAME - 'test_' PREFIX}" to add attributes to a test. In the above example, attributes set function, "attributes_invalid_input", is defined to set "bug" attribute to "test_invalid_input" test. === Template The following is a template of test. #include <cutter.h> #include "HEADER_FILE_OF_YOUR_PROGRAM" void test_condition(void); void test_strstr(void); static int condition = 0; void cut_setup (void) { condition = 1; } void cut_teardown (void) { condition = 0; } void test_condition(void) { cut_set_message("The condition value should be set to 1 in cut_setup()"); cut_assert_equal_int(1, condition); ... } void test_strstr(void) { cut_assert_equal_string("sub-string", strstr("string sub-string", "sub")); ... } == Thanks * Kazumasa Matsunaga: reported a build bug. * Daijiro MORI: reported bugs. * UNNO Hideyuki: * reported a document bug. * assisted Solaris install document. * gunyara-kun: suggested API design. * Yamakawa Hiroshi: reported works on Cygwin. * Yoshinori K. Okuji: * reported locale related bugs. * suggested a new feature. * Zed Shaw: reported bugs. * Romuald Conty: reported a document bug. * Romain Tartière: * reported bugs. * suggested improvements. * Ilya Barygin: * reported bugs in test. * Hiroaki Nakamura: * reported a bug on CentOS. * Tobias Gruetzmacher: * fixed a GTK+ test runner bug.
./test/run-test.sh fails with gdk-pixbuf 2.38.1+dfsg-1.
Even though changed to use gdk_pixbuf_read_pixel_bytes
in expected, the result of gcut_object_inspect(G_OBJECT(pixbuf1))
is still different. It seems that pixel-bytes are newly allocated implicitly.
(no modification in test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c)
........................................F
===============================================================================
Failure: test_inspect
<expected == gcut_object_inspect(G_OBJECT(pixbuf1))>
expected: <"#<GdkPixbuf:0x5569acba3580 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbc7410)>, pixel-bytes=<NULL>>">
actual: <"#<GdkPixbuf:0x5569acba3580 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbc7410)>, pixel-bytes=<((GBytes*) 0x5569ac7d9d60)>>">
diff:
? "#<GdkPixbuf:0x5569acba3580 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbc7410)>, pixel-bytes=<NULL >>"
?
((GBytes*) 0x5569ac7d9d60)
./test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c:152: test_inspect(): cut_assert_equal_string_with_free(expected, gcut_object_inspect(((((GObject*) g_type_check_instance_cast ((GTypeInstance*) ((pixbuf1)), (((GType) ((20) << (2))))))))), )
===============================================================================
...F
===============================================================================
Failure: test_equal
<expected_strings == actual_strings>
expected: <("equal test", NULL, "<pixbuf1 == pixbuf2> (2)
expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac912d80)>>>
actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac8ffa40)>>>
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", "<pixbuf1 == pixbuf2> (2)
expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac912d80)>>>
actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac8ffa40)>>>
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", NULL, NULL, "test-gdkcut-pixbuf-assertions.c:135", "stub_equal")>
actual: <("equal test", NULL, "<pixbuf1 == pixbuf2> (2)
expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac900090)>>>
actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac90f160)>>>
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", "<pixbuf1 == pixbuf2> (2)
expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac900090)>>>
actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac90f160)>>>
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", NULL, NULL, "test-gdkcut-pixbuf-assertions.c:135", "stub_equal")>
diff:
("equal test", NULL, "<pixbuf1 == pixbuf2> (2)
? expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac912d80)>>>
? 0009
? actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac8 ffa40)>>>
? 90 16
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", "<pixbuf1 == pixbuf2> (2)
? expected: <#<GdkPixbuf:0x5569acb9f5e0 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbe2e30)>, pixel-bytes=<((GBytes*) 0x5569ac912d80)>>>
?
0009
? actual: <#<GdkPixbuf:0x5569acba3520 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-p
er-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x5569acbeca80)>, pixel-bytes=<((GBytes*) 0x5569ac8 ffa40)>>>
?
90 16
threshold: <2>
diff image: <test-gdkcut-pixbuf-assertions.c-135.png>", NULL, NULL, "test-gdkcut-pixbuf-assertions.c:135", "stub_equal")
./test/./lib/cuttest-assertions.c:284: cut_assert_test_result_helper(): gcut_assert_equal_list_string(expected_strings, actual_strings, )
./test/gdkcutter-pixbuf/test-gdkcut-pixbuf-assertions.c:171: test_equal(): cut_assert_test_result(run_context, 0, CUT_TEST_RESULT_FAILURE, "
equal test", ((void *)0), message, ((void *)0), ((void *)0), (cut_test_context_take_printf(cut_test_context_current_peek(), "%s:%d", "test-g
dkcut-pixbuf-assertions.c", fail_line)), "stub_equal", ((void *)0))
===============================================================================
..............
Finished in 5.055534 seconds (total: 3.842856 seconds)
612 test(s), 2992 assertion(s), 2 failure(s), 0 error(s), 0 pending(s), 0 omission(s), 0 notification(s)
99.6732% passed
./test/run-test.sh succeeds.
いくつか残作業があるので、まとめておく。
When a test case throws C++ exception, cutter stops test and exit soon. Is there a good way or recommended way to avoid this problem?
An error was displayed when I accessed the site.
It appears to have expired on 2023/05/22.
Because LGPLv3 is a set of additional permissions on top of the GPLv3.
http://www.gnu.org/licenses/gpl-howto.html
http://www.gnu.org/licenses/gpl-faq.html#v3HowToUpgrade
gtkdoc-mktmpl is removed since gtk-doc-tools 1.26.
Cutter rely on it to generate documents.
make -C doc
generates documents correctly without gtkdoc-mktmpl.
make -C doc
still works on Debian stretch.
It is for showing fix of #13 (comment)
自分の手元で再現できていないのですが、gtkdoc の入っていない環境で make install に失敗します。
$ ./configure --prefix=/tmp/x --disable-gstreamer
$ make
$ make install
たぶん gtkdoc の入っていない環境でも gtk-doc.make を include してしまっているのが原因ではないかと思います。
Now on Fedora 21 (already released) make check (on both cutter 1.2.4 and git head) fails like:
===============================================================================
Failure: test_inspect
<expected == gcut_object_inspect(G_OBJECT(pixbuf1))>
expected: <"#<GdkPixbuf:0x97c1958 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x98b56c8)>>">
actual: <"#<GdkPixbuf:0x97c1958 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x98b56c8)>, pixel-bytes=<NULL>>">
diff:
? "#<GdkPixbuf:0x97c1958 colorspace=<#<GdkColorspace: rgb(GDK_COLORSPACE_RGB:0)>>, n-channels=<4>, has-alpha=<TRUE>, bits-per-sample=<8>, width=<100>, height=<100>, rowstride=<400>, pixels=<((gpointer) 0x98b56c8)>, pixel-bytes=<NULL>>"
./gdkcutter-pixbuf/test-gdkcut-pixbuf.c:143: test_inspect(): cut_assert_equal_string_with_free(expected, gcut_object_inspect(((((GObject*) g_type_check_instance_cast ((GTypeInstance*) ((pixbuf1)), (((GType) ((20) << (2))))))))), )
===============================================================================
(and now cutter srpm on Fedora FTBFS (fail to build from source) on Fedora 21, 22)
I guess this is due to this commit (and bug report):
https://git.gnome.org/browse/gdk-pixbuf/commit/?id=862e3890f54aaeb8589a6ee4c146f1fb50556004
https://bugzilla.gnome.org/show_bug.cgi?id=732297
Current "unstable" GdkPixbuf API:
https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf--pixel-bytes
I think it is safe that 2.31.1 and above has "pixel-bytes”.
P.S. first of all Fedora 21 should not use such an "unstable" stage of gdk-pixbuf2, I think :( however that happened...
For example, I would expect this code snippet to fail:
#include <cutter.h>
// This will pass.
void test_proveUnexpectedFailure()
{
int pid = cut_fork();
if (0 == pid) {
cut_assert_equal_int(0, 1); // If it passes, then something is wrong...
}
cut_assert_equal_int(0, 0);
}
But it succeeds.
I've executed following setup.sh and gotten errors. I could not install cutter-testing-framework on Debian sid.
See: https://gist.github.com/okkez/192e5bf13eafe14ea2e7a3be0470a91c
With Fedora 22 (GLib is now 2.43.90, same as 2.43.4) using git head (3947d29) make check fails like
FAIL: run-test.sh
============================================================================
Testsuite summary for cutter 1.2.4
============================================================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
Please report to [email protected]
============================================================================
and test/test-suite.log is:
https://bugzilla.redhat.com/attachment.cgi?id=993869
(While I have not investigated in detail) it looks like (again just my guess) this segv is derived from cutter/test-cut-test.c:323. and the signal wasn't caught properly...???
I tried to install the cutter according to the below document.
https://cutter.osdn.jp/reference/ja/install-to-debian.html
However, I met with the below error.
sudo apt update
ヒット:1 http://security.debian.org/debian-security buster/updates InRelease
ヒット:2 https://download.docker.com/linux/debian buster InRelease
ヒット:3 https://packages.groonga.org/debian buster InRelease
無視:4 https://osdn.net/projects/cutter/storage/debian buster InRelease
取得:5 https://osdn.net/projects/cutter/storage/debian buster Release [8,924 B]
取得:6 https://osdn.net/projects/cutter/storage/debian buster Release.gpg [195 B]
無視:6 https://osdn.net/projects/cutter/storage/debian buster Release.gpg
ヒット:7 http://deb.debian.org/debian buster InRelease
ヒット:8 http://deb.debian.org/debian buster-updates InRelease
ヒット:9 https://download.virtualbox.org/virtualbox/debian buster InRelease
パッケージリストを読み込んでいます... 完了
W: GPG エラー: https://osdn.net/projects/cutter/storage/debian buster Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 18790411F07C74AC
E: リポジトリ https://osdn.net/projects/cutter/storage/debian buster Release は署名されていません。
N: このようなリポジトリから更新を安全に行うことができないので、デフォルトでは更新が無効になっています。
N: リポジトリの作成とユーザ設定の詳細は、apt-secure(8) man ページを参照してください。
I tried to add the above public key by the below command.
However, It failed it too.
gpg --recv-key 18790411F07C74AC
gpg: key 18790411F07C74AC: new key but contains no user ID - skipped
gpg: 処理数の合計: 1
gpg: ユーザIDなし: 1
gpg -a --export 18790411F07C74AC | sudo apt-key add -
gpg: *警告*: 何もエクスポートされていません
gpg: 有効なOpenPGPデータが見つかりません。
修正がいくつかたまっているのとしばらく新しいのをだしていないので、今月Cutter 1.2.5としてリリースする。
懸案はホスティングでsf.netを利用しているが、依然としてshellサービスが復旧していないということ。
リポジトリやtar.gzをアップロードするのに支障がある。7/22付のblogでまだ駄目だと告知されている。
see http://sourceforge.net/blog/sourceforge-project-web-service-online/
githubにもtar.gzは置いているので、復旧が長引きそうならパッケージはあとでということにするかも。
building cutter as cutter-test-framework packae in Debian, it gets test failure
Could you take a look at attached text, please?
Could you upload to PPA?
cppcut-message.h:77]: (error) Dangerous usage of c_str(). The value returned by c_str() is invalid after this call.
Source code is
CUT_EXPORT inline const char *
string() const
{
return buffer_.str().c_str();
}
milter-manager/milter-manager#100
cutterもsf.netを利用しているので状況は同じ。
↑で言及されているようにpackagecloudに限らないけど、aptやyumのリポジトリはどこか別に移したほうがよさそう。(プロジェクトWebのホスティングはここでは置いておく)
把握している範囲だと安定的に提供する観点からいくつか不安要素がある。
We're a cutter user and previously we used the packages provided by Debian which recently has removed the package from it's repositories (https://tracker.debian.org/news/871063). I tried to follow the instructions on (http://cutter.sourceforge.net/reference/install-to-debian.html) but that doesn't work because apt-get
fails to load the indices from SF:
Err http://downloads.sourceforge.net jessie/main amd64 Packages
Err http://downloads.sourceforge.net jessie/main amd64 Packages
Err http://downloads.sourceforge.net jessie/main amd64 Packages
Err http://downloads.sourceforge.net jessie/main amd64 Packages
Err http://downloads.sourceforge.net jessie/main amd64 Packages
Fetched 9633 kB in 28s (333 kB/s)
W: Failed to fetch http://downloads.sourceforge.net/project/cutter/debian/dists/jessie/main/binary-amd64/Packages
So how do I get a working cutter version now? I've already tried various modifications but without improvements.
Thank you for cutter. I've looked at the source and there's a lot to it. It is not a casual effort. Pardon me for not making a PR. It would be mostly changes to the tutorial instructions that might or might not be universally applicable. Or perhaps a version specific to Mac. In the end; however, I've run-into a library search problem that I'm not sure how to solve.
First, the problem:
~/Documents/p.temp/stack$ test/run-test.sh
-bash: test/run-test.sh: No such file or directory
~/Documents/p.temp/stack$ test/run_test.sh
Making all in src
/Library/Developer/CommandLineTools/usr/bin/make all-am
Making all in test
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all-am'.
** (cutter:89812): WARNING **: 09:44:21.468: can't load a shared object for test case: test/.libs/test_stack.so: dlopen(test/.libs/test_stack.so, 1): Library not loaded: /usr/local/lib/libstack.0.dylib
Referenced from: /Users/dcl/Documents/p.temp/stack/test/.libs/test_stack.so
Reason: image not found
Finished in 0.000153 seconds (total: 0.000000 seconds)
0 test(s), 0 assertion(s), 0 failure(s), 0 error(s), 0 pending(s), 0 omission(s), 0 notification(s)
0% passed
~/Documents/p.temp/stack$
While libstack.0.dylib
exists in src/.libs
, it is being searched as /usr/local/lib/libstack.0.dylib
I'm not sure how to fix it.
I like cutter because it works most like miniTest, with which I'm familar. It:
If only I could make it work!
Following are some notes from following the tutorial. There were a number of differences.
For starters, I installed with brew install cutter autoconf automake libtool
This gave the following versions:
cutter 1.2.6
autoconf (GNU Autoconf) 2.69
glibtool (GNU libtool) 2.4.6
automake (GNU automake) 1.16.1
libtool
installs as glibtool
in order not to overwrite libtool
already installed. However libtoolize
is not linked into the path. Thus, in autogen.sh
I replaced libtoolize
with glibtoolize
.alocal
and the invocations of autogen.sh
toward use of autoreconf
. See for example, Future of alocalAM_INIT_AUTOMAKE
to call it without parameters. See Automake public macrosglibtoolize
had suggestions for using m4, which I followed. They were:glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am
glibtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
glibtoolize: and rerunning glibtoolize and aclocal.
(Backing-out these changes didn't solve my linking problem.)
stack.h
, I got linker errors for undefined symbols. Cutter ran without errors, only not running any tests.test/run-test.sh
, make -s check
needed me to rerun autogen.sh
in order to install test-driver
.echo-cutter
target to test/Makefile.am
due to this error:config.status: error: in `/Users/dcl/Documents/p.temp/stack':
config.status: error: Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
autogen.sh
I got a warning asking to substitute AM_CPPFLAGS
for INCLUDES
. I changed "INCLUDES" to "test_stack_la_CPPFLAGS"stack.c
and setting it up for for compile, zero tests run and I get the dynamic link library not found error.Find the files in this gist: https://gist.github.com/wbreeze/4b49948740278cdd156c5f9478bfebf5
I've just noticed that current cutter (HEAD) test fails.
How to reproduce:
./run-test.sh
I've executed on Debian/GNU Linux unstable.
Actual result: there are 2 failures.
Here is the output log.
Failure: cppcut_assertion_message::test_format
<expected_strings == actual_strings>
expected: <("optional message test", "The message of assertion", "<"abcde" == "ABCDE">", "The message of assertion
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1331", "void cppcut_assertion_message::stub_format()")>
actual: <[Invalid UTF-8] \x1b[01;31m("optional message test", "\x80_\x04\x01", "<"abcde" == "ABCDE">", "\x80_\x04\x01
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1331", "void cppcut_assertion_message::stub_format()")\x1b[00m>
diff:
? ("optional message test", "The message of assertion", "<"abcde" == "ABCDE">", "The message of assertion
? [Invalid UTF-8] \x1b[01;37m\x1b[41m\x80_\x04\x01\x1b[00m [Invalid UTF-8] \x1b[01;37m\x1b[41m
\x80_\x04\x01\x1b[00m
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1331", "void cppcut_assertion_message::stub_format()")
././lib/cuttest-assertions.c:284: cut_assert_test_result_helper(): gcut_assert_equal_list_string(expected_strings, actual_strings, )
./cppcutter/test-cppcut-assertions.cpp:1347: void cppcut_assertion_message::test_format(): cut_assert_test_result(run_context, 0, CUT_TEST_RESULT_FAILURE, "optional mes
sage test", "The message of assertion", "<\"abcde\" == \"ABCDE\">", "\"abcde\"", "\"ABCDE\"", (cut_test_context_take_printf(cut_test_context_current_peek(), "%s:%d", "t
est-cppcut-assertions.cpp", fail_line)), "void cppcut_assertion_message::stub_format()", __null)
===============================================================================
(lt-cutter:11381): GLib-WARNING **: Invalid UTF-8 passed to g_io_channel_write_chars().
** (lt-cutter:11381): WARNING **: WriteError: g_convert_error:1: Invalid byte sequence in conversion input
F
===============================================================================
Failure: cppcut_assertion_message::test_shift
<expected_strings == actual_strings>
expected: <("optional message test", "The message of assertion", "<"abcde" == "ABCDE">", "The message of assertion
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1355", "void cppcut_assertion_message::stub_shift()")>
actual: <[Invalid UTF-8] \x1b[01;31m("optional message test", "\xd0\xfb\x06\x01", "<"abcde" == "ABCDE">", "\xd0\xfb\x06\x01
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1355", "void cppcut_assertion_message::stub_shift()")\x1b[00m>
diff:
? ("optional message test", "The message of assertion", "<"abcde" == "ABCDE">", "The message of assertion
? [Invalid UTF-8] \x1b[01;37m\x1b[41m\xd0\xfb\x06\x01\x1b[00m [Invalid UTF-8] \x1b[01;37m\x1b
[41m\xd0\xfb\x06\x01\x1b[00m
<"abcde" == "ABCDE">
expected: <"abcde">
actual: <"ABCDE">", ""abcde"", ""ABCDE"", "test-cppcut-assertions.cpp:1355", "void cppcut_assertion_message::stub_shift()")
././lib/cuttest-assertions.c:284: cut_assert_test_result_helper(): gcut_assert_equal_list_string(expected_strings, actual_strings, )
./cppcutter/test-cppcut-assertions.cpp:1371: void cppcut_assertion_message::test_shift(): cut_assert_test_result(run_context, 0, CUT_TEST_RESULT_FAILURE, "optional mess
age test", "The message of assertion", "<\"abcde\" == \"ABCDE\">", "\"abcde\"", "\"ABCDE\"", (cut_test_context_take_printf(cut_test_context_current_peek(), "%s:%d", "te
st-cppcut-assertions.cpp", fail_line)), "void cppcut_assertion_message::stub_shift()", __null)
===============================================================================
(lt-cutter:11381): GLib-WARNING **: Invalid UTF-8 passed to g_io_channel_write_chars().
** (lt-cutter:11381): WARNING **: WriteError: g_convert_error:1: Invalid byte sequence in conversion input
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.