aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-09-14 17:04:49 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-09-14 17:04:49 +0000
commit5d2867a59dcf3b2c727d72cd771d40aa1850b8e0 (patch)
tree0e79618cdf9c99fda39659e3ae0ecee19841b8d9 /tests
parent4686cfe48234359c2c184210b67a7cbc8de7b73b (diff)
downloadcflow-5d2867a59dcf3b2c727d72cd771d40aa1850b8e0.tar.gz
cflow-5d2867a59dcf3b2c727d72cd771d40aa1850b8e0.tar.bz2
New test
Diffstat (limited to 'tests')
-rw-r--r--tests/direct.at44
-rw-r--r--tests/recurse.at46
-rw-r--r--tests/reverse.at50
3 files changed, 140 insertions, 0 deletions
diff --git a/tests/direct.at b/tests/direct.at
new file mode 100644
index 0000000..4702df5
--- /dev/null
+++ b/tests/direct.at
@@ -0,0 +1,44 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2005 Sergey Poznyakoff
+#
+# 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 2, 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+AT_SETUP([direct tree])
+AT_KEYWORDS([direct])
+
+CFLOW_CHECK([
+foo()
+{
+}
+
+bar()
+{
+ foo();
+}
+
+main()
+{
+ bar();
+ foo();
+}
+],
+[main() <main () at prog:11>:
+ bar() <bar () at prog:6>:
+ foo() <foo () at prog:2>
+ foo() <foo () at prog:2>])
+
+AT_CLEANUP
+
diff --git a/tests/recurse.at b/tests/recurse.at
new file mode 100644
index 0000000..46c23ce
--- /dev/null
+++ b/tests/recurse.at
@@ -0,0 +1,46 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2005 Sergey Poznyakoff
+#
+# 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 2, 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+AT_SETUP([recursive calls])
+AT_KEYWORDS([recurse])
+
+CFLOW_CHECK([
+foo()
+{
+ bar();
+}
+
+bar()
+{
+ bar();
+ foo();
+}
+
+main()
+{
+ bar();
+}
+],
+[main() <main () at prog:13>:
+ bar() <bar () at prog:7> (R):
+ bar() <bar () at prog:7> (recursive: see 2)
+ foo() <foo () at prog:2> (R):
+ bar() <bar () at prog:7> (recursive: see 2)])
+
+AT_CLEANUP
+
diff --git a/tests/reverse.at b/tests/reverse.at
new file mode 100644
index 0000000..7d21871
--- /dev/null
+++ b/tests/reverse.at
@@ -0,0 +1,50 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2005 Sergey Poznyakoff
+#
+# 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 2, 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+
+AT_SETUP([reverse tree])
+AT_KEYWORDS([reverse])
+
+CFLOW_ENV([-r], [
+
+CFLOW_CHECK([
+foo()
+{
+}
+
+bar()
+{
+ foo();
+}
+
+main()
+{
+ bar();
+ foo();
+}
+],
+[bar() <bar () at prog:6>:
+ main() <main () at prog:11>
+foo() <foo () at prog:2>:
+ bar() <bar () at prog:6>:
+ main() <main () at prog:11>
+ main() <main () at prog:11>
+main() <main () at prog:11>])
+])
+
+AT_CLEANUP
+

Return to:

Send suggestions and report system problems to the System administrator.