From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2850 invoked by alias); 24 Dec 2013 19:04:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2777 invoked by uid 89); 24 Dec 2013 19:04:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 24 Dec 2013 19:04:56 +0000 Received: by mail-pd0-f173.google.com with SMTP id p10so6577721pdj.32 for ; Tue, 24 Dec 2013 11:04:54 -0800 (PST) X-Received: by 10.69.31.1 with SMTP id ki1mr34172730pbd.124.1387911894377; Tue, 24 Dec 2013 11:04:54 -0800 (PST) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id yg3sm56635090pab.16.2013.12.24.11.04.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Dec 2013 11:04:52 -0800 (PST) Message-ID: <52b9dad4.43a3420a.13a6.ffff8df2@mx.google.com> Received: by sspiff.org (sSMTP sendmail emulation); Tue, 24 Dec 2013 11:04:27 -0800 Date: Tue, 24 Dec 2013 19:05:00 -0000 From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH v1 34/36] Guile extension language: equal? tests X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00953.txt.bz2 This patch adds some tests for using equal? with gdb objects. 2013-12-24 Doug Evans testsuite/ * gdb.guile/scm-equal.c: New file. * gdb.guile/scm-equal.exp: New file. diff --git a/gdb/testsuite/gdb.guile/scm-equal.c b/gdb/testsuite/gdb.guile/scm-equal.c new file mode 100644 index 0000000..5b1644d --- /dev/null +++ b/gdb/testsuite/gdb.guile/scm-equal.c @@ -0,0 +1,24 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2013 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +int x; + +int +main (void) +{ + return x; +} diff --git a/gdb/testsuite/gdb.guile/scm-equal.exp b/gdb/testsuite/gdb.guile/scm-equal.exp new file mode 100644 index 0000000..bf195b1 --- /dev/null +++ b/gdb/testsuite/gdb.guile/scm-equal.exp @@ -0,0 +1,55 @@ +# Copyright 2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file is part of the GDB testsuite. +# It tests equal? for the various gsmobs. + +load_lib gdb-guile.exp + +standard_testfile + +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { + return +} + +# Skip all tests if Guile scripting is not enabled. +if { [skip_guile_tests] } { continue } + +if ![gdb_guile_runto_main] { + return +} + +gdb_scm_test_silent_cmd "guile (define frame (selected-frame))" "get frame" +gdb_scm_test_silent_cmd "guile (define arch (frame-arch frame))" "get arch" + +gdb_test "guile (print (equal? (selected-frame) (newest-frame)))" \ + "= #t" "equal? frame" +gdb_test "guile (print (equal? (selected-frame) (frame-older (newest-frame))))" \ + "= #f" "not equal? frame" + +gdb_test "guile (print (equal? (make-value 1) (make-value 1)))" \ + "= #t" "equal? value" +gdb_test "guile (print (equal? (make-value 1) (make-value 2)))" \ + "= #f" "not equal? value" + +gdb_test "guile (print (equal? (value-type (make-value 1)) (value-type (make-value 2))))" \ + "= #t" "equal? type" +gdb_test "guile (print (equal? (value-type (make-value 1)) (value-type (make-value 2.5))))" \ + "= #f" "not equal? type" + +gdb_test "guile (print (equal? (lookup-global-symbol \"main\") (lookup-global-symbol \"main\")))" \ + "= #t" "equal? symbol" +gdb_test "guile (print (equal? (lookup-global-symbol \"main\") (lookup-global-symbol \"x\")))" \ + "= #f" "not equal? symbol"