arduino_ci 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -19
- data/REFERENCE.md +625 -0
- data/cpp/arduino/Arduino.h +1 -2
- data/cpp/arduino/AvrMath.h +117 -17
- data/cpp/arduino/Client.h +26 -0
- data/cpp/arduino/EEPROM.h +64 -0
- data/cpp/arduino/Godmode.cpp +7 -0
- data/cpp/arduino/Godmode.h +58 -9
- data/cpp/arduino/HardwareSerial.h +4 -4
- data/cpp/arduino/IPAddress.h +59 -0
- data/cpp/arduino/Print.h +9 -12
- data/cpp/arduino/Printable.h +8 -0
- data/cpp/arduino/SPI.h +11 -3
- data/cpp/arduino/Server.h +5 -0
- data/cpp/arduino/Udp.h +27 -0
- data/cpp/arduino/Wire.h +173 -77
- data/cpp/arduino/avr/io.h +10 -1
- data/cpp/arduino/avr/pgmspace.h +76 -46
- data/cpp/unittest/OstreamHelpers.h +4 -0
- data/exe/arduino_ci.rb +401 -0
- data/exe/arduino_ci_remote.rb +2 -393
- data/lib/arduino_ci.rb +1 -0
- data/lib/arduino_ci/arduino_downloader.rb +5 -4
- data/lib/arduino_ci/arduino_installation.rb +5 -5
- data/lib/arduino_ci/cpp_library.rb +124 -24
- data/lib/arduino_ci/installed_cpp_library.rb +0 -0
- data/lib/arduino_ci/library_properties.rb +86 -0
- data/lib/arduino_ci/version.rb +1 -1
- data/misc/default.yml +50 -3
- metadata +15 -7
- data/cpp/arduino/Arduino.h.orig +0 -143
- data/exe/libasan.rb +0 -29
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: arduino_ci
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.4.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ian Katz
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2020-11-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: os
         | 
| @@ -110,31 +110,37 @@ dependencies: | |
| 110 110 | 
             
                    version: 0.9.11
         | 
| 111 111 | 
             
            description: ''
         | 
| 112 112 | 
             
            email:
         | 
| 113 | 
            -
            -  | 
| 113 | 
            +
            - arduino.continuous.integration@gmail.com
         | 
| 114 114 | 
             
            executables:
         | 
| 115 | 
            +
            - arduino_ci.rb
         | 
| 115 116 | 
             
            - arduino_ci_remote.rb
         | 
| 116 117 | 
             
            - arduino_library_location.rb
         | 
| 117 118 | 
             
            - ensure_arduino_installation.rb
         | 
| 118 | 
            -
            - libasan.rb
         | 
| 119 119 | 
             
            extensions: []
         | 
| 120 120 | 
             
            extra_rdoc_files: []
         | 
| 121 121 | 
             
            files:
         | 
| 122 122 | 
             
            - ".yardopts"
         | 
| 123 123 | 
             
            - README.md
         | 
| 124 | 
            +
            - REFERENCE.md
         | 
| 124 125 | 
             
            - cpp/arduino/Arduino.cpp
         | 
| 125 126 | 
             
            - cpp/arduino/Arduino.h
         | 
| 126 | 
            -
            - cpp/arduino/Arduino.h.orig
         | 
| 127 127 | 
             
            - cpp/arduino/ArduinoDefines.h
         | 
| 128 128 | 
             
            - cpp/arduino/AvrMath.h
         | 
| 129 | 
            +
            - cpp/arduino/Client.h
         | 
| 130 | 
            +
            - cpp/arduino/EEPROM.h
         | 
| 129 131 | 
             
            - cpp/arduino/Godmode.cpp
         | 
| 130 132 | 
             
            - cpp/arduino/Godmode.h
         | 
| 131 133 | 
             
            - cpp/arduino/HardwareSerial.h
         | 
| 134 | 
            +
            - cpp/arduino/IPAddress.h
         | 
| 132 135 | 
             
            - cpp/arduino/MockEventQueue.h
         | 
| 133 136 | 
             
            - cpp/arduino/PinHistory.h
         | 
| 134 137 | 
             
            - cpp/arduino/Print.h
         | 
| 138 | 
            +
            - cpp/arduino/Printable.h
         | 
| 135 139 | 
             
            - cpp/arduino/SPI.h
         | 
| 140 | 
            +
            - cpp/arduino/Server.h
         | 
| 136 141 | 
             
            - cpp/arduino/SoftwareSerial.h
         | 
| 137 142 | 
             
            - cpp/arduino/Stream.h
         | 
| 143 | 
            +
            - cpp/arduino/Udp.h
         | 
| 138 144 | 
             
            - cpp/arduino/WCharacter.h
         | 
| 139 145 | 
             
            - cpp/arduino/WString.h
         | 
| 140 146 | 
             
            - cpp/arduino/Wire.h
         | 
| @@ -426,10 +432,10 @@ files: | |
| 426 432 | 
             
            - cpp/unittest/Assertion.h
         | 
| 427 433 | 
             
            - cpp/unittest/Compare.h
         | 
| 428 434 | 
             
            - cpp/unittest/OstreamHelpers.h
         | 
| 435 | 
            +
            - exe/arduino_ci.rb
         | 
| 429 436 | 
             
            - exe/arduino_ci_remote.rb
         | 
| 430 437 | 
             
            - exe/arduino_library_location.rb
         | 
| 431 438 | 
             
            - exe/ensure_arduino_installation.rb
         | 
| 432 | 
            -
            - exe/libasan.rb
         | 
| 433 439 | 
             
            - lib/arduino_ci.rb
         | 
| 434 440 | 
             
            - lib/arduino_ci/arduino_cmd.rb
         | 
| 435 441 | 
             
            - lib/arduino_ci/arduino_cmd_linux.rb
         | 
| @@ -444,9 +450,11 @@ files: | |
| 444 450 | 
             
            - lib/arduino_ci/ci_config.rb
         | 
| 445 451 | 
             
            - lib/arduino_ci/cpp_library.rb
         | 
| 446 452 | 
             
            - lib/arduino_ci/host.rb
         | 
| 453 | 
            +
            - lib/arduino_ci/installed_cpp_library.rb
         | 
| 454 | 
            +
            - lib/arduino_ci/library_properties.rb
         | 
| 447 455 | 
             
            - lib/arduino_ci/version.rb
         | 
| 448 456 | 
             
            - misc/default.yml
         | 
| 449 | 
            -
            homepage: http://github.com/ | 
| 457 | 
            +
            homepage: http://github.com/Arduino-CI/arduino_ci
         | 
| 450 458 | 
             
            licenses:
         | 
| 451 459 | 
             
            - Apache-2.0
         | 
| 452 460 | 
             
            metadata: {}
         | 
    
        data/cpp/arduino/Arduino.h.orig
    DELETED
    
    | @@ -1,143 +0,0 @@ | |
| 1 | 
            -
            #pragma once
         | 
| 2 | 
            -
            /*
         | 
| 3 | 
            -
            Mock Arduino.h library.
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            Where possible, variable names from the Arduino library are used to avoid conflicts
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            */
         | 
| 8 | 
            -
            // Chars and strings
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            #include "ArduinoDefines.h"
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            #include "WCharacter.h"
         | 
| 13 | 
            -
            #include "WString.h"
         | 
| 14 | 
            -
            #include "Print.h"
         | 
| 15 | 
            -
            #include "Stream.h"
         | 
| 16 | 
            -
            #include "HardwareSerial.h"
         | 
| 17 | 
            -
            #include "SPI.h"
         | 
| 18 | 
            -
            #include "Nullptr.h"
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            typedef bool boolean;
         | 
| 21 | 
            -
            typedef uint8_t byte;
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            #include "binary.h"
         | 
| 24 | 
            -
             | 
| 25 | 
            -
            // Math and Trig
         | 
| 26 | 
            -
            #include "AvrMath.h"
         | 
| 27 | 
            -
             | 
| 28 | 
            -
            #include "Godmode.h"
         | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
            // Bits and Bytes
         | 
| 32 | 
            -
            #define bit(b) (1UL << (b))
         | 
| 33 | 
            -
            #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
         | 
| 34 | 
            -
            #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
         | 
| 35 | 
            -
            #define bitSet(value, bit) ((value) |= (1UL << (bit)))
         | 
| 36 | 
            -
            #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
         | 
| 37 | 
            -
            #define highByte(w) ((uint8_t) ((w) >> 8))
         | 
| 38 | 
            -
            #define lowByte(w) ((uint8_t) ((w) & 0xff))
         | 
| 39 | 
            -
             | 
| 40 | 
            -
            // Arduino defines this
         | 
| 41 | 
            -
            #define _NOP() do { 0; } while (0)
         | 
| 42 | 
            -
             | 
| 43 | 
            -
            // might as well use that NO-op macro for these, while unit testing
         | 
| 44 | 
            -
            // you need interrupts? interrupt yourself
         | 
| 45 | 
            -
            #define yield() _NOP()
         | 
| 46 | 
            -
            #define interrupts() _NOP()
         | 
| 47 | 
            -
            #define noInterrupts() _NOP()
         | 
| 48 | 
            -
             | 
| 49 | 
            -
            // TODO: correctly establish this per-board!
         | 
| 50 | 
            -
            #define F_CPU 1000000UL
         | 
| 51 | 
            -
            #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
         | 
| 52 | 
            -
            #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
         | 
| 53 | 
            -
            #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
         | 
| 54 | 
            -
             | 
| 55 | 
            -
            typedef unsigned int word;
         | 
| 56 | 
            -
             | 
| 57 | 
            -
            #define bit(b) (1UL << (b))
         | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
            /*
         | 
| 62 | 
            -
            unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
         | 
| 63 | 
            -
            unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
         | 
| 64 | 
            -
             | 
| 65 | 
            -
            void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
         | 
| 66 | 
            -
            uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
         | 
| 67 | 
            -
             | 
| 68 | 
            -
            */
         | 
| 69 | 
            -
             | 
| 70 | 
            -
            // Get the bit location within the hardware port of the given virtual pin.
         | 
| 71 | 
            -
            // This comes from the pins_*.c file for the active board configuration.
         | 
| 72 | 
            -
             | 
| 73 | 
            -
            #define analogInPinToBit(P) (P)
         | 
| 74 | 
            -
            #define digitalPinToInterrupt(P) (P)
         | 
| 75 | 
            -
             | 
| 76 | 
            -
            /*
         | 
| 77 | 
            -
            // On the ATmega1280, the addresses of some of the port registers are
         | 
| 78 | 
            -
            // greater than 255, so we can't store them in uint8_t's.
         | 
| 79 | 
            -
            extern const uint16_t PROGMEM port_to_mode_PGM[];
         | 
| 80 | 
            -
            extern const uint16_t PROGMEM port_to_input_PGM[];
         | 
| 81 | 
            -
            extern const uint16_t PROGMEM port_to_output_PGM[];
         | 
| 82 | 
            -
             | 
| 83 | 
            -
            extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
         | 
| 84 | 
            -
            // extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
         | 
| 85 | 
            -
            extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
         | 
| 86 | 
            -
            extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
         | 
| 87 | 
            -
             | 
| 88 | 
            -
            // Get the bit location within the hardware port of the given virtual pin.
         | 
| 89 | 
            -
            // This comes from the pins_*.c file for the active board configuration.
         | 
| 90 | 
            -
            //
         | 
| 91 | 
            -
            // These perform slightly better as macros compared to inline functions
         | 
| 92 | 
            -
            //
         | 
| 93 | 
            -
            #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
         | 
| 94 | 
            -
            #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
         | 
| 95 | 
            -
            #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
         | 
| 96 | 
            -
            #define analogInPinToBit(P) (P)
         | 
| 97 | 
            -
            #define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
         | 
| 98 | 
            -
            #define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
         | 
| 99 | 
            -
            #define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
         | 
| 100 | 
            -
             | 
| 101 | 
            -
            */
         | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 104 | 
            -
            /* TODO
         | 
| 105 | 
            -
             | 
| 106 | 
            -
            // USB
         | 
| 107 | 
            -
            #include "USBAPI.h"
         | 
| 108 | 
            -
            Keyboard
         | 
| 109 | 
            -
            Mouse
         | 
| 110 | 
            -
             | 
| 111 | 
            -
            */
         | 
| 112 | 
            -
             | 
| 113 | 
            -
            // uint16_t makeWord(uint16_t w);
         | 
| 114 | 
            -
            // uint16_t makeWord(byte h, byte l);
         | 
| 115 | 
            -
            inline unsigned int makeWord(unsigned int w) { return w; }
         | 
| 116 | 
            -
            inline unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }
         | 
| 117 | 
            -
             | 
| 118 | 
            -
            #define word(...) makeWord(__VA_ARGS__)
         | 
| 119 | 
            -
             | 
| 120 | 
            -
            <<<<<<< Updated upstream
         | 
| 121 | 
            -
             | 
| 122 | 
            -
            =======
         | 
| 123 | 
            -
            unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
         | 
| 124 | 
            -
            unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
         | 
| 125 | 
            -
             | 
| 126 | 
            -
            // audio is taken care of in GODMODE
         | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
            // BIG TODO ON THIS ONE
         | 
| 130 | 
            -
            // $ find . | grep pins_
         | 
| 131 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/circuitplay32u4/pins_arduino.h
         | 
| 132 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/eightanaloginputs/pins_arduino.h
         | 
| 133 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/ethernet/pins_arduino.h
         | 
| 134 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/gemma/pins_arduino.h
         | 
| 135 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/leonardo/pins_arduino.h
         | 
| 136 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/mega/pins_arduino.h
         | 
| 137 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/micro/pins_arduino.h
         | 
| 138 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/robot_control/pins_arduino.h
         | 
| 139 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/robot_motor/pins_arduino.h
         | 
| 140 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/standard/pins_arduino.h
         | 
| 141 | 
            -
            // ./arduino-1.8.5/hardware/arduino/avr/variants/yun/pins_arduino.h
         | 
| 142 | 
            -
            // #include "pins_arduino.h"
         | 
| 143 | 
            -
            >>>>>>> Stashed changes
         | 
    
        data/exe/libasan.rb
    DELETED
    
    | @@ -1,29 +0,0 @@ | |
| 1 | 
            -
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            require 'arduino_ci'
         | 
| 3 | 
            -
            require 'set'
         | 
| 4 | 
            -
            require 'pathname'
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            WIDTH = 80
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            # initialize command and config
         | 
| 9 | 
            -
            config = ArduinoCI::CIConfig.default.from_project_library
         | 
| 10 | 
            -
            @arduino_cmd = ArduinoCI::ArduinoInstallation.autolocate!
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            # initialize library under test
         | 
| 13 | 
            -
            installed_library_path = @arduino_cmd.install_local_library(Pathname.new("."))
         | 
| 14 | 
            -
            cpp_library = ArduinoCI::CppLibrary.new(installed_library_path, @arduino_cmd.lib_dir)
         | 
| 15 | 
            -
             | 
| 16 | 
            -
            # check GCC
         | 
| 17 | 
            -
            compilers = config.compilers_to_use
         | 
| 18 | 
            -
            compilers.each do |gcc_binary|
         | 
| 19 | 
            -
              puts "Checking #{gcc_binary} version"
         | 
| 20 | 
            -
              puts cpp_library.gcc_version(gcc_binary).split("\n").map { |l| "    #{l}" }.join("\n")
         | 
| 21 | 
            -
              exists = cpp_library.libasan?(gcc_binary)
         | 
| 22 | 
            -
              puts "libasan availability for #{gcc_binary}: #{exists}"
         | 
| 23 | 
            -
              next unless exists
         | 
| 24 | 
            -
             | 
| 25 | 
            -
              puts "========== Stdout:"
         | 
| 26 | 
            -
              puts @arduino_cmd.last_out
         | 
| 27 | 
            -
              puts "========== Stderr:"
         | 
| 28 | 
            -
              puts @arduino_cmd.last_err
         | 
| 29 | 
            -
            end
         |