FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OneShot-affero.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2012 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
8 require_once ('CommonCliTest.php');
23 {
28  public $affero1;
33  public $affero3;
34 
42  public function testOneShotafferos()
43  {
44  /* check to see if the file exists */
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");
49 
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");
56 
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");
63  }
64 }
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.
Definition: fossconfig.c:690
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:308