1 | # -*- tcl -*- |
---|
2 | # Commands covered: pkgconfig |
---|
3 | # |
---|
4 | # This file contains a collection of tests for one or more of the Tcl |
---|
5 | # built-in commands. Sourcing this file into Tcl runs the tests and |
---|
6 | # generates output for errors. No output means no errors were found. |
---|
7 | # |
---|
8 | # Copyright (c) 1991-1993 The Regents of the University of California. |
---|
9 | # Copyright (c) 1994-1996 Sun Microsystems, Inc. |
---|
10 | # Copyright (c) 1998-1999 by Scriptics Corporation. |
---|
11 | # |
---|
12 | # See the file "license.terms" for information on usage and redistribution |
---|
13 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
14 | # |
---|
15 | # RCS: @(#) $Id: config.test,v 1.4 2004/10/29 15:39:10 dkf Exp $ |
---|
16 | |
---|
17 | if {[lsearch [namespace children] ::tcltest] == -1} { |
---|
18 | package require tcltest |
---|
19 | namespace import -force ::tcltest::* |
---|
20 | } |
---|
21 | |
---|
22 | test pkgconfig-1.1 {query keys} { |
---|
23 | lsort [::tcl::pkgconfig list] |
---|
24 | } {64bit bindir,install bindir,runtime compile_debug compile_stats debug docdir,install docdir,runtime includedir,install includedir,runtime libdir,install libdir,runtime mem_debug optimized profiled scriptdir,install scriptdir,runtime threaded} |
---|
25 | test pkgconfig-1.2 {query keys multiple times} { |
---|
26 | string compare [::tcl::pkgconfig list] [::tcl::pkgconfig list] |
---|
27 | } 0 |
---|
28 | test pkgconfig-1.3 {query value multiple times} { |
---|
29 | string compare \ |
---|
30 | [::tcl::pkgconfig get bindir,install] \ |
---|
31 | [::tcl::pkgconfig get bindir,install] |
---|
32 | } 0 |
---|
33 | |
---|
34 | |
---|
35 | test pkgconfig-2.0 {error: missing subcommand} { |
---|
36 | catch {::tcl::pkgconfig} msg |
---|
37 | set msg |
---|
38 | } {wrong # args: should be "::tcl::pkgconfig subcommand ?argument?"} |
---|
39 | test pkgconfig-2.1 {error: illegal subcommand} { |
---|
40 | catch {::tcl::pkgconfig foo} msg |
---|
41 | set msg |
---|
42 | } {bad subcommand "foo": must be get or list} |
---|
43 | test pkgconfig-2.2 {error: list with arguments} { |
---|
44 | catch {::tcl::pkgconfig list foo} msg |
---|
45 | set msg |
---|
46 | } {wrong # args: should be "::tcl::pkgconfig list"} |
---|
47 | test pkgconfig-2.3 {error: get without arguments} { |
---|
48 | catch {::tcl::pkgconfig get} msg |
---|
49 | set msg |
---|
50 | } {wrong # args: should be "::tcl::pkgconfig get key"} |
---|
51 | test pkgconfig-2.4 {error: query unknown key} { |
---|
52 | catch {::tcl::pkgconfig get foo} msg |
---|
53 | set msg |
---|
54 | } {key not known} |
---|
55 | test pkgconfig-2.5 {error: query with to many arguments} { |
---|
56 | catch {::tcl::pkgconfig get foo bar} msg |
---|
57 | set msg |
---|
58 | } {wrong # args: should be "::tcl::pkgconfig subcommand ?argument?"} |
---|
59 | |
---|
60 | # cleanup |
---|
61 | ::tcltest::cleanupTests |
---|
62 | return |
---|