FOSSology  4.4.0
Open Source License Compliance by Open Source Software
OneShot-gpl3.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2012-2013 Hewlett-Packard Development Company, L.P.
4  SPDX-FileCopyrightText: © 2015 Siemens AG
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
15 require_once ('CommonCliTest.php');
16 
22 {
27  public $gplv3;
28 
36  public function testOneShotgplv3()
37  {
38  /* check to see if the file exists */
39  $this->gplv3 = dirname(dirname(dirname(dirname(__FILE__)))).'/testing/dataFiles/TestData/licenses/gpl-3.0.txt';
40  $this->assertFileExists($this->gplv3,"OneShotgplv21Test FAILURE! $this->gplv3 not found\n");
41 
42  list($output,) = $this->runNomos("",array($this->gplv3));
43  list(,$fname,,,$license) = explode(' ', $output);
44 
45  $this->assertEquals($fname, 'gpl-3.0.txt', "Error filename $fname does not equal gpl-3.0.txt");
46  $this->assertEquals(trim($license), 'GPL-3.0-only',
47  "Error license does not equal FSF,GPL_v3. $license was returned");
48  }
49 }
Tests for common CLI operations.
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Perform a one-shot analysis on GPL_v3 license.
testOneShotgplv3()
Run NOMOS on GPL license.
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