annotate test/build-bc-overload-tests.sh @ 16213:b1283d4c06c2

test: Use Octave coding standards for scripts in test/ directory. * test/bug-36025/@testclass/one.m, test/bug-36025/@testclass/testclass.m, test/bug-36025/@testclass/two.m, test/build-bc-overload-tests.sh, test/build-sparse-tests.sh, test/build_bc_overloads_expected.m, test/classes/@Blork/Blork.m, test/classes/@Blork/bleek.m, test/classes/@Blork/display.m, test/classes/@Blork/get.m, test/classes/@Blork/set.m, test/classes/@CPrecedenceTester1/CPrecedenceTester1.m, test/classes/@CPrecedenceTester1/tattack.m, test/classes/@CPrecedenceTester2/CPrecedenceTester2.m, test/classes/@CPrecedenceTester2/tattack.m, test/classes/@CPrecedenceTester3/CPrecedenceTester3.m, test/classes/@CPrecedenceTester3/tattack.m, test/classes/@Cork/Cork.m, test/classes/@Cork/click.m, test/classes/@Cork/display.m, test/classes/@Cork/get.m, test/classes/@Cork/set.m, test/classes/@Dork/Dork.m, test/classes/@Dork/bling.m, test/classes/@Dork/display.m, test/classes/@Dork/gack.m, test/classes/@Dork/get.m, test/classes/@Dork/getStash.m, test/classes/@Dork/private/myStash.m, test/classes/@Dork/set.m, test/classes/@Gork/Gork.m, test/classes/@Gork/cork.m, test/classes/@Gork/display.m, test/classes/@Gork/gark.m, test/classes/@Gork/get.m, test/classes/@Gork/set.m, test/classes/@Gork/subsasgn.m, test/classes/@Gork/subsref.m, test/classes/@Pork/Pork.m, test/classes/@Pork/bling.m, test/classes/@Pork/display.m, test/classes/@Pork/get.m, test/classes/@Pork/gurk.m, test/classes/@Pork/private/myStash.m, test/classes/@Pork/set.m, test/classes/@Sneetch/Sneetch.m, test/classes/@Sneetch/display.m, test/classes/@Snork/Snork.m, test/classes/@Snork/cack.m, test/classes/@Snork/display.m, test/classes/@Snork/double.m, test/classes/@Snork/end.m, test/classes/@Snork/eq.m, test/classes/@Snork/ge.m, test/classes/@Snork/get.m, test/classes/@Snork/getStash.m, test/classes/@Snork/gick.m, test/classes/@Snork/gt.m, test/classes/@Snork/horzcat.m, test/classes/@Snork/ldivide.m, test/classes/@Snork/le.m, test/classes/@Snork/loadobj.m, test/classes/@Snork/lt.m, test/classes/@Snork/minus.m, test/classes/@Snork/mldivide.m, test/classes/@Snork/mpower.m, test/classes/@Snork/mrdivide.m, test/classes/@Snork/mtimes.m, test/classes/@Snork/ne.m, test/classes/@Snork/plus.m, test/classes/@Snork/power.m, test/classes/@Snork/private/myStash.m, test/classes/@Snork/rdivide.m, test/classes/@Snork/saveobj.m, test/classes/@Snork/set.m, test/classes/@Snork/subsasgn.m, test/classes/@Snork/subsindex.m, test/classes/@Snork/subsref.m, test/classes/@Snork/tattack.m, test/classes/@Snork/times.m, test/classes/@Snork/uminus.m, test/classes/@Snork/uplus.m, test/classes/@Snork/vertcat.m, test/classes/@Spork/Spork.m, test/classes/@Spork/cack.m, test/classes/@Spork/display.m, test/classes/@Spork/geek.m, test/classes/@Spork/get.m, test/classes/@Spork/getStash.m, test/classes/@Spork/loadobj.m, test/classes/@Spork/private/myStash.m, test/classes/@Spork/saveobj.m, test/classes/@Spork/set.m, test/classes/classes.tst, test/ctor-vs-method/__trace__.m, test/error.tst, test/eval-catch.tst, test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m, test/for.tst, test/func.tst, test/global.tst, test/index.tst, test/io.tst, test/prefer.tst, test/range.tst, test/recursion.tst, test/return.tst, test/slice.tst, test/struct.tst, test/system.tst: Use Octave codings standards for scripts.
author Rik <rik@octave.org>
date Thu, 07 Mar 2013 09:26:17 -0800
parents 1af8d21608b7
children d63878346099
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)
16024
98f90d4dca20 fix rules for generated test files
John W. Eaton <jwe@octave.org>
parents: 16019
diff changeset
42 echo tbcover.m
16030
1af8d21608b7 rename all test files in the test directory from test_X.m to X.tst
John W. Eaton <jwe@octave.org>
parents: 16029
diff changeset
43 echo bc-overloads.tst
16019
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
44 for class in $CLASSES; do
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
45 echo @$class/tbcover.m
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
46 done
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
47 exit
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
48 ;;
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
49 --list-dirs)
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
50 for class in $CLASSES; do
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
51 echo @$class
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
52 done
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
53 exit
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
54 ;;
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
55 --list-classes)
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
56 echo $CLASSES
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
57 exit
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 *)
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
60 expected_results_file="$1"
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
61 ;;
5b2126a8c84f install tests and functions to run them
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
62 esac
10096
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
63 else
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
64 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
65 exit 1
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
66 fi
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
67
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
68 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
69 DIR="@$class"
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
70 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
71 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
72 % !!! DO NOT EDIT !!!
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
73 % 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
74 function s = tbcover (x, y)
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
75 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
76 EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
77 done
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
78
10096
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
79 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
80 % !!! DO NOT EDIT !!!
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
81 % 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
82 function s = tbcover (x, y)
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
83 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
84 EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
85
10097
462fa695a565 Correct sh test syntax in build_bc_overload_tests.sh
Rik <rdrider0-list@yahoo.com>
parents: 10096
diff changeset
86 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
87 exit
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
88 fi
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
89
16030
1af8d21608b7 rename all test files in the test directory from test_X.m to X.tst
John W. Eaton <jwe@octave.org>
parents: 16029
diff changeset
90 cat > bc-overloads.tst << EOF
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
91 ## !!! DO NOT EDIT !!!
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
92 ## 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
93 ## 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
94
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
95 %!shared ex
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
96 %! ex.double = 1;
16213
b1283d4c06c2 test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents: 16030
diff changeset
97 %! ex.single = single (1);
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
98 %! ex.logical = true;
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
99 %! ex.char = 'char';
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
100 %! ex.int8 = int8 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
101 %! ex.int16 = int16 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
102 %! ex.int32 = int32 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
103 %! ex.int64 = int64 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
104 %! ex.uint8 = uint8 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
105 %! ex.uint16 = uint16 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
106 %! ex.uint32 = uint32 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
107 %! ex.uint64 = uint64 (1);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
108 %! ex.cell = {};
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
109 %! ex.struct = struct ();
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
110 %! ex.function_handle = @numel;
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
111
10096
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
112 EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
113
10096
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
114 cat $expected_results_file | \
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
115 while read cl1 cl2 clr ; do
16030
1af8d21608b7 rename all test files in the test directory from test_X.m to X.tst
John W. Eaton <jwe@octave.org>
parents: 16029
diff changeset
116 cat >> bc-overloads.tst << EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
117 %% Name call
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
118 %!assert (tbcover (ex.$cl1, ex.$cl2), "$clr")
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
119 %% Handle call
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
120 %!assert ((@tbcover) (ex.$cl1, ex.$cl2), "$clr")
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
121
10096
ffc5426c85a4 build_bc_overload_tests.sh: accept expected results file as argument
John W. Eaton <jwe@octave.org>
parents: 10090
diff changeset
122 EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
123 done
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
124
16030
1af8d21608b7 rename all test files in the test directory from test_X.m to X.tst
John W. Eaton <jwe@octave.org>
parents: 16029
diff changeset
125 cat >> bc-overloads.tst << EOF
10090
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
126 %%test handles through cellfun
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
127 %!test
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
128 %! f = fieldnames (ex);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
129 %! n = numel (f);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
130 %! s = c1 = c2 = cell (n);
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
131 %! for i = 1:n
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
132 %! for j = 1:n
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
133 %! c1{i,j} = ex.(f{i});
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
134 %! c2{i,j} = ex.(f{j});
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
135 %! 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
136 %! endfor
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
137 %! endfor
655ab6f6c369 add tests for built-in class overloads
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
138 %! 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
139 EOF