001/* Run the Ptolemy model tests in the auto/ directory using Functional Mock-up Interface Master Algorithm (FMIMA) code generation under JUnit. 002 003 Copyright (c) 2015-2018 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028 029package ptolemy.util.test.junit; 030 031import org.junit.Before; 032import org.junit.Test; 033import org.junit.runner.RunWith; 034 035import junitparams.JUnitParamsRunner; 036import junitparams.Parameters; 037 038/////////////////////////////////////////////////////////////////// 039//// AutoCGFMIMANoInlineTests 040 041/** 042 * Run the Ptolemy model tests in the auto/ directory using Functional 043 * Mock-up Interface Master Algorithm (FMIMA) code generation under 044 * JUnit. 045 * 046 * <p>This test must be run from the directory that contains the auto/ directory, 047 * for example: 048 * </p> 049 * 050 * <pre> 051 * (cd $PTII/ptolemy/cg/kernel/generic/program/procedural/fmima/test/; java -classpath ${PTII}:${PTII}/lib/ptjacl.jar:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.4.0.jar:${PTII}/lib/jna-4.0.0-variadic.jar org.junit.runner.JUnitCore ptolemy.cg.kernel.generic.program.procedural.fmima.test.junit.JUnitCGFMIMATest) 052 * </pre> 053 * 054 * <p> 055 * This test uses JUnitParams from <a 056 * href="http://code.google.com/p/junitparams/#in_browser" 057 * >http://code.google.com/p/junitparams/</a>, which is released under <a 058 * href="http://www.apache.org/licenses/LICENSE-2.0#in_browser">Apache License 059 * 2.0</a>. 060 * </p> 061 * 062 * @author Christopher Brooks 063 * @version $Id$ 064 * @since Ptolemy II 11.0 065 * @Pt.ProposedRating Red (cxh) 066 * @Pt.AcceptedRating Red (cxh) 067 */ 068@RunWith(JUnitParamsRunner.class) 069public class AutoCGFMIMANoInlineTests extends AutoCGTests { 070 071 /** 072 * Find the ptolemy.cg.kernel.generic.GenericCodeGenerator class 073 * and its generateCode static method that takes an array of 074 * strings. 075 * 076 * @exception Throwable 077 * If the class or constructor cannot be found. 078 */ 079 @Override 080 @Before 081 public void setUp() throws Throwable { 082 super.setUp(); 083 } 084 085 /** 086 * Generate, compile and run non-inline code for a model. 087 * 088 * @param fullPath The full path to the model file to be 089 * executed. If the fullPath ends with the value of the {@link 090 * #THERE_ARE_NO_AUTO_TESTS}, then the method returns 091 * immediately. 092 * @exception Throwable If thrown while executing the model. 093 */ 094 @Test 095 @Parameters(method = "modelValues") 096 public void runModelNoInline(String fullPath) throws Throwable { 097 runModel(fullPath, "fmima", false /* generateInSubdirectory */, 098 false /* inline */, 2500 /* maximumLinesPerBlock */, 099 false /*variablesAsArrays*/, "" /*generatorPackageList*/); 100 } 101}