-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
if a bbappend would have contained a require or include statement, the links of the include file would have been computed the same as a bb file, thus preventing to identify the bbappend as a scanable file, if it would have been passed alone into the stash parsing. Fix that by limiting the "linked appends" to bb files only. Closes #150 Signed-off-by: Konrad Weihmann <[email protected]>
- Loading branch information
1 parent
a7932d7
commit 57e8e8d
Showing
5 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from logging import log | ||
import unittest | ||
import os | ||
import sys | ||
|
||
|
||
class OelintBBAppendsTest(unittest.TestCase): | ||
|
||
RECIPE = os.path.join(os.path.dirname(__file__), "testlayer/recipes-appends/test.bb") | ||
RECIPE_APPEND = os.path.join(os.path.dirname(__file__), "testlayer/recipes-appends/test.bbappend") | ||
|
||
def setUp(self): | ||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/../")) | ||
|
||
def test_recipe(self): | ||
from oelint_parser.cls_stash import Stash | ||
self.__stash = Stash() | ||
self.__stash.AddFile(OelintBBAppendsTest.RECIPE) | ||
self.__stash.Finalize() | ||
self.assertEqual(len(self.__stash.GetLoneAppends()), 0, msg="No lone appends") | ||
self.assertEqual(len(self.__stash.GetRecipes()), 1, msg="One recipe") | ||
|
||
def test_bbappend(self): | ||
from oelint_parser.cls_stash import Stash | ||
self.__stash = Stash() | ||
self.__stash.AddFile(OelintBBAppendsTest.RECIPE_APPEND) | ||
self.__stash.Finalize() | ||
self.assertEqual(len(self.__stash.GetLoneAppends()), 1, msg="One lone appends") | ||
self.assertEqual(len(self.__stash.GetRecipes()), 0, msg="No recipe") | ||
|
||
def test_bbappend_and_recipe(self): | ||
from oelint_parser.cls_stash import Stash | ||
self.__stash = Stash() | ||
self.__stash.AddFile(OelintBBAppendsTest.RECIPE) | ||
self.__stash.AddFile(OelintBBAppendsTest.RECIPE_APPEND) | ||
self.__stash.Finalize() | ||
self.assertEqual(len(self.__stash.GetLoneAppends()), 0, msg="No lone appends") | ||
self.assertEqual(len(self.__stash.GetRecipes()), 1, msg="One recipe") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require test.inc | ||
|
||
B = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require test.inc | ||
|
||
C = "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A = "1" |