8 require_once (
'CommonCliTest.php');
45 $this->affero1 = dirname(dirname(dirname(dirname(__FILE__)))).
'/testing/dataFiles/TestData/licenses/Affero-v1.0';
46 $this->affero3 = dirname(dirname(dirname(dirname(__FILE__)))).
'/testing/dataFiles/TestData/licenses/agpl-3.0.txt';
47 $this->assertFileExists($this->affero1,
"OneShotaffero1Test FAILURE! $this->affero1 not found\n");
48 $this->assertFileExists($this->affero3,
"OneShotaffero1Test FAILURE! $this->affero3 not found\n");
50 list($output,) = $this->
runNomos(
"",array($this->affero1));
51 list(,$fname1,,,$license1) = explode(
' ', $output);
52 $this->assertEquals($fname1,
'Affero-v1.0',
"Error processed filename $fname1
53 does not equal Affero-v1.0");
54 $this->assertEquals(
trim($license1),
'AGPL-1.0-only',
"Error license does not equal Affero_v1,
55 $license1 was returned");
57 list($out3,) = $this->
runNomos(
"",array($this->affero3));
58 list(,$fname,,,$license) = explode(
' ', $out3);
59 $this->assertEquals($fname,
'agpl-3.0.txt',
"Error processed filename $fname
60 does not equal agpl-3.0.txt");
61 $this->assertEquals(
trim($license),
'AGPL-3.0-only',
"Error license
62 does not equal Affero_v3, $license was returned");
Tests for common CLI operations.
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Perform a one-shot license analysis on a affero 2 and 3 licenses.
testOneShotafferos()
Run NOMOS on affero1 and affero3.
char * trim(char *ptext)
Trimming whitespace.
list_t type structure used to keep various lists. (e.g. there are multiple lists).