diff --git a/tests/validation/BasicAcetzTest/BasicAcetzTest.ino b/tests/validation/BasicAcetzTest/BasicAcetzTest.ino deleted file mode 100644 index 39e432c20..000000000 --- a/tests/validation/BasicAcetzTest/BasicAcetzTest.ino +++ /dev/null @@ -1,32 +0,0 @@ -#line 2 "BasicAcetzTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Adak"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicAcetzTest/Makefile b/tests/validation/BasicAcetzTest/Makefile deleted file mode 100644 index a07420437..000000000 --- a/tests/validation/BasicAcetzTest/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbacetz -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicAcetzTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Define the scope of the test data. -SCOPE := basic -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -# --blacklist $(TOOLS)/compare_acetz/blacklist.json -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_acetz/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicAcetzTest/README.md b/tests/validation/BasicAcetzTest/README.md deleted file mode 100644 index e999b545c..000000000 --- a/tests/validation/BasicAcetzTest/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# BasicAcetzTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class with the `validation_data.cpp` file generated by the -[compare_acetz](https://github.com/bxparks/AceTimeTools/tree/develop/compare_acetz) -program which uses the -[acetz](https://github.com/bxparks/AceTimeTools/blob/develop/acetz.py) class. - -## Running the Test - -The Python tool generates too many data points spanning the year 2000 to 2050. -This test is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 266 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_WET passed. -TestRunner duration: 1.614 seconds. -TestRunner summary: 266 passed, 0 failed, 0 skipped, 0 timed out, out of 266 test(s). - -$ make clean -``` diff --git a/tests/validation/BasicDateUtilTest/BasicDateUtilTest.ino b/tests/validation/BasicDateUtilTest/BasicDateUtilTest.ino deleted file mode 100644 index a0ec99bf0..000000000 --- a/tests/validation/BasicDateUtilTest/BasicDateUtilTest.ino +++ /dev/null @@ -1,32 +0,0 @@ -#line 2 "BasicDateUtilTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Adak"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicDateUtilTest/Makefile b/tests/validation/BasicDateUtilTest/Makefile deleted file mode 100644 index 10a58fb94..000000000 --- a/tests/validation/BasicDateUtilTest/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbdateutil -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicDateUtilTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -# -# dateutil (2.8.1) intially ships with 2019c, but when the 'tzdata' on -# Ubuntu 20.04 is updated to 2020a, it uses the new version instead of the -# internal version. I wish there was a way to peg the tzdata version -# used by dateutil to make unit testing more predictable. -# -# dateutil works until 2037, then fails the DST offsets in 2037 for the -# following zones: -# Australia_Adelaide failed. -# Australia_Broken_Hill failed. -# Australia_Currie failed. -# Australia_Hobart failed. -# Australia_Melbourne failed. -# Australia_Sydney failed. -# Europe_Dublin failed. -# Pacific_Auckland failed. -SCOPE := basic -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2037 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_dateutil/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_dateutil/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicDateUtilTest/README.md b/tests/validation/BasicDateUtilTest/README.md deleted file mode 100644 index aef36cc47..000000000 --- a/tests/validation/BasicDateUtilTest/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# BasicDateUtilTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class with the `validation_data.cpp` file generated by the -[compare_dateutil](https://github.com/bxparks/AceTimeTools/tree/develop/compare_dateutil) -program which uses the [dateutil](https://pypi.org/project/python-dateutil/) -library. - -## Running the Test - -The Python tool generates about 130,000 data points spanning the year 2000 to -2038. It is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 270 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_WET passed. -TestRunner duration: 0.070 seconds. -TestRunner summary: 270 passed, 0 failed, 0 skipped, 0 timed out, out of 270 -test(s). - -$ make clean -``` diff --git a/tests/validation/BasicHinnantDateTest/BasicHinnantDateTest.ino b/tests/validation/BasicHinnantDateTest/BasicHinnantDateTest.ino deleted file mode 100644 index 859bf7084..000000000 --- a/tests/validation/BasicHinnantDateTest/BasicHinnantDateTest.ino +++ /dev/null @@ -1,27 +0,0 @@ -#line 2 "BasicHinnantDateTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicHinnantDateTest/Makefile b/tests/validation/BasicHinnantDateTest/Makefile deleted file mode 100644 index 8ad44f35d..000000000 --- a/tests/validation/BasicHinnantDateTest/Makefile +++ /dev/null @@ -1,97 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbhd -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicHinnantDateTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -SCOPE := basic -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ -$(TOOLS)/compare_cpp/generate_data.out - $(TOOLS)/compare_cpp/generate_data.out \ - --tz_version $(TZ_VERSION) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(TOOLS)/compare_cpp/generate_data.out: - $(MAKE) -C $(TOOLS)/compare_cpp/ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicHinnantDateTest/README.md b/tests/validation/BasicHinnantDateTest/README.md deleted file mode 100644 index 337bcd333..000000000 --- a/tests/validation/BasicHinnantDateTest/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# BasicHinnantDateTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class (which uses the `zonedb` data files) with the -`validation_data.cpp` file generated by the -[compare_cpp](https://github.com/bxparks/AceTimeTools/tree/develop/compare_cpp) -program which uses the [Hinnant Date](https://github.com/HowardHinnant/date) -library. - -## Running the Test - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make -j 4 - -$ make runtests -TestRunner started on 268 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_WET passed. -TestRunner duration: 0.070 seconds. -TestRunner summary: 268 passed, 0 failed, 0 skipped, 0 timed out, out of 268 test(s). - -$ make clean -``` - -## Compiling the HinnantDate Test Data Generator - -The `Makefile` attempts to compile the -[compare_cpp](https://github.com/bxparks/AceTimeTools/tree/develop/compare_cpp) -program if necessary. To recompile it manually, type the following: - -``` -$ cd .../AceTimeTools/compare_cpp -$ make clean -$ make -``` diff --git a/tests/validation/BasicJavaTest/BasicJavaTest.ino b/tests/validation/BasicJavaTest/BasicJavaTest.ino deleted file mode 100644 index 53dede379..000000000 --- a/tests/validation/BasicJavaTest/BasicJavaTest.ino +++ /dev/null @@ -1,33 +0,0 @@ -#line 2 "BasicJavaTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - //TestRunner::include("TransitionTest", "America_Los_Angeles"); - TestRunner::include("TransitionTest", "America_Moncton"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicJavaTest/Makefile b/tests/validation/BasicJavaTest/Makefile deleted file mode 100644 index 5efe9ef36..000000000 --- a/tests/validation/BasicJavaTest/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbjava -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicJavaTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -# * openjdk 11.0.6 2020-01-14 uses 2019c -# * openjdk 11.0.8 2020-07-14 uses 2020a -# * openjdk 11.0.10 2020-07-14 uses 2020d -SCOPE := basic -TZ_VERSION := 2020d -START_YEAR := 2000 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_java/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ -$(TOOLS)/compare_java/GenerateData.class - java -cp $(TOOLS)/compare_java GenerateData \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(TOOLS)/compare_java/GenerateData.class: - $(MAKE) -C $(TOOLS)/compare_java - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicJavaTest/README.md b/tests/validation/BasicJavaTest/README.md deleted file mode 100644 index 0817f4584..000000000 --- a/tests/validation/BasicJavaTest/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# BasicJavaTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class (which uses the `zonedb` data files) with the -`validation_data.cpp` file generated by the -[compare_java](https://github.com/bxparks/AceTimeTools/tree/develop/compare_java) -Java program. - -## Running the Test - -The Java tool generates about 199,000 data points spanning the year 2000 to -2050. It is too large to run on any Arduino board that I am aware of, including -the ESP32. However it does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make -j 4 - -$ make runtests -TestRunner started on 268 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_Pacific_Wallis passed. -TestRunner duration: 0.070 seconds. -TestRunner summary: 268 passed, 0 failed, 0 skipped, 0 timed out, out of 268 test(s). - -$ make clean -``` - -## Java JDK Version - -The TZ Database version used by the `GenerateData.java` program and the -version that generated the `zonedbx` files must match for this unit test to -succeed. For example, one of JDK versions used to run this test was `openjdk -version "11.0.3" 2019-04-16` (see `java -version`) which seems to use version -2018g. So the `Makefile generates the zoneinfo files for `2018g` specifically -for this test. - -## Compiling the Java Generator - -The `Makefile` will automatically compile the -`AceTimeTools/compare_java/GenerateData.java` program into a -`GenerateData.class` if it has not already been generated. To compile manually, - -``` -$ cd .../AceTimeTools/compare_java -$ make -``` diff --git a/tests/validation/BasicNodaTest/BasicNodaTest.ino b/tests/validation/BasicNodaTest/BasicNodaTest.ino deleted file mode 100644 index f07cafa32..000000000 --- a/tests/validation/BasicNodaTest/BasicNodaTest.ino +++ /dev/null @@ -1,31 +0,0 @@ -#line 2 "BasicNodaTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include - -using aunit::TestRunner; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - //TestRunner::include("TransitionTest", "America_Los_Angeles"); - TestRunner::include("TransitionTest", "America_Moncton"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicNodaTest/Makefile b/tests/validation/BasicNodaTest/Makefile deleted file mode 100644 index 4b197d9a6..000000000 --- a/tests/validation/BasicNodaTest/Makefile +++ /dev/null @@ -1,107 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -# Define the scope of the test data. -SCOPE = basic -TZ_VERSION = 2021a -START_YEAR = 2000 -UNTIL_YEAR = 2050 - -DB_NAMESPACE := zonedbnoda -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt \ - tzdata$(TZ_VERSION).nzd -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicNodaTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Location of the https://github.com/nodatime/nodatime repo. -NODA_TIME_DIR := $(HOME)/dev/nodatime - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ - $(TOOLS)/compare_noda/Program.cs \ - tzdata$(TZ_VERSION).nzd - dotnet run -p $(TOOLS)/compare_noda/compare_noda.csproj \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - --nzd_file tzdata$(TZ_VERSION).nzd \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -# Generate the custom tzdata{xxx}.nzd file, depending on TZ_VERSION. -tzdata$(TZ_VERSION).nzd: - dotnet run \ - -p $(NODA_TIME_DIR)/src/NodaTime.TzdbCompiler/NodaTime.TzdbCompiler.csproj \ - -f net5.0 \ - -- \ - -s https://data.iana.org/time-zones/releases/tzdata$(TZ_VERSION).tar.gz \ - -w $(NODA_TIME_DIR)/data/cldr/windowsZones-38-1.xml \ - -o $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicNodaTest/README.md b/tests/validation/BasicNodaTest/README.md deleted file mode 100644 index 06cce5f28..000000000 --- a/tests/validation/BasicNodaTest/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# BasicNodaTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class (which uses the `zonedb` data files) with the -`validation_data.cpp` file generated by the -[compare_noda](https://github.com/bxparks/AceTimeTools/tree/develop/compare_noda) -C# program using [Noda Time](https://nodatime.org/). - -## Requirements - -* Install both .NET 5.0 and .NET 3.1 - * https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu - * .NET 3.1 is required because the `TzdbCompiler` does not run using .NET - 5.0. - * (It might be possible to install just .NET 5.0. I have not verified this.) -* Clone the Noda Time repo as sibling to `AceTime` - * `$ git clone https://github.com/nodatime/nodatime` - * Update the `NODA_TIME_DIR` parameter in the `Makefile` -* Clone the EpoxyDuino repo as a sibling to `AceTime` - * `$ git clone https://github.com/bxparks/EpoxyDuino.git` - -## Running the Test - -The `compare_noda` tool generates about 199,000 data points spanning the year -2000 to 2050. It is too large to run on any Arduino board that I am aware of, -including the ESP32. However it does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make - -$ make runtests -TestRunner started on 266 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_Pacific_Wallis passed. -Test BasicTransitionTest_WET passed. -TestRunner duration: 1.200 seconds. -TestRunner summary: 266 passed, 0 failed, 0 skipped, 0 timed out, out of 268 test(s). - -$ make clean -``` - -## Noda Time Version - -The Noda Time library allows the NodaZoneData file to be generated dynamically -from the original IANA TZDB files (https://nodatime.org/3.0.x/userguide/tzdb). -The `$(TZ_VERSION)` in the `Makefile` specifies the TZDB version. The custom TZ -configuration happens in 2 steps: - -* `tzdata$(TZ_VERSION).nzd`: - * The NodaZoneData file is created by runing the `TzdbCompiler` from the - Noda Time source repo. - * The `TzdbCompiler` automatically downloads the - `tar.gz` file from https://data.iana.org/time-zones/releases/. -* `validation_data.json`: - * The `compare_noda` program is given the `--nzd_file` flag which tells the - program to look for the NodaZoneData file at the given file path. diff --git a/tests/validation/BasicPythonTest/BasicPythonTest.ino b/tests/validation/BasicPythonTest/BasicPythonTest.ino deleted file mode 100644 index 463fa89e9..000000000 --- a/tests/validation/BasicPythonTest/BasicPythonTest.ino +++ /dev/null @@ -1,32 +0,0 @@ -#line 2 "BasicPythonTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Adak"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/BasicPythonTest/Makefile b/tests/validation/BasicPythonTest/Makefile deleted file mode 100644 index 7b7f1d873..000000000 --- a/tests/validation/BasicPythonTest/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbpytz -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := BasicPythonTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Define the scope of the test data. -# * pytz (2019.3) uses 2019c -# * pytz (2020.1) uses 2020a -SCOPE := basic -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2038 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_pytz/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_pytz/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/BasicPythonTest/README.md b/tests/validation/BasicPythonTest/README.md deleted file mode 100644 index 3bbb7fb58..000000000 --- a/tests/validation/BasicPythonTest/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# BasicPythonTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class with the `validation_data.cpp` file generated by the -[compare_pytz](https://github.com/bxparks/AceTimeTools/tree/develop/compare_pytz) -which uses the [pytz](https://pypi.org/project/pytz/) library. - -## Running the Test - -The Python tool generates about 130,000 data points spanning the year 2000 to -2038. It is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 270 test(s). -Test BasicTransitionTest_Africa_Abidjan passed. -... -Test BasicTransitionTest_WET passed. -TestRunner duration: 1.614 seconds. -TestRunner summary: 270 passed, 0 failed, 0 skipped, 0 timed out, out of 270 test(s). - -$ make clean -``` diff --git a/tests/validation/ExtendedAcetzTest/ExtendedAcetzTest.ino b/tests/validation/ExtendedAcetzTest/ExtendedAcetzTest.ino deleted file mode 100644 index 41ad0c0b3..000000000 --- a/tests/validation/ExtendedAcetzTest/ExtendedAcetzTest.ino +++ /dev/null @@ -1,32 +0,0 @@ -#line 2 "ExtendedAcetzTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Adak"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedAcetzTest/Makefile b/tests/validation/ExtendedAcetzTest/Makefile deleted file mode 100644 index 4f3afbeae..000000000 --- a/tests/validation/ExtendedAcetzTest/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbacetz -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedAcetzTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Define the scope of the test data. -SCOPE := extended -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -# --blacklist $(TOOLS)/compare_acetz/blacklist.json -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_acetz/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedAcetzTest/README.md b/tests/validation/ExtendedAcetzTest/README.md deleted file mode 100644 index 3c4ead72b..000000000 --- a/tests/validation/ExtendedAcetzTest/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# ExtendedAcetzTest - -This unit test compares the DST transitions calculated by the -`ExtendedZoneProcessor` class with the `validation_data.cpp` file generated by -the -[compare_acetz](https://github.com/bxparks/AceTimeTools/tree/develop/compare_acetz) -program which uses the -[acetz](https://github.com/bxparks/AceTimeTools/blob/develop/acetz.py) class. - -## Running the Test - -The Python tool generates too many data points spanning the year 2000 to 2050. -This test is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 386 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_WET passed. -TestRunner duration: 2.317 seconds. -TestRunner summary: 386 passed, 0 failed, 0 skipped, 0 timed out, out of 386 test(s). - -$ make clean -``` diff --git a/tests/validation/ExtendedDateUtilTest/ExtendedDateUtilTest.ino b/tests/validation/ExtendedDateUtilTest/ExtendedDateUtilTest.ino deleted file mode 100644 index b89f6349a..000000000 --- a/tests/validation/ExtendedDateUtilTest/ExtendedDateUtilTest.ino +++ /dev/null @@ -1,32 +0,0 @@ -#line 2 "ExtendedDateUtilTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Adak"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedDateUtilTest/Makefile b/tests/validation/ExtendedDateUtilTest/Makefile deleted file mode 100644 index 9e8d44f80..000000000 --- a/tests/validation/ExtendedDateUtilTest/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbxdateutil -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedDateUtilTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -# -# dateutil (2.8.1) intially ships with 2019c, but when the 'tzdata' on -# Ubuntu 20.04 is updated to 2020a, it uses the new version instead of the -# internal version. I wish there was a way to peg the tzdata version -# used by dateutil to make unit testing more predictable. -# -# dateutil works until 2037, then fails the DST offsets in 2037 for the -# following zones: -# Australia_Adelaide failed. -# Australia_Broken_Hill failed. -# Australia_Currie failed. -# Australia_Hobart failed. -# Australia_Melbourne failed. -# Australia_Sydney failed. -# Europe_Dublin failed. -# Pacific_Auckland failed. -SCOPE := extended -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2037 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_dateutil/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_dateutil/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedDateUtilTest/README.md b/tests/validation/ExtendedDateUtilTest/README.md deleted file mode 100644 index 5779f0781..000000000 --- a/tests/validation/ExtendedDateUtilTest/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# ExtendedDateUtilTest - -This unit test compares the DST transitions calculated by the -`ExtendedZoneProcessor` class with the `validation_data.cpp` file generated by -the -[compare_dateutil](https://github.com/bxparks/AceTimeTools/tree/develop/compare_dateutil) -program which uses the [dateutil](https://pypi.org/project/python-dateutil/) -library. - -## Running the Test - -The Python tool generates about 130,000 data points spanning the year 2000 to -2038. It is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 270 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_WET passed. -TestRunner duration: 0.070 seconds. -TestRunner summary: 270 passed, 0 failed, 0 skipped, 0 timed out, out of 270 -test(s). - -$ make clean -``` diff --git a/tests/validation/ExtendedHinnantDateTest/ExtendedHinnantDateTest.ino b/tests/validation/ExtendedHinnantDateTest/ExtendedHinnantDateTest.ino deleted file mode 100644 index 0880d812e..000000000 --- a/tests/validation/ExtendedHinnantDateTest/ExtendedHinnantDateTest.ino +++ /dev/null @@ -1,27 +0,0 @@ -#line 2 "ExtendedHinnantDateTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedHinnantDateTest/Makefile b/tests/validation/ExtendedHinnantDateTest/Makefile deleted file mode 100644 index 63fc435f8..000000000 --- a/tests/validation/ExtendedHinnantDateTest/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbxhd -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedHinnantDateTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -# If START_YEAR < ~1974, then tzcompiler.py must be given the -# --ignore_buf_size_too_large flag to prevent an exception. -SCOPE := extended -TZ_VERSION := 2021a -START_YEAR := 1974 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ -$(TOOLS)/compare_cpp/generate_data.out - $(TOOLS)/compare_cpp/generate_data.out \ - --tz_version $(TZ_VERSION) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(TOOLS)/compare_cpp/generate_data.out: - $(MAKE) -C $(TOOLS)/compare_cpp/ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --ignore_buf_size_too_large \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedHinnantDateTest/README.md b/tests/validation/ExtendedHinnantDateTest/README.md deleted file mode 100644 index aed76be74..000000000 --- a/tests/validation/ExtendedHinnantDateTest/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# ExtendedHinnantDateTest - -This unit test compares the DST transitions calculated by the -`BasicZoneProcessor` class (which uses the `zonedb` data files) with the -`validation_data.cpp` file generated by the -[compare_cpp](https://github.com/bxparks/AceTimeTools/tree/develop/compare_cpp) -program which uses the -[Hinnant Date Library](https://github.com/HowardHinnant/date). - -## Running the Test - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make -j 4 - -$ make runtests -TestRunner started on 387 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_WET passed. -TestRunner duration: 2.561 seconds. -TestRunner summary: 268 passed, 0 failed, 0 skipped, 0 timed out, out of 268 test(s). - -$ make clean -``` - -## Compiling the HinnantDate Test Data Generator - -The `Makefile` attempts to compile the -[compare_cpp](https://github.com/bxparks/AceTimeTools/tree/develop/compare_cpp) -program if necessary. To recompile it manually, type the following: - -``` -$ cd .../AceTimeTools/compare_cpp -$ make clean -$ make -``` diff --git a/tests/validation/ExtendedJavaTest/ExtendedJavaTest.ino b/tests/validation/ExtendedJavaTest/ExtendedJavaTest.ino deleted file mode 100644 index fd81e3383..000000000 --- a/tests/validation/ExtendedJavaTest/ExtendedJavaTest.ino +++ /dev/null @@ -1,36 +0,0 @@ -#line 2 "ExtendedJavaTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that - * it will likely not compile on an Arduino environment. It can however be run - * on a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Gaza"); - TestRunner::include("TransitionTest", "Goose_Bay"); - TestRunner::include("TransitionTest", "Hebron"); - TestRunner::include("TransitionTest", "Moncton"); - TestRunner::include("TransitionTest", "St_Johns"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedJavaTest/Makefile b/tests/validation/ExtendedJavaTest/Makefile deleted file mode 100644 index 857db2b71..000000000 --- a/tests/validation/ExtendedJavaTest/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbxjava -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedJavaTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -#.PHONY: $(GENERATED) - -# Define the scope of the test data. -# * openjdk 11.0.6 2020-01-14 uses 2019c -# * openjdk 11.0.8 2020-07-14 uses 2020a -# * openjdk 11.0.10 2020-07-14 uses 2020d -SCOPE := extended -TZ_VERSION := 2020d -START_YEAR := 2000 -UNTIL_YEAR := 2050 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_java/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ -$(TOOLS)/compare_java/GenerateData.class - java -cp $(TOOLS)/compare_java GenerateData \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(TOOLS)/compare_java/GenerateData.class: - $(MAKE) -C $(TOOLS)/compare_java - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedJavaTest/README.md b/tests/validation/ExtendedJavaTest/README.md deleted file mode 100644 index 07e066852..000000000 --- a/tests/validation/ExtendedJavaTest/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# ExtendedJavaTest - -This unit test compares the DST transitions calculated by the -`ExtendedZoneProcessor` class (which uses the `zonedbx` data files) with the -`validation_data.cpp` file generated by the -[compare_java](https://github.com/bxparks/AceTimeTools/tree/develop/compare_java) -Java program. - -## Running the Test - -The Java program generates about 285,000 data points spanning the year 2000 to -2050. It is too large to run on any Arduino board that I am aware of, including -the ESP32. However it does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make -j 4 - -$ make runtests -TestRunner started on 384 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_Pacific_Wallis passed. -TestRunner duration: 0.113 seconds. -test(s). -TestRunner summary: 384 passed, 0 failed, 0 skipped, 0 timed out, out of 384 test(s). - -$ make clean -``` - -## Java JDK Version - -The TZ Database version used by the `GenerateData.java` program and the -version that generated the `zonedbx` files must match for this unit test to -succeed. For example, one of JDK versions used to run this test was `openjdk -version "11.0.3" 2019-04-16` (see `java -version`) which seems to use version -2018g. So the `Makefile generates the zoneinfo files for `2018g` specifically -for this test. - -## Compiling the Java Generator - -The `Makefile` will automatically compile the -`AceTimeTools/compare_java/GenerateData.java` program into a -`GenerateData.class` if it has not already been generated. To compile manually, - -``` -$ cd .../AceTimeTools/compare_java -$ make diff --git a/tests/validation/ExtendedNodaTest/ExtendedNodaTest.ino b/tests/validation/ExtendedNodaTest/ExtendedNodaTest.ino deleted file mode 100644 index 256225f8c..000000000 --- a/tests/validation/ExtendedNodaTest/ExtendedNodaTest.ino +++ /dev/null @@ -1,31 +0,0 @@ -#line 2 "ExtendedNodaTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that it - * will likely not compile on an Arduino environment. It can however be run on - * a Linux or MacOS environment using the provided Makefile. - */ - -#include - -using aunit::TestRunner; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - //TestRunner::include("TransitionTest", "America_Los_Angeles"); - TestRunner::include("TransitionTest", "America_Moncton"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedNodaTest/Makefile b/tests/validation/ExtendedNodaTest/Makefile deleted file mode 100644 index 86c3b7663..000000000 --- a/tests/validation/ExtendedNodaTest/Makefile +++ /dev/null @@ -1,108 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -# Define the scope of the test data. -SCOPE = extended -TZ_VERSION = 2021a -START_YEAR = 1974 -UNTIL_YEAR = 2050 - -DB_NAMESPACE := zonedbxnoda -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt \ - tzdata$(TZ_VERSION).nzd -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedNodaTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Location of the https://github.com/nodatime/nodatime repo. -NODA_TIME_DIR := $(HOME)/dev/nodatime - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt \ - $(TOOLS)/compare_noda/Program.cs \ - tzdata$(TZ_VERSION).nzd - dotnet run -p $(TOOLS)/compare_noda/compare_noda.csproj \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - --nzd_file tzdata$(TZ_VERSION).nzd \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -# Generate the custom tzdata{xxx}.nzd file, depending on TZ_VERSION. -tzdata$(TZ_VERSION).nzd: - dotnet run \ - -p $(NODA_TIME_DIR)/src/NodaTime.TzdbCompiler/NodaTime.TzdbCompiler.csproj \ - -f net5.0 \ - -- \ - -s https://data.iana.org/time-zones/releases/tzdata$(TZ_VERSION).tar.gz \ - -w $(NODA_TIME_DIR)/data/cldr/windowsZones-38-1.xml \ - -o $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedbx files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --ignore_buf_size_too_large \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedNodaTest/README.md b/tests/validation/ExtendedNodaTest/README.md deleted file mode 100644 index 39b47f2db..000000000 --- a/tests/validation/ExtendedNodaTest/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# ExtendedNodaTest - -This unit test compares the DST transitions calculated by the -`ExtendedZoneProcessor` class (which uses the `zonedbx` data files) with the -`validation_data.cpp` file generated by the -[compare_noda](https://github.com/bxparks/AceTimeTools/tree/develop/compare_noda) -C# program using [Noda Time](https://nodatime.org/). - -## Requirements - -* Install both .NET 5.0 and .NET 3.1 - * https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu - * .NET 3.1 is required because the `TzdbCompiler` does not run using .NET - 5.0. - * (It might be possible to install just .NET 5.0. I have not verified this.) -* Clone the Noda Time repo as sibiling to `AceTime` - * `$ git clone https://github.com/nodatime/nodatime` - * Update the `NODA_TIME_DIR` parameter in the `Makefile` -* Clone the EpoxyDuino repo as a sibling to `AceTime` - * `$ git clone https://github.com/bxparks/EpoxyDuino.git` - -## Running the Test - -The `compare_noda` tool generates about 433,000 data points spanning the year -1974 to 2050. It is too large to run on any Arduino board that I am aware of, -including the ESP32. However it does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. - -Assuming that you have `g++` and `make` installed, just type: -``` -$ make clean -$ make - -$ make runtests -TestRunner started on 268 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_Pacific_Wallis passed. -Test ExtendedTransitionTest_WET passed. -TestRunner duration: 2.189 seconds. -TestRunner summary: 386 passed, 0 failed, 0 skipped, 0 timed out, out of 386 test(s). - -$ make clean -``` - -## Noda Time Version - -The Noda Time library allows the NodaZoneData file to be generated dynamically -from the original IANA TZDB files (https://nodatime.org/3.0.x/userguide/tzdb). -The `$(TZ_VERSION)` in the `Makefile` specifies the TZDB version. The custom TZ -configuration happens in 2 steps: - -* `tzdata$(TZ_VERSION).nzd`: - * The NodaZoneData file is created by runing the `TzdbCompiler` from the - Noda Time source repo. - * The `TzdbCompiler` automatically downloads the - `tar.gz` file from https://data.iana.org/time-zones/releases/. -* `validation_data.json`: - * The `compare_noda` program is given the `--nzd_file` flag which tells the - program to look for the NodaZoneData file at the given file path. diff --git a/tests/validation/ExtendedPythonTest/ExtendedPythonTest.ino b/tests/validation/ExtendedPythonTest/ExtendedPythonTest.ino deleted file mode 100644 index a3ece3057..000000000 --- a/tests/validation/ExtendedPythonTest/ExtendedPythonTest.ino +++ /dev/null @@ -1,36 +0,0 @@ -#line 2 "ExtendedPythonTest.ino" - -/* - * This unit test depends on 'validation_data.cpp' which is so large that - * it will likely not compile on an Arduino environment. It can however be run - * on a Linux or MacOS environment using the provided Makefile. - */ - -#include -#include - -using namespace aunit; -using namespace ace_time; - -//--------------------------------------------------------------------------- - -void setup() { -#if ! defined(EPOXY_DUINO) - delay(1000); // wait to prevent garbage on SERIAL_PORT_MONITOR -#endif - SERIAL_PORT_MONITOR.begin(115200); - while (!SERIAL_PORT_MONITOR); // Leonardo/Micro - -#if 0 - TestRunner::exclude("*"); - TestRunner::include("TransitionTest", "Gaza"); - TestRunner::include("TransitionTest", "Goose_Bay"); - TestRunner::include("TransitionTest", "Hebron"); - TestRunner::include("TransitionTest", "Moncton"); - TestRunner::include("TransitionTest", "St_Johns"); -#endif -} - -void loop() { - TestRunner::run(); -} diff --git a/tests/validation/ExtendedPythonTest/Makefile b/tests/validation/ExtendedPythonTest/Makefile deleted file mode 100644 index c2e43843d..000000000 --- a/tests/validation/ExtendedPythonTest/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -# See https://github.com/bxparks/EpoxyDuino for documentation about this -# Makefile to compile and run Arduino programs natively on Linux or MacOS. - -DB_NAMESPACE := zonedbxpytz -GENERATED := validation_data.cpp \ - validation_data.h \ - validation_tests.cpp \ - validation_data.json \ - $(DB_NAMESPACE)/zone_infos.h \ - $(DB_NAMESPACE)/zone_infos.cpp \ - $(DB_NAMESPACE)/zone_policies.h \ - $(DB_NAMESPACE)/zone_policies.cpp \ - $(DB_NAMESPACE)/zone_registry.h \ - $(DB_NAMESPACE)/zone_registry.cpp \ - $(DB_NAMESPACE)/zones.txt -OBJS := validation_data.o \ - validation_tests.o \ - $(DB_NAMESPACE)/zone_infos.o \ - $(DB_NAMESPACE)/zone_policies.o \ - $(DB_NAMESPACE)/zone_registry.o -APP_NAME := ExtendedPythonTest -ARDUINO_LIBS := AUnit AceCommon AceTime -MORE_CLEAN := more_clean -include ../../../../EpoxyDuino/EpoxyDuino.mk - -# Define the scope of the test data. -# * pytz (2019.3) uses 2019c -# * pytz (2020.1) uses 2020a -SCOPE := extended -TZ_VERSION := 2021a -START_YEAR := 2000 -UNTIL_YEAR := 2038 - -# Location of AceTimeTools, assumed to be sibling to this project. -TOOLS := $(abspath ../../../../AceTimeTools) - -runtests: - ./$(APP_NAME).out - -validation_data.cpp: validation_data.h - -validation_tests.cpp: validation_data.h - -validation_data.h: validation_data.json - $(TOOLS)/generate_validation.py \ - --tz_version $(TZ_VERSION) \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --blacklist $(TOOLS)/compare_pytz/blacklist.json \ - < validation_data.json - -validation_data.json: $(DB_NAMESPACE)/zones.txt - $(TOOLS)/compare_pytz/generate_data.py \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) \ - < $(DB_NAMESPACE)/zones.txt \ - > $@ - -$(DB_NAMESPACE)/%.o: $(DB_NAMESPACE)/%.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ - -$(DB_NAMESPACE)/zone_infos.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_policies.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.h: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zone_registry.cpp: $(DB_NAMESPACE)/zone_infos.h - -$(DB_NAMESPACE)/zones.txt: $(DB_NAMESPACE)/zone_infos.h - -# Generate the zones.txt and zonedb files under the $(DB_NAMESPACE) directory. -$(DB_NAMESPACE)/zone_infos.h: tzfiles/$(TZ_VERSION) - mkdir -p $(DB_NAMESPACE); \ - cd $(DB_NAMESPACE); \ - $(TOOLS)/tzcompiler.py \ - --input_dir ../tzfiles/$(TZ_VERSION) \ - --tz_version $(TZ_VERSION) \ - --language arduino,zonelist \ - --scope $(SCOPE) \ - --db_namespace $(DB_NAMESPACE) \ - --start_year $(START_YEAR) \ - --until_year $(UNTIL_YEAR) - -# Extract and copy the tzfiles into a local directory to allow parallel -# execution of validation/*Test makefiles. -tzfiles/$(TZ_VERSION): - $(TOOLS)/copytz.sh --output_dir tzfiles $(TZ_VERSION) - -more_clean: - rm -rf $(DB_NAMESPACE) tzfiles diff --git a/tests/validation/ExtendedPythonTest/README.md b/tests/validation/ExtendedPythonTest/README.md deleted file mode 100644 index 42fb7a59b..000000000 --- a/tests/validation/ExtendedPythonTest/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# ExtendedPythonTest - -This unit test compares the DST transitions calculated by the -`ExtendedZoneProcessor` class with the `validation_data.cpp` file generated by -[compare_pytz](https://github.com/bxparks/AceTimeTools/tree/develop/compare_pytz) -which uses the [pytz](https://pypi.org/project/pytz/) library. - -## Running the Test - -The Python tool generates about 200,000 data points spanning the year 2000 to -2038. It is too large to run on any Arduino board that I am aware of, including -the ESP32. - -The unit test does run on a Linux machine using the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) adapter layer. -Assuming that you have `g++` and `make` installed, just type: - -``` -$ make - -$ make runtests -TestRunner started on 348 test(s). -Test ExtendedTransitionTest_Africa_Abidjan passed. -... -Test ExtendedTransitionTest_Pacific_Wallis passed. -TestRunner duration: 0.113 seconds. -TestRunner summary: 348 passed, 0 failed, 0 skipped, 0 timed out, out of 348 -test(s). - -$ make clean -``` diff --git a/tests/validation/Makefile b/tests/validation/Makefile deleted file mode 100644 index 0f43b6c0a..000000000 --- a/tests/validation/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -SHELL=bash - -# There are 2 sets of validation test targets in this Makefile. -# -# 1) The minimal validation tests: BasicHinnantDateTest and -# ExtendedHinnantDateTest. These are the only 2 validation tests which can be -# configured to validate against a specific TZ version. These are used in the -# GitHub CI workflow. -# -# $ make validations -# $ make runvalidations -# -# 2) The full validation tests (6 x Basic*Test and 6 Extended*Test). Some of -# these will be broken when a new TZ DB is released because the dependent -# library has not released a new version of the library yet. -# -# $ make tests (or make tests-serial) -# $ make runtests -# -# Sometimes `make tests` fails because it tries to build the targets in -# parallel. In that case, we can use `make tests-serial`. - -# Build just BasicHinnantDateTest and ExtendedHinnantDateTest tests in series. -validations: - (set -e; \ - trap 'kill 0' SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM; \ - for i in *HinnantDateTest/Makefile; do \ - echo '==== Making:' $$(dirname $$i); \ - $(MAKE) -C $$(dirname $$i); \ - done; \ - wait) - -# Run the BasicHinnantDateTest and ExtendedHinnantDateTest validation tests. -# These are used in the GitHub CI workflow. -runvalidations: - set -e; \ - for i in *HinnantDateTest/Makefile; do \ - echo '==== Running:' $$(dirname $$i); \ - $$(dirname $$i)/$$(dirname $$i).out; \ - done - -# Build *all* validation tests in parallel for reduced waiting time. -tests: - (set -e; \ - trap 'kill 0' SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM; \ - for i in */Makefile; do \ - echo '==== Making:' $$(dirname $$i); \ - $(MAKE) -C $$(dirname $$i) & \ - done; \ - wait) - -# Same as 'make tests' but in series not in parallel. I thought the serial -# version would be useful for GitHub Actions, but even there it seems like the -# workflow runners are allocated least 2 CPUs, and using the parallel version -# above reduces the execution time from 11 min (serial) to 6 min (parallel). -# Sometimes the serial version is needed when `make tests` failes due a race -# condition. -tests-serial: - set -e; \ - for i in */Makefile; do \ - echo '==== Making:' $$(dirname $$i); \ - $(MAKE) -C $$(dirname $$i) ; \ - done; - -# Run *all* validation tests. -runtests: - set -e; \ - for i in */Makefile; do \ - echo '==== Running:' $$(dirname $$i); \ - $$(dirname $$i)/$$(dirname $$i).out; \ - done - -# Clean all validation tests. -clean: - set -e; \ - for i in */Makefile; do \ - echo '==== Cleaning:' $$(dirname $$i); \ - $(MAKE) -C $$(dirname $$i) clean; \ - done diff --git a/tests/validation/README.md b/tests/validation/README.md deleted file mode 100644 index e0ae8168e..000000000 --- a/tests/validation/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Validation Tests - -These tests compare the algorithm implemented by `ZonedDateTime` and -`ZoneProcessor` classes with the equivalent functionality from 5 -other libraries: - -* [Python pytz](https://pypi.org/project/pytz/) library -* [Python dateutil](https://pypi.org/project/python-dateutil/) library -* [Java 11 Time](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/package-summary.html) library. -* [Hinnant date](https://github.com/HowardHinnant/date) C++ library -* [Noda Time](https://nodatime.org) C# library - -These unit tests require a desktop-class machine running Linux or MacOS. They -are too big to run on any Arduino microcontroller that I know of. They use the -[EpoxyDuino](https://github.com/bxparks/EpoxyDuino) emulation layer to run -these programs on the desktop machine. They also use various files (e.g. -`validation_data.h`, `validation_data.cpp`, `validation_tests.cpp`) which are -*generated* dynamically by the various `Makefile` files. (These files used to be -manually generated, then checked into source control. But after it was clear -that no Arduino microcontroller would be able to run these tests, it did not -seem worth checking in the generated code.) - -## Compiling and Running - -### Prerequisites - -The required Python, Java and C++ tools and libraries are explained in: - -* [compare_pytz](https://github.com/bxparks/AceTimeTools/tree/develop/compare_pytz) -* [compare_dateutil](https://github.com/bxparks/AceTimeTools/tree/develop/compare_dateutil) -* [compare_java](https://github.com/bxparks/AceTimeTools/tree/develop/compare_java) -* [compare_cpp](https://github.com/bxparks/AceTimeTools/tree/develop/compare_cpp) -* [compare_noda](https://github.com/bxparks/AceTimeTools/tree/develop/compare_noda) - -The various `Makefile` files under the subdirectories here will run `make -C` in -those directories to build the Java and C++ binaries as necessary. Here is a -(potentially out of date) summary of the 3rd party prerequisites: - -1. Install EpoxyDuino as a sibling project to `AceTime`: - * `$ git clone https://github.com/bxparks/EpoxyDuino` -1. Clone the IANA TZ database as a sibling project to `AceTime`: - * `$ git clone https://github.com/eggert/tz` -1. Install the Python `pytz` and `dateutil` libraries: - * `$ pip3 install --user pytz python-dateutil` -1. Install the Java 11 JDK: - * `$ sudo apt install openjdk-11-jdk` (Ubuntu 18.04 or 20.04) -1. Clone the Hinnant date library as a sibling to the `AceTime` directory, and - install the `libcurl4` library that it requires to download the tzfiles: - * `$ git clone https://github.com/HowardHinnant/date` - * `$ sudo apt install libcurl4-openssl-dev` -1. Install Microsoft .NET 5.0 on Linux: - * See https://docs.microsoft.com/en-us/dotnet/core/install/linux - * The `compare_noda.csproj` file already contains the NuGet dependency - to Noda Time and will be automatically retrieved by the `dotnet build` - command. - -### Running the Tests - -You can run the tests in this directory by running the following commands: - -``` -$ make clean -$ make tests -$ make runtests -```