From e67a39ce7cb98ca7c6a2d8e158a5eea7d6123cae Mon Sep 17 00:00:00 2001 From: James Foster Date: Wed, 25 Nov 2020 11:53:38 -0800 Subject: [PATCH 1/5] Fix library parse error if there is an extra blank line in `library_properties.rb` --- SampleProjects/TestSomething/library.properties | 3 ++- lib/arduino_ci/library_properties.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SampleProjects/TestSomething/library.properties b/SampleProjects/TestSomething/library.properties index 1007bf5f..669c1d55 100644 --- a/SampleProjects/TestSomething/library.properties +++ b/SampleProjects/TestSomething/library.properties @@ -3,8 +3,9 @@ version=0.1.0 author=Ian Katz maintainer=Ian Katz sentence=Arduino CI unit test example -paragraph=A skeleton library demonstrating CI and unit tests +paragraph=A skeleton library demonstrating CI and unit tests. NOTE THAT THE EXTRA BLANK LINE AT THE END OF THIS FILE IS INTENTIONAL TO TEST A PARSE ERROR! category=Other url=https://github.com/Arduino-CI/arduino_ci/SampleProjects/TestSomething architectures=avr,esp8266 includes=test-something.h + diff --git a/lib/arduino_ci/library_properties.rb b/lib/arduino_ci/library_properties.rb index 1a080713..8b5220f2 100644 --- a/lib/arduino_ci/library_properties.rb +++ b/lib/arduino_ci/library_properties.rb @@ -12,7 +12,7 @@ class LibraryProperties def initialize(path) @fields = {} File.foreach(path) do |line| - parts = line.split("=", 2) + parts = line.gsub(/\s+/, "").split("=", 2) # check for empty on next line fails if there is a newline @fields[parts[0]] = parts[1].chomp unless parts.empty? end end From 0552ab34aa3ab2973fe2b8a4cd6e962a0a2d6fd2 Mon Sep 17 00:00:00 2001 From: James Foster Date: Wed, 25 Nov 2020 11:55:49 -0800 Subject: [PATCH 2/5] Update `CHANGELOG.md` --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index acf3d0eb..b5a2f11e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed ### Fixed +- Parse error in `library_properties.rb` ### Security From 9809d67115423ab09452fe52d00cb993022b8f16 Mon Sep 17 00:00:00 2001 From: James Foster Date: Wed, 25 Nov 2020 11:58:51 -0800 Subject: [PATCH 3/5] Strip leading/trailing whitespace, not _all_ whitespace! --- lib/arduino_ci/library_properties.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arduino_ci/library_properties.rb b/lib/arduino_ci/library_properties.rb index 8b5220f2..04cc697d 100644 --- a/lib/arduino_ci/library_properties.rb +++ b/lib/arduino_ci/library_properties.rb @@ -12,7 +12,7 @@ class LibraryProperties def initialize(path) @fields = {} File.foreach(path) do |line| - parts = line.gsub(/\s+/, "").split("=", 2) # check for empty on next line fails if there is a newline + parts = line.strip.split("=", 2) # check for empty on next line fails if there is a newline @fields[parts[0]] = parts[1].chomp unless parts.empty? end end From 4d716eab3f417ed6b967df5765b796947d137415 Mon Sep 17 00:00:00 2001 From: James Foster Date: Wed, 25 Nov 2020 12:03:08 -0800 Subject: [PATCH 4/5] Add references to PR in code. --- SampleProjects/TestSomething/library.properties | 2 +- lib/arduino_ci/library_properties.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SampleProjects/TestSomething/library.properties b/SampleProjects/TestSomething/library.properties index 669c1d55..dba573f5 100644 --- a/SampleProjects/TestSomething/library.properties +++ b/SampleProjects/TestSomething/library.properties @@ -3,7 +3,7 @@ version=0.1.0 author=Ian Katz maintainer=Ian Katz sentence=Arduino CI unit test example -paragraph=A skeleton library demonstrating CI and unit tests. NOTE THAT THE EXTRA BLANK LINE AT THE END OF THIS FILE IS INTENTIONAL TO TEST A PARSE ERROR! +paragraph=A skeleton library demonstrating CI and unit tests. NOTE THAT THE EXTRA BLANK LINE AT THE END OF THIS FILE IS INTENTIONAL TO TEST A PARSE ERROR (#224)! category=Other url=https://github.com/Arduino-CI/arduino_ci/SampleProjects/TestSomething architectures=avr,esp8266 diff --git a/lib/arduino_ci/library_properties.rb b/lib/arduino_ci/library_properties.rb index 04cc697d..cc3be974 100644 --- a/lib/arduino_ci/library_properties.rb +++ b/lib/arduino_ci/library_properties.rb @@ -12,7 +12,7 @@ class LibraryProperties def initialize(path) @fields = {} File.foreach(path) do |line| - parts = line.strip.split("=", 2) # check for empty on next line fails if there is a newline + parts = line.strip.split("=", 2) # check for empty on next line fails if there is a newline (#224) @fields[parts[0]] = parts[1].chomp unless parts.empty? end end From e7707930a2fa910c70f66f6fed1c52f17b108384 Mon Sep 17 00:00:00 2001 From: James Foster Date: Thu, 26 Nov 2020 08:34:07 -0800 Subject: [PATCH 5/5] Include `IPAddress.h` before referencing object from that file. --- CHANGELOG.md | 1 + SampleProjects/NetworkLib/test/client.cpp | 7 +++++++ cpp/arduino/Client.h | 1 + 3 files changed, 9 insertions(+) create mode 100644 SampleProjects/NetworkLib/test/client.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a2f11e..45f50f72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Parse error in `library_properties.rb` +- Missing include of `IPAddress.h` in `Client.h` ### Security diff --git a/SampleProjects/NetworkLib/test/client.cpp b/SampleProjects/NetworkLib/test/client.cpp new file mode 100644 index 00000000..8e740c34 --- /dev/null +++ b/SampleProjects/NetworkLib/test/client.cpp @@ -0,0 +1,7 @@ +#include +// test for including without +#include + +unittest(test) { assertTrue(true); } + +unittest_main() diff --git a/cpp/arduino/Client.h b/cpp/arduino/Client.h index b08e183e..154e618d 100644 --- a/cpp/arduino/Client.h +++ b/cpp/arduino/Client.h @@ -1,6 +1,7 @@ #pragma once #include +#include class Client : public Stream { public: