1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks.gcc;
21
22 import java.io.File;
23
24 import com.github.maven_nar.cpptasks.compiler.AbstractProcessor;
25 import com.github.maven_nar.cpptasks.parser.CParser;
26 import com.github.maven_nar.cpptasks.parser.FortranParser;
27 import com.github.maven_nar.cpptasks.parser.Parser;
28
29
30
31
32
33 public class TestGccCCompiler extends TestGccCompatibleCCompiler {
34 public TestGccCCompiler(final String name) {
35 super(name);
36 }
37
38 @Override
39 protected GccCompatibleCCompiler create() {
40 return GccCCompiler.getInstance();
41 }
42
43 public void testBidObjectiveAssembly() {
44 final GccCCompiler compiler = GccCCompiler.getInstance();
45 assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler.bid("foo.s"));
46 }
47
48 public void testBidObjectiveC() {
49 final GccCCompiler compiler = GccCCompiler.getInstance();
50 assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler.bid("foo.m"));
51 }
52
53 public void testBidObjectiveCpp() {
54 final GccCCompiler compiler = GccCCompiler.getInstance();
55 assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler.bid("foo.mm"));
56 }
57
58 public void testBidPreprocessedCpp() {
59 final GccCCompiler compiler = GccCCompiler.getInstance();
60 assertEquals(AbstractProcessor.DEFAULT_PROCESS_BID, compiler.bid("foo.ii"));
61 }
62
63 public void testCreateCParser1() {
64 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo.c"));
65 assertTrue(parser instanceof CParser);
66 }
67
68 public void testCreateCParser2() {
69 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo."));
70 assertTrue(parser instanceof CParser);
71 }
72
73 public void testCreateCParser3() {
74 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo"));
75 assertTrue(parser instanceof CParser);
76 }
77
78 public void testCreateFortranParser1() {
79 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo.f"));
80 assertTrue(parser instanceof FortranParser);
81 }
82
83 public void testCreateFortranParser2() {
84 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo.FoR"));
85 assertTrue(parser instanceof FortranParser);
86 }
87
88 public void testCreateFortranParser3() {
89 final Parser parser = GccCCompiler.getInstance().createParser(new File("foo.f90"));
90 assertTrue(parser instanceof FortranParser);
91 }
92
93 }