FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OneShot-gpl3.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************
3  Copyright (C) 2012-2013 Hewlett-Packard Development Company, L.P.
4  Copyright (C) 2015 Siemens AG
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  version 2 as published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  ***********************************************************/
26 require_once ('CommonCliTest.php');
27 
33 {
38  public $gplv3;
39 
47  public function testOneShotgplv3()
48  {
49  /* check to see if the file exists */
50  $this->gplv3 = dirname(dirname(dirname(dirname(__FILE__)))).'/testing/dataFiles/TestData/licenses/gpl-3.0.txt';
51  $this->assertFileExists($this->gplv3,"OneShotgplv21Test FAILURE! $this->gplv3 not found\n");
52 
53  list($output,) = $this->runNomos("",array($this->gplv3));
54  list(,$fname,,,$license) = explode(' ', $output);
55 
56  $this->assertEquals($fname, 'gpl-3.0.txt', "Error filename $fname does not equal gpl-3.0.txt");
57  $this->assertEquals(trim($license), 'GPL-3.0',
58  "Error license does not equal FSF,GPL_v3. $license was returned");
59  }
60 }
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Tests for common CLI operations.
testOneShotgplv3()
Run NOMOS on GPL license.
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:321
char * trim(char *ptext)
Trimming whitespace.
Definition: fossconfig.c:695
Perform a one-shot analysis on GPL_v3 license.