Mercurial > octave
annotate test/build_bc_overload_tests.sh @ 16019:5b2126a8c84f
install tests and functions to run them
* configure.ac (octtestsdir): New variable.
* build-aux/common.mk (octtestsdir): New variable.
(do_subst_default_vals): Substitute it.
(test-file-commands): New macro.
(%.cc-tst:%.cc, %.yy-tst:%.yy, %.ll-tst:%.ll): New rules.
* libinterp/Makefile.am (TST_FILES_SRC, TST_FILES, libinterptestsdir,
nobase_libinterptests_DATA): New variables.
* defaults.in.h (OCTAVE_OCTTESTSDIR): New macro.
* liboctave/Makefile.am (LIBOCTAVE_TST_SRC, TST_FILES_SRC, TST_FILES,
liboctavetestsdir, nobase_liboctavetests_DATA): New variables.
* toplev.cc (Foctave_config_info): Include octtestsdir in the struct.
* fntests.m: Look in topbuilddir for C++ test files.
* __run_test_suite__.m: New function, extracted from
test/fntests.m. Look for -tst files, not .cc files. Don't report
-tst files that are missing tests (there won't be any).
* __prog_output_assert__.m, __printf_assert__.m: New functions,
extracted from __run_test_suite__.m and renamed from
prog_output_assert and printf_assert. Change all uses.
* scripts/testfun/module.mk (testfun_FCN_FILES): Include new files in
the list.
* test/Makefile.am (GENERATED_BC_OVERLOADS_DIRS,
GENERATED_BC_OVERLOADS_FILES, fixedtestsdir, nobase_fixedtests_DATA):
New variables.
(CLEANFILES): Include $(GENERATED_BC_OVERRLOADS_FILES) in the list.
(clean-local): Use $(GENERATED_BC_OVERLOADS_DIRS).
* build_bc_overload_tests.sh: New options, --list-files, --list-dirs,
and --list-classes.
* test/classes/module.mk (classes_FCN_FILES): Include recently added
.m files in the list.
* test.m: Use "var" argument for exist in tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 08 Feb 2013 16:53:14 -0500 |
parents | 72c96de7a403 |
children | 98f90d4dca20 |
rev | line source |
---|---|
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
1 #! /bin/sh |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
2 |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
14131
diff
changeset
|
3 # Copyright (C) 2010-2012 VZLU Prague |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 # |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 # This file is part of Octave. |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 # |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 # Octave is free software; you can redistribute it and/or modify it |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 # under the terms of the GNU General Public License as published by the |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 # Free Software Foundation; either version 3 of the License, or (at |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 # your option) any later version. |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 # |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
12 # Octave is distributed in the hope that it will be useful, but WITHOUT |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 # for more details. |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 # |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU General Public License |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 # along with Octave; see the file COPYING. If not, see |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 # <http://www.gnu.org/licenses/>. |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
21 CLASSES=" |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
22 double |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
23 single |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
24 char |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
25 logical |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
26 int8 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
27 int16 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
28 int32 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
29 int64 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
30 uint8 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
31 uint16 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
32 uint32 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
33 uint64 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
34 struct |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
35 cell |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
36 function_handle |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
37 " |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
39 if [ $# -eq 1 ]; then |
16019
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
40 case "$1" in |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
41 --list-files) |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
42 echo tbcover.m test_bc_overloads.m |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
43 for class in $CLASSES; do |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
44 echo @$class/tbcover.m |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
45 done |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
46 exit |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
47 ;; |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
48 --list-dirs) |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
49 for class in $CLASSES; do |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
50 echo @$class |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
51 done |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
52 exit |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
53 ;; |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
54 --list-classes) |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
55 echo $CLASSES |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
56 exit |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
57 ;; |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
58 *) |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
59 expected_results_file="$1" |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
60 ;; |
5b2126a8c84f
install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
61 esac |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
62 else |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
63 echo "usage: build_bc_overload_tests.sh expected-results-file" 1>&2 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
64 exit 1 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
65 fi |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
66 |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
67 for class in $CLASSES; do |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
68 DIR="@$class" |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
69 test -d $DIR || mkdir $DIR || { echo "error: could not create $DIR"; exit; } |
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
70 cat > $DIR/tbcover.m << EOF |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
71 % !!! DO NOT EDIT !!! |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
72 % generated automatically by build_bc_overload_tests.sh |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
73 function s = tbcover (x, y) |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
74 s = '$class'; |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
75 EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 done |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
77 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
78 cat > tbcover.m << EOF |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
79 % !!! DO NOT EDIT !!! |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
80 % generated automatically by build_bc_overload_tests.sh |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
81 function s = tbcover (x, y) |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
82 s = 'none'; |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
83 EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
84 |
10097
462fa695a565
Correct sh test syntax in build_bc_overload_tests.sh
Rik <rdrider0-list@yahoo.com>
parents:
10096
diff
changeset
|
85 if test "$1" = "overloads_only" ; then |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
86 exit |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
87 fi |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
88 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
89 cat > test_bc_overloads.m << EOF |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
90 ## !!! DO NOT EDIT !!! |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
91 ## THIS IS AN AUTOMATICALLY GENERATED FILE |
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
92 ## modify build_bc_overload_tests.sh to generate the tests you need. |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
93 |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
94 %!shared ex |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
95 %! ex.double = 1; |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
96 %! ex.single = single(1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
97 %! ex.logical = true; |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
98 %! ex.char = 'char'; |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
99 %! ex.int8 = int8 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
100 %! ex.int16 = int16 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
101 %! ex.int32 = int32 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
102 %! ex.int64 = int64 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
103 %! ex.uint8 = uint8 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
104 %! ex.uint16 = uint16 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
105 %! ex.uint32 = uint32 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
106 %! ex.uint64 = uint64 (1); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
107 %! ex.cell = {}; |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
108 %! ex.struct = struct (); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
109 %! ex.function_handle = @numel; |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
110 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
111 EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
113 cat $expected_results_file | \ |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
114 while read cl1 cl2 clr ; do |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
115 cat >> test_bc_overloads.m << EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
116 %% Name call |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
117 %!assert (tbcover (ex.$cl1, ex.$cl2), "$clr") |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
118 %% Handle call |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
119 %!assert ((@tbcover) (ex.$cl1, ex.$cl2), "$clr") |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
120 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
121 EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
122 done |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
123 |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
124 cat >> test_bc_overloads.m << EOF |
10090
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
125 %%test handles through cellfun |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
126 %!test |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
127 %! f = fieldnames (ex); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
128 %! n = numel (f); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
129 %! s = c1 = c2 = cell (n); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
130 %! for i = 1:n |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
131 %! for j = 1:n |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
132 %! c1{i,j} = ex.(f{i}); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
133 %! c2{i,j} = ex.(f{j}); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
134 %! s{i,j} = tbcover (ex.(f{i}), ex.(f{j})); |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
135 %! endfor |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
136 %! endfor |
655ab6f6c369
add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
137 %! assert (cellfun (@tbcover, c1, c2, "uniformoutput", false), s); |
10096
ffc5426c85a4
build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents:
10090
diff
changeset
|
138 EOF |