26 require_once (
'CommonCliTest.php');
44 'Affero-v1.0' =>
'AGPL-1.0',
45 'Apache-v1.1' =>
'Apache-1.1',
46 'ApacheLicense-v2.0' =>
'Apache-2.0',
47 'ApacheV2.0.gz' =>
'No_license_found',
48 'BSD_style_a.txt' =>
'BSD-style',
49 'BSD_style_b.txt' =>
'BSD-style',
50 'BSD_style_c.txt' =>
'BSD-3-Clause',
51 'BSD_style_d.txt' =>
'BSD-3-Clause',
52 'BSD_style_e.txt' =>
'BSD',
53 'BSD_style_f.txt' =>
'BSD-2-Clause',
54 'BSD_style_g.txt' =>
'BSD-3-Clause',
55 'BSD_style_h.txt' =>
'BSD',
56 'BSD_style_i.txt' =>
'BSD-3-Clause',
57 'BSD_style_j.txt' =>
'BSD-3-Clause',
58 'BSD_style_k.txt' =>
'Apache-1.1-style',
59 'BSD_style_l.txt' =>
'BSD-style',
60 'BSD_style_m.txt' =>
'BSD',
61 'BSD_style_n.txt' =>
'BSD-3-Clause',
62 'BSD_style_o.txt' =>
'BSD',
63 'BSD_style_p.txt' =>
'BSD-style',
64 'BSD_style_q.txt' =>
'BSD-style',
65 'BSD_style_r.txt' =>
'BSD-style',
66 'BSD_style_s.txt' =>
'OpenSSL',
67 'BSD_style_t.txt' =>
'SSLeay',
68 'BSD_style_u.txt' =>
'BSD-3-Clause',
69 'BSD_style_v.txt' =>
'MIT-CMU-style',
70 'BSD_style_w.txt' =>
'BSD-style',
71 'BSD_style_x.txt' =>
'BSD-style,Govt-work',
72 'BSD_style_y.txt' =>
'PHP-3.0',
73 'BSD_style_z.txt' =>
'OLDAP-2.3',
74 'FILEgpl3.0' =>
'GPL-3.0+',
75 'FILEgplv2.1' =>
'LGPL-2.1+',
76 'OSIzlibLicense-2006-10-31' =>
'Zlib',
77 'RCSL_v3.0_a.txt' =>
'Dual-license,RCSL-3.0',
78 'RPSL_v1.0_a.txt' =>
'RPSL-1.0',
79 'RPSL_v1.0_b.txt' =>
'RPSL-1.0',
80 'agpl-3.0.txt' =>
'AGPL-3.0',
81 'apple.lic' =>
'APSL-2.0',
82 'gpl-3.0.txt' =>
'GPL-3.0+',
83 'gplv2.1' =>
'LGPL-2.1+',
84 'zlibLicense-1.2.2-2004-Oct-03' =>
'Zlib',
85 'DNSDigest.c' =>
'Apache-2.0,BSD-style,GPL',
86 'Oracle-Berkeley-DB.java' =>
'Oracle-Berkeley-DB',
87 'sleepycat.php' =>
'Sleepycat',
88 'jslint.js' =>
'JSON',
101 $this->files = dirname(dirname(dirname(dirname(__FILE__)))).
'/testing/dataFiles/TestData/licenses/*';
103 $this->gplv3 = dirname(dirname(dirname(dirname(__FILE__)))).
'/testing/dataFiles/TestData/licenses/gpl-3.0.txt';
104 $this->assertTrue(file_exists(dirname(dirname(dirname(dirname(__FILE__)))).
'/testing/dataFiles/TestData/licenses/'));
107 $out = explode(
"\n",
trim($output));
109 foreach($out as $nomosResults)
111 list(,$fileName,,,$licenses) = preg_split(
'/[\s]+/', $nomosResults);
112 $this->assertArrayHasKey($fileName, $this->Results,
113 "Failure, filename $fileName was not found in the master results\n");
114 $expected = $this->Results[$fileName];
115 $this->assertContains($licenses, $expected,
116 "Failure, Master results $expected \n do not match current results $licenses \n");
testOneShotmultiFile()
Run NOMOS on multiple files at once.
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Tests for common CLI operations.
Perform a one-shot license analysis on multiple files.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
char * trim(char *ptext)
Trimming whitespace.