Package com.github.maven_nar.cpptasks

Examples of com.github.maven_nar.cpptasks.CompilerDef


   * Test that setting classname to a class that doesn't support Compiler
   * throws a BuildException.
   *
   */
  public void testWrongType() {
    CompilerDef compilerDef = (CompilerDef) create();
    try {
      compilerDef
          .setClassname("com.github.maven_nar.cpptasks.msvc.MsvcLinker");
    } catch (BuildException ex) {
      return;
    }
    fail("Exception not thrown");
View Full Code Here


   * Tests if the rebuild attribute of the base compiler definition is
   * effective.
   *
   */
  public void testExtendsRebuild() {
    testExtendsRebuild(new CompilerDef());
  }
View Full Code Here

  /**
   * Tests that compilerarg's contained in the base compiler definition are
   * effective.
   */
  public void testExtendsCompilerArgs() {
    CompilerDef baseLinker = new CompilerDef();
    CompilerArgument linkerArg = new CompilerArgument();
    linkerArg.setValue("/base");
    baseLinker.addConfiguredCompilerArg(linkerArg);
    CompilerDef extendedLinker = (CompilerDef) createExtendedProcessorDef(
        baseLinker);
    String[] preArgs = getPreArguments(extendedLinker);
    // FREEHEP, passes extra option
    assertEquals(3, preArgs.length);
    assertEquals("/base", preArgs[0]);
View Full Code Here

  /**
   * Tests that defineset's contained in the base compiler definition are
   * effective.
   */
  public void testExtendsDefineSet() {
    CompilerDef baseCompiler = new CompilerDef();
    DefineSet defSet = new DefineSet();
    DefineArgument define = new DefineArgument();
    define.setName("foo");
    define.setValue("bar");
    defSet.addDefine(define);
    baseCompiler.addConfiguredDefineset(defSet);
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    String[] preArgs = getPreArguments(extendedCompiler);
    // BEGINFREEHEP, passes extra option
    assertEquals(3, preArgs.length);
    assertEquals("-Dfoo=bar", preArgs[2]);
View Full Code Here

  /**
   * Tests that includepath's contained in the base compiler definition are
   * effective.
   */
  public void testExtendsIncludePath() {
    CompilerDef baseCompiler = new CompilerDef();
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    IncludePath path = baseCompiler.createIncludePath();
    path.setPath("/tmp");
    String[] preArgs = getPreArguments(extendedCompiler);
    // BEGINFREEHEP, passes extra option
View Full Code Here

  /**
   * Tests that sysincludepath's contained in the base compiler definition are
   * effective.
   */
  public void testExtendsSysIncludePath() {
    CompilerDef baseCompiler = new CompilerDef();
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    SystemIncludePath path = baseCompiler.createSysIncludePath();
    path.setPath("/tmp");
    String[] preArgs = getPreArguments(extendedCompiler);
    System.out.println("Class: " + baseCompiler + " and: " + extendedCompiler);
View Full Code Here

  /**
   * Tests that the extend attribute of the base compiler definition is
   * effective.
   */
  public void testExtendsExceptions() {
    CompilerDef baseCompiler = new CompilerDef();
    baseCompiler.setExceptions(true);
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    setCompilerName(extendedCompiler, "msvc");
    String[] preArgs = getPreArguments(extendedCompiler);
    assertEquals("/EHsc", preArgs[2]);
  }
View Full Code Here

  /**
   * Tests that the multithread attribute of the base compiler definition is
   * effective.
   */
  public void testExtendsMultithreaded() {
    CompilerDef baseCompiler = new CompilerDef();
    baseCompiler.setMultithreaded(false);
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    setCompilerName(extendedCompiler, "msvc");
    CCTask cctask = new CCTask();
    LinkType linkType = new LinkType();
    linkType.setStaticRuntime(true);
    CommandLineCompilerConfiguration config = (CommandLineCompilerConfiguration)
        extendedCompiler
        .createConfiguration(cctask, linkType, null, null, null);
    String[] preArgs = config.getPreArguments();
    assertEquals("/ML", preArgs[3]);
  }
View Full Code Here

  /**
   * Tests that the name attribute in the base compiler is effective.
   */
  public void testExtendsName() {
    CompilerDef baseCompiler = new CompilerDef();
    setCompilerName(baseCompiler, "msvc");
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    extendedCompiler.setExceptions(true);
    String[] preArgs = getPreArguments(extendedCompiler);
    assertEquals("/EHsc", preArgs[2]);
  }
View Full Code Here

  /**
   * Tests that the classname attribute in the base compiler is effective.
   */
  public void testExtendsClassname() {
    CompilerDef baseCompiler = new CompilerDef();
    baseCompiler
        .setClassname(
      "com.github.maven_nar.cpptasks.msvc.MsvcCCompiler");
    CompilerDef extendedCompiler = (CompilerDef) createExtendedProcessorDef(
        baseCompiler);
    extendedCompiler.setExceptions(true);
    String[] preArgs = getPreArguments(extendedCompiler);
    assertEquals("/EHsc", preArgs[2]);
  }
View Full Code Here

TOP

Related Classes of com.github.maven_nar.cpptasks.CompilerDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.