Path: blob/master/runtime/gc_tests/rwlocktests/main.cpp
6000 views
/*******************************************************************************1* Copyright (c) 2001, 2018 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122#include "j9.h"23#include "CuTest.h"24#include "exelib_api.h"25#include <string.h>2627J9PortLibrary *sharedPortLibrary = NULL;2829extern CuSuite *GetRWLockTestSuite(void);3031UDATA RunAllTests(J9PortLibrary *portLibrary)32{33PORT_ACCESS_FROM_PORT(portLibrary);34CuString *output = CuStringNew();35CuSuite *suite = CuSuiteNew();3637CuSuiteAddSuite(suite, GetRWLockTestSuite());3839UDATA start = j9time_usec_clock();40CuSuiteRun(suite);41UDATA end = j9time_usec_clock();4243CuSuiteSummary(suite, output);44CuSuiteDetails(suite, output);4546printf("%s\n", output->buffer);47printf("Tests took %llu usec to run.\n", (unsigned long long) (end - start));4849if (0 == suite->failCount) {50return 0;51} else {52return 1;53}54}5556extern "C" UDATA57signalProtectedMain(struct J9PortLibrary *portLibrary, void *arg)58{59struct j9cmdlineOptions * startupOptions = (struct j9cmdlineOptions *) arg;60PORT_ACCESS_FROM_PORT(portLibrary);6162sharedPortLibrary = portLibrary;6364#if defined(J9VM_OPT_MEMORY_CHECK_SUPPORT)65/* This should happen before anybody allocates memory! Otherwise, shutdown will not work properly. */66memoryCheck_parseCmdLine( PORTLIB, startupOptions->argc - 1, startupOptions->argv );67#endif /* J9VM_OPT_MEMORY_CHECK_SUPPORT */6869cutest_parseCmdLine( PORTLIB, startupOptions->argc - 1, startupOptions->argv);7071return RunAllTests(portLibrary);72}737475