{"id":3935,"date":"2012-08-31T20:54:29","date_gmt":"2012-08-31T18:54:29","guid":{"rendered":"http:\/\/daniel.haxx.se\/blog\/?p=3935"},"modified":"2012-08-31T20:54:29","modified_gmt":"2012-08-31T18:54:29","slug":"ptest-because-make-test-is-insufficient","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2012\/08\/31\/ptest-because-make-test-is-insufficient\/","title":{"rendered":"ptest because &#8220;make test&#8221; is insufficient"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-4121\" style=\"margin: 8px;\" title=\"CAUTION: test in progress\" src=\"http:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/test-in-progress-sign-150x116.gif\" alt=\"CAUTION: test in progress\" width=\"150\" height=\"116\" srcset=\"https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/test-in-progress-sign-150x116.gif 150w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/test-in-progress-sign-300x232.gif 300w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/test-in-progress-sign.gif 380w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>Much thanks to autoconf and automake we have an established more or less standardized way to build and install tools, libraries and other software. We build them with &#8216;make&#8217; and we install them with &#8216;<a href=\"http:\/\/www.gnu.org\/software\/automake\/manual\/automake.html#Basic-Installation\">make install<\/a>&#8216;. This works great and it works equally fine even when we build stuff cross-compiled.<\/p>\n<p>For testing however, the established concept and procedure is not as good. For testing we have &#8216;make test&#8217; or &#8216;make check&#8217; which typically first builds whatever needs to get built for the tests to run and then it runs all tests.<\/p>\n<h2><strong>This is not good enough<\/strong><\/h2>\n<p>Why? Because in lots of use-cases we build software using a cross-compiler on a build system that can&#8217;t run the executables. Therefore we need to first build the tests, then install the tests (somewhere that is reachable from the target system)\u00c2\u00a0and finally execute them. These steps need to be possible to run independently since at least the building and installing will sometimes happen on a different host than the execution of the tests.<\/p>\n<h2><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-thumbnail wp-image-4117\" title=\"yocto-project\" src=\"http:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/yocto-project-150x56.png\" alt=\"yocto-project\" width=\"150\" height=\"56\" srcset=\"https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/yocto-project-150x56.png 150w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/yocto-project-300x113.png 300w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2012\/08\/yocto-project.png 538w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>Introducing ptest<\/strong><\/h2>\n<p>Within the <a href=\"http:\/\/www.yoctoproject.org\/\">yocto<\/a> project, <a href=\"http:\/\/bjorn.haxx.se\/\">Bj\u00c3\u00b6rn Stenberg<\/a> has pushed for <a href=\"http:\/\/www.mail-archive.com\/yocto@yoctoproject.org\/msg08481.html\">ptest<\/a> to be the basis of this new reform and concept. The responses he&#8217;s gotten so far has been positive and there&#8217;s a pending updated patch to be posted to the upstream <a href=\"http:\/\/www.openembedded.org\/wiki\/Mailing_lists\">oe-core list<\/a> soon.<\/p>\n<h2>The work does not end there<\/h2>\n<p>Even if or when this can be incorporated into <a href=\"http:\/\/www.openembedded.org\/\">OpenEmbedded<\/a> and Yocto &#8211; and I really think it is a matter of when since I believe we can work out all the flaws and quirks until virtually everyone involved is happy. The bulk of the changes however, really should be done upstream, in hundreds and thousands of open source packages. We (as upstream open source projects) need to start doing testing in at least two different steps, where one step build everything that needs to be built for the tests and then a second step that run the suite. The two steps could then in a cross-compiled scenario get executed first on the host system and then on the target system.<\/p>\n<p>I expect that this will mean a whole bunch of patches and scripts to have to be maintained within OpenEmbedded for a while, when things will be tried to get merged into upstream projects and I also foresee that a certain percentage of all projects just won&#8217;t accept this new approach and will reject all patches in this vein.<\/p>\n<h2>Output format<\/h2>\n<p>I think the most controversial part of these suggested &#8220;universal&#8221; changes is the common test suite output format. The common format is of course required so that we can &#8220;supervise&#8221; the output and results from any package without having to know any specifics.<\/p>\n<p>While the ptest output format follows the <a href=\"http:\/\/www.gnu.org\/software\/automake\/manual\/html_node\/Scripts_002dbased-Testsuites.html\">automake test output syntax<\/a>, I expect many projects that have selected a particular output format to rather stick with that. Hopefully we can then make projects introduce a separate make target or option that runs the test suite with the standard output format.<\/p>\n<h2>One little step forward<\/h2>\n<p>Building full-fledged Linux distributions cross-compiled that are completely tested on target will remain being hard work for a while more. But we are improving things, one step at a time.<\/p>\n<p>Of course, the name &#8216;ptest&#8217; is what the system is currently called by Bj\u00c3\u00b6rn within the yocto\/OE environment. It is not supposed to be a catchy name for this idea outside of there. The &#8216;P&#8217; refers to package, as opposed to for example system test and to make it less generic than simply test.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Much thanks to autoconf and automake we have an established more or less standardized way to build and install tools, libraries and other software. We build them with &#8216;make&#8217; and we install them with &#8216;make install&#8216;. This works great and it works equally fine even when we build stuff cross-compiled. For testing however, the established &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2012\/08\/31\/ptest-because-make-test-is-insufficient\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ptest because &#8220;make test&#8221; is insufficient<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,6],"tags":[350,351,267,322,355,349,354],"class_list":["post-3935","post","type-post","status-publish","format-standard","hentry","category-development","category-floss","tag-autoconf","tag-automake","tag-autotools","tag-bjorn","tag-openembedded","tag-testing","tag-yocto"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/3935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=3935"}],"version-history":[{"count":29,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/3935\/revisions"}],"predecessor-version":[{"id":4141,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/3935\/revisions\/4141"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=3935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=3935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=3935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}