From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user Subject: Re: issues unit testing with srfi-64 Date: Sat, 29 Dec 2018 22:03:40 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1546149739 18988 195.159.176.226 (30 Dec 2018 06:02:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Dec 2018 06:02:19 +0000 (UTC) Cc: guile-user To: Christopher Lam Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Dec 30 07:02:15 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdUAw-0004pj-9S for guile-user@m.gmane.org; Sun, 30 Dec 2018 07:02:14 +0100 Original-Received: from localhost ([127.0.0.1]:43025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdUD2-0001Ee-JP for guile-user@m.gmane.org; Sun, 30 Dec 2018 01:04:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdUCY-0001DP-Gq for guile-user@gnu.org; Sun, 30 Dec 2018 01:03:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdUCX-0003Qm-FQ for guile-user@gnu.org; Sun, 30 Dec 2018 01:03:54 -0500 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:35329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdUCX-0003QR-8b for guile-user@gnu.org; Sun, 30 Dec 2018 01:03:53 -0500 Original-Received: by mail-lj1-x231.google.com with SMTP id x85-v6so21687143ljb.2 for ; Sat, 29 Dec 2018 22:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nh75pzyXJJ1YTVUwJqHLBMJTfE8melWwzwvStkmV+gI=; b=dexBlMMoGhccuzO2LJr19rPJxfW3GOXFDJrHjXmj2jJPw5NPxjkLxb+WWqTOZ/jt4y 4SMP1195FOA23zRr/D+pZ6BTI98tH+Xs+NqFdgo1m347ILcBL2/e0VO43I0nCzrebucP bOXIInZyxxUB2ll4PEeemVmTSya0aYnNmfEU04wlk85HkSRkY/jHirqbJuKgEDSRWsbf 3wyuSzyzliphe+Di440VoqZuPiPfPZKoY3NnBvFj8Szpp/NGmBiMsg3bvxHa2dVJ6YCK w8bydQKgrvZmmSz0iU2LOxP8xrab9pUAL46rS8dj9lLdHUdBLgjxeLGdc01ReYIkPwIW NAGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nh75pzyXJJ1YTVUwJqHLBMJTfE8melWwzwvStkmV+gI=; b=KstnuWfxKefqfY9Znb9SijqwEXANIZRQX2hpb0911mn9BwOLXi+NgvlO5jmDPKOGoX iNFA5rnUFTd8fSAMmtNjqIBH3dHbZG7PDF52az/EXObvj5fed6edlHoX7n1uHbrjKrin Nkfy1Sg3wOUqbqXZfjGqYe9N6GHkovzQT3M0qLksGvUEM2ffPctfU1dxZG5yAZue7Pd8 A+mAGk2Zd0xTuqNGYFTbGPAt/dKygrSDZeR27Ha+oNRV4mgv4vRQ28+JLhR7NFVWoGX+ 5iMRXwz1T9cohEJDFq1NP/V4hlak1k6+xMfJxDNE90z1zln8dE8eoiRU+LmxudnOaX7a akTg== X-Gm-Message-State: AA+aEWYgSd/MStnwFKncRxB2pJ4856QR/puIMRvy11/FlIXnq6Nnx6UM C4M2gNyd++79jwfl2xg1tttNyjGIvgWuRl+Rdxo= X-Google-Smtp-Source: AFSGD/V+Hmcdu0+5RPZP5kIhByIZMm+eEt5Z/i5pvMW8zxDsJCJbDbJppgGSLtGG6R+oSjHhIZcbI0kSppKk7/xcoIU= X-Received: by 2002:a2e:914b:: with SMTP id q11-v6mr18646494ljg.164.1546149831591; Sat, 29 Dec 2018 22:03:51 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::231 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15175 Archived-At: That worked great and fixed both of my issues. Thanks! On Sat, Dec 29, 2018 at 6:17 PM Christopher Lam wrote: > > Hi > In gnucash I've resorted to writing my own srfi-64 test-runner. See the e= ntry point at (run-test-proper) at https://github.com/Gnucash/gnucash/blob/= maint/gnucash/report/standard-reports/test/test-transaction.scm > > Its definition is at https://github.com/Gnucash/gnucash/blob/maint/libgnu= cash/engine/test/srfi64-extras.scm and takes care of both returning #f if a= ny test fails, and also doing an IMHO better job at logging tests. > > On Sun., 30 Dec. 2018, 08:05 Aleix Conchillo Flaqu=C3=A9 > >> Hi! >> >> happy holidays and almost happy new year to everyone! >> >> I've added unit tests to guile-json and I have found a couple of >> issues. This is the branch: >> >> https://github.com/aconchillo/guile-json/tree/switch-to-alist-and-vector= s >> >> First one (which might not be a real issue) is that (test-end) doesn't >> exit with an exit status different than 0 if a test fails. And this >> will cause automake to believe the tests passed when they actually did >> not. I have solved this with the following which works for my use >> case, but I'm not sure if that's the right way: >> ... >> (test-end "test-builder") >> >> (exit (if (eqv? 0 (test-runner-fail-count (test-runner-current))) 0 1= )) >> >> (I could have returned the fail-count directly, but since there are >> only 255 exit values I thought it could wrap around.) >> >> The other issue is that the beginning of the log files are corrupted: >> >> %%%% Starting test test-builder (Writing full log to "test-builder.log"= ) >> # of expected passes 19 >> r.scm" >> source-line: 33 >> source-form: (test-equal "1234" (scm->json-string 1234)) >> >> This should be something like: >> >> Test begin: >> source-file: "tests/test-builder.scm" >> source-line: 33 >> source-form: (test-equal "1234" (scm->json-string 1234)) >> Test end: >> result-kind: pass >> actual-value: "1234" >> expected-value: "1234" >> >> I don't know how to fix this one yet. >> >> Has anyone else found these issues before? >> >> Thanks in advance! >> >> Aleix >>