FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
OneShot-none.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************
3  Copyright (C) 2012 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  ***********************************************************/
25 require_once ('CommonCliTest.php');
26 
32 {
37  public $none;
38 
46  public function testOneShotnone()
47  {
48  /* check to see if the file exists */
49  $this->none = dirname(dirname(__FILE__)).'/testdata/noLic';
50  $this->assertFileExists($this->none,"OneShotnoneTest FAILURE! $this->none not found\n");
51 
52  list($output,) = $this->runNomos("",array($this->none));
53  list(,$fname,,,$license) = explode(' ', $output);
54 
55  $this->assertEquals($fname, 'noLic', "Error filename $fname does not equal noLic");
56  $this->assertEquals(trim($license), 'No_license_found', "Error license does not
57  equal No_license_found, $license was returned");
58  }
59 }
Perform a one-shot license analysis on a file with no license.
runNomos($args="", $files=array())
Run nomos using the arguments passed.
Tests for common CLI operations.
testOneShotnone()
Run NOMOS on file without license information.
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