Skip to content

Commit

Permalink
Add parser test with valid sample messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrojo committed Oct 20, 2024
1 parent a5161ff commit f00df93
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
/config/

# Recordflux
/generated/
/generated/
/.rflx_cache/
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"makefile.configureOnOpen": true,
"ada.projectFile": "coap_spark.gpr"
"ada.projectFile": "coap_spark.gpr",
"sarif-viewer.connectToGithubCodeScanning": "off"
}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RFLX_HOME := tools/RecordFlux/.venv/bin
RFLX := $(RFLX_HOME)/rflx
RFLX_HOME := tools/RecordFlux/
RFLX := $(RFLX_HOME)/.venv/bin/rflx
SPECS = $(wildcard specs/*.rflx)
GNATPROVE := gnatprove

Expand All @@ -22,6 +22,11 @@ generate: $(GENERATED)
$(GENERATED): $(SPECS)
@mkdir -p $(dir $@)
@$(RFLX) generate -d $(dir $@) $<
@$(RFLX) graph -d $(dir $@) $<

test:
$(MAKE) -C tests test
.PHONY: test

clean:
rm -r $(dir $(GENERATED))
Expand Down
2 changes: 1 addition & 1 deletion coap_spark.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project Coap_Spark is
for Library_Name use "Coap_Spark";
for Library_Version use Project'Library_Name & ".so." & Coap_Spark_Config.Crate_Version;

for Source_Dirs use ("src/", "config/");
for Source_Dirs use ("src/", "config/", "generated/", "generated/specs/");
for Object_Dir use "obj/" & Coap_Spark_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Library_Dir use "lib";
Expand Down
2 changes: 2 additions & 0 deletions src/coap_spark.ads
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
with RFLX.CoAP;

package Coap_Spark is

end Coap_Spark;
7 changes: 7 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RFLX_HOME := ../tools/RecordFlux/
RFLX := $(RFLX_HOME)/.venv/bin/rflx

test:
$(RFLX_HOME)/tools/extract_packets.py --payload inet.UDP samples/coap-cbor.pcap samples/
rflx validate -v samples/ ../specs/coap.rflx CoAP::CoAP_Message
.PHONY: test
1 change: 1 addition & 0 deletions tests/samples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.raw
Binary file added tests/samples/coap-cbor.pcap
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/RecordFlux

0 comments on commit f00df93

Please sign in to comment.