testygen revision 5c526acb82c882e41b655c31f5fa4425c87b671c
286N/A# Copyright (c) 2002 Japan Network Information Center. 286N/A# By using this file, you agree to the terms and conditions set forth bellow. 286N/A# LICENSE TERMS AND CONDITIONS 286N/A# The following License Terms and Conditions apply, unless a different 286N/A# license is obtained from Japan Network Information Center ("JPNIC"), 286N/A# a Japanese association, Kokusai-Kougyou-Kanda Bldg 6F, 2-3-4 Uchi-Kanda, 286N/A# Chiyoda-ku, Tokyo 101-0047, Japan. 286N/A# 1. Use, Modification and Redistribution (including distribution of any 286N/A# modified or derived work) in source and/or binary forms is permitted 286N/A# under this License Terms and Conditions. 286N/A# 2. Redistribution of source code must retain the copyright notices as they 286N/A# appear in each source code file, this License Terms and Conditions. 286N/A# 3. Redistribution in binary form must reproduce the Copyright Notice, 286N/A# this License Terms and Conditions, in the documentation and/or other 286N/A# materials provided with the distribution. For the purposes of binary 286N/A# distribution the "Copyright Notice" refers to the following language: 286N/A# "Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved." 286N/A# 4. The name of JPNIC may not be used to endorse or promote products 286N/A# derived from this Software without specific prior written approval of 286N/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 286N/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 286N/A# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JPNIC BE LIABLE 286N/A# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 286N/A# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 286N/A# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 286N/A# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 286N/A# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 286N/A# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 286N/A# ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 286N/A# Create a new testsuite context. 286N/A# Read `$file' and put the result into `$testsutie'. } elsif ($line =~ /^\{\s*$/) { if ($line =~ /^\}\s*$/) { if ($line =~ /^\/\/\#/) { } elsif ($line =~ /^\/\/--/) { } elsif ($line =~ /^\s*$/) { } elsif ($line =~ /^\s*$/) { if ($line =~ /^\/\/\#/) { } elsif ($line =~ /^\/\/--/) { if ($i !~ /^[0-9A-Za-z_\-]+$/) { sprintf("static void\ntestcase\%d(idn_testsuite_t ctx__) {\n", # Output `$testsuite' as source codes of C. die "failed to open the file, $!: $file\n"; "/* This file is automatically generated by testygen. */\n\n" . "main(int argc, char *argv[]) {\n" . "\tidn_testsuite_t ctx;\n" . "\tconst char *title;\n" . "\tidn_testsuite_create(&ctx);\n"; . "\tif (argc > 1 && strcmp(argv[1], \"-v\") == 0) {\n" . "\t idn_testsuite_setverbose(ctx);\n" . "\t idn_testsuite_runall(ctx);\n" . "\t idn_testsuite_run(ctx, argv + 1);\n" . "\tprintf(\"passed=%d, failed=%d, total=%d\\n\",\n" . "\t idn_testsuite_npassed(ctx),\n" . "\t idn_testsuite_nfailed(ctx),\n" . "\t idn_testsuite_ntestcases(ctx) - idn_testsuite_nskipped(ctx));\n" . "\tidn_testsuite_destroy(ctx);\n" warn "$0: [-o output-file] input-file\n";