-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement lobster source filters kind and prefix (#22)
- add integration test at integration-tests/projects/filter - add source filter description to docs/config_files.md
- Loading branch information
Showing
16 changed files
with
669 additions
and
10 deletions.
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
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,5 @@ | ||
cppcode.lobster | ||
report.lobster | ||
requirements.lobster | ||
lobster_report.html | ||
json.lobster |
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,12 @@ | ||
cc_library( | ||
name = "foofunc", | ||
srcs = ["foo.h", "foo.cpp"] | ||
) | ||
|
||
cc_test( | ||
name = "foo_test", | ||
srcs = ["test.cpp"], | ||
deps = ["@com_google_googletest//:gtest_main", | ||
"foofunc", | ||
"//support/gtest/include:lobster_gtest"] | ||
) |
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,31 @@ | ||
LOBSTER_ROOT:=../../.. | ||
LOBSTER_WIP:=$(LOBSTER_ROOT)/work-in-progress | ||
|
||
PATH:=$(LOBSTER_ROOT)/test_install/bin:$(PATH) | ||
PYTHONPATH:=$(wildcard $(LOBSTER_ROOT)/test_install/lib/python*/site-packages) | ||
|
||
CLANG_TIDY:=$(LOBSTER_ROOT)/../llvm-project/build/bin/clang-tidy | ||
|
||
THIS_TEST:=$(shell realpath --relative-to $(LOBSTER_ROOT) $(PWD)) | ||
THIS_TEST_ESCAPED:=$(subst /,\\/,$(THIS_TEST)) | ||
|
||
html_report.html: cppcode.lobster requirements.lobster lobster.conf json.lobster | ||
@lobster-report | ||
@lobster-online-report | ||
@cp report.lobster report.reference_output | ||
@lobster-html-report | ||
|
||
cppcode.lobster: foo.h foo.cpp | ||
@lobster-cpp foo.cpp foo.h \ | ||
--out="cppcode.lobster" --clang-tidy $(CLANG_TIDY) | ||
|
||
requirements.lobster: example.rsl softreq_example.trlc sysreq_example.trlc | ||
@lobster-trlc example.rsl softreq_example.trlc sysreq_example.trlc\ | ||
--out="requirements.lobster" | ||
|
||
json.lobster: test_example.json | ||
@lobster-json test_example.json \ | ||
--name-attribute "name" \ | ||
--tag-attribute "tags" \ | ||
--justification-attribute "justification" \ | ||
--out="json.lobster" |
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,20 @@ | ||
package example | ||
|
||
type System_Requirement | ||
{ | ||
text String | ||
} | ||
|
||
type Software_Requirement | ||
{ | ||
text String | ||
trace_trlc optional System_Requirement [1 .. *] | ||
} | ||
|
||
checks System_Requirement { | ||
len(text) >= 10, warning "this is a bit short", text | ||
} | ||
|
||
checks Software_Requirement { | ||
len(text) >= 10, warning "this is a bit short", text | ||
} |
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,13 @@ | ||
#include "foo.h" | ||
|
||
int implication(int x, int y) | ||
{ | ||
// lobster-trace: softreq_example.req_implication | ||
return (x == 0) || (y != 0); | ||
} | ||
|
||
int exclusive_or(int x, int y) | ||
{ | ||
// lobster-trace: softreq_example.req_xor | ||
return (x == 0) != (y == 0); | ||
} |
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,7 @@ | ||
#ifndef __FOO_H__ | ||
#define __FOO_H__ | ||
|
||
int implication(int x, int y); | ||
int exclusive_or(int x, int y); | ||
|
||
#endif |
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,8 @@ | ||
example.System_Requirement { | ||
description = text | ||
} | ||
|
||
example.Software_Requirement { | ||
description = text | ||
tags "req" = trace_trlc | ||
} |
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,21 @@ | ||
requirements "System Requirements" { | ||
source: "requirements.lobster" with kind "System_Requirement"; | ||
} | ||
|
||
requirements "Software Requirements" | ||
{ | ||
source: "requirements.lobster" with kind "Software_Requirement"; | ||
trace to: "System Requirements"; | ||
} | ||
|
||
implementation "Code" | ||
{ | ||
source: "cppcode.lobster"; | ||
trace to: "Software Requirements"; | ||
} | ||
|
||
activity "Verification Test" | ||
{ | ||
source: "json.lobster"; | ||
trace to: "Software Requirements"; | ||
} |
Oops, something went wrong.