1 //==========================================================================
5 // Host side implementation of the test support routines.
7 //==========================================================================
8 //####COPYRIGHTBEGIN####
10 // ----------------------------------------------------------------------------
11 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
13 // This file is part of the eCos host tools.
15 // This program is free software; you can redistribute it and/or modify it
16 // under the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 of the License, or (at your option)
20 // This program is distributed in the hope that it will be useful, but WITHOUT
21 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
25 // You should have received a copy of the GNU General Public License along with
26 // this program; if not, write to the Free Software Foundation, Inc.,
27 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 // ----------------------------------------------------------------------------
31 //####COPYRIGHTEND####
32 //==========================================================================
33 //#####DESCRIPTIONBEGIN####
36 // Contributors: bartv
41 //####DESCRIPTIONEND####
42 //==========================================================================
47 #include <cyg/infra/testcase.h>
49 // Initialization is a no-op for the host side testing infrastructure.
50 // Only batch programs are likely to use these testing facilities so
51 // it is safe to assume that stdio is available.
58 // This simply implements the current interface, warts and all.
59 // It is necessary to keep track of any failures or invalid
61 static int failures = 0;
64 cyg_test_output(Cyg_test_code status, const char* msg, int line_number, const char* file)
66 if (CYGNUM_TEST_FAIL == status)
74 if (CYGNUM_TEST_FAIL == status) {
75 printf("FAIL:<%s> Line: %d, File: %s\n", msg, line_number, file);
78 (CYGNUM_TEST_PASS == status) ? "PASS" :
79 (CYGNUM_TEST_EXIT == status) ? "EXIT" :
80 (CYGNUM_TEST_INFO == status) ? "INFO" :
81 (CYGNUM_TEST_GDBCMD == status) ? "GDBCMD" :
82 (CYGNUM_TEST_NA == status) ? "NA" : "UNKNOWN STATUS",
91 exit( (0 < failures) ? EXIT_FAILURE : EXIT_SUCCESS );