001/* Run the Ptolemy model tests in the auto/knownFailedTests/ directory using Functional Mock-up Interface Master Algorithm (FMIMA) code generation under JUnit.
002
003   Copyright (c) 2014-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//// AutoCGCKnownFailedTests
040
041/**
042 * Run the Ptolemy model tests in the auto/knownFailedTests/ directory
043 * using Functional Mock-up Interface Master Algorithm (FMIMA) code
044 * generation under JUnit.
045 *
046 * <p> This test must be run from the directory that contains the
047 * auto/knowFailedTests/ directory, for example: </p>
048 *
049 * <pre>
050 * (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)
051 * </pre>
052 *
053 * <p>
054 * This test uses JUnitParams from
055 * <a href="http://code.google.com/p/junitparams/#in_browser">http://code.google.com/p/junitparams/</a>, which is released under
056 * <a href="http://www.apache.org/licenses/LICENSE-2.0#in_browser">Apache License 2.0</a>.
057 * </p>
058 *
059 * @author Christopher Brooks
060 * @version $Id$
061 * @since Ptolemy II 11.0
062 * @Pt.ProposedRating Red (cxh)
063 * @Pt.AcceptedRating Red (cxh)
064 */
065@RunWith(JUnitParamsRunner.class)
066public class AutoCGFMIMAKnownFailedTests extends AutoCGKnownFailedTests {
067
068    /**
069     * Find the ptolemy.cg.kernel.generic.GenericCodeGenerator class and its generateCode static
070     * method that takes an array of strings.
071     *
072     * @exception Throwable
073     *                If the class or constructor cannot be found.
074     */
075    @Override
076    @Before
077    public void setUp() throws Throwable {
078        super.setUp();
079    }
080
081    /**
082     * Generate, compile and run inline code for a model.
083     *
084     * @param fullPath The full path to the model file to be
085     * executed. If the fullPath ends with the value of the {@link
086     * #THERE_ARE_NO_AUTO_TESTS}, then the method returns
087     * immediately.
088     * @exception Throwable If thrown while executing the model.
089     */
090    // @Test
091    // @Parameters(method = "modelValues")
092    // public void runModelInline(String fullPath) throws Throwable {
093    //     runModel(fullPath, "fmima", false /* generateInSubdirectory */,
094    //             true /* inline */, 2500 /* maximumLinesPerBlock */,
095    //             false /*variablesAsArrays*/, "" /*generatorPackageList*/);
096    // }
097
098    /**
099     * Generate, compile and run non-inline code for a model.
100     *
101     * @param fullPath The full path to the model file to be
102     * executed. If the fullPath ends with the value of the {@link
103     * #THERE_ARE_NO_AUTO_TESTS}, then the method returns
104     * immediately.
105     * @exception Throwable If thrown while executing the model.
106     */
107    @Test
108    @Parameters(method = "modelValues")
109    public void runModelNoInline(String fullPath) throws Throwable {
110        runModel(fullPath, "fmima", false /* generateInSubdirectory */,
111                false /* inline */, 2500 /* maximumLinesPerBlock */,
112                false /*variablesAsArrays*/, "" /*generatorPackageList*/);
113    }
114}