├── Dockerfile ├── README.md ├── bin ├── atoum └── entrypoint ├── files ├── .atoum.php └── .bootstrap.atoum.php ├── hhvm ├── Dockerfile ├── bin │ ├── atoum │ └── entrypoint └── files │ ├── .atoum.php │ └── .bootstrap.atoum.php ├── php7 ├── Dockerfile ├── README.md ├── bin │ ├── atoum │ └── entrypoint └── files │ ├── .atoum.php │ └── .bootstrap.atoum.php └── tests ├── atoum.bats └── docker.bats /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM phusion/baseimage 2 | 3 | ENV HOME=/root 4 | ENV ATOUM_VERSION=~2.0 5 | 6 | RUN apt-get update -y && \ 7 | apt-get install -y php5-dev php5-cli wget git 8 | 9 | RUN echo "memory_limit=-1" >> /etc/php5/cli/php.ini && \ 10 | echo "date.timezone=Europe/Paris" >> /etc/php5/cli/php.ini 11 | 12 | RUN wget -O /usr/local/bin/composer https://getcomposer.org/composer.phar && \ 13 | chmod +x /usr/local/bin/composer 14 | 15 | RUN wget -O /usr/local/bin/pickle https://github.com/FriendsOfPHP/pickle/releases/download/v0.4.0/pickle.phar && \ 16 | chmod +x /usr/local/bin/pickle 17 | 18 | ADD bin/entrypoint /sbin/entrypoint 19 | RUN chmod +x /sbin/entrypoint 20 | 21 | ADD bin/atoum /usr/local/bin/atoum 22 | RUN chmod +x /usr/local/bin/atoum 23 | 24 | ADD https://raw.githubusercontent.com/atoum/atoumsay/master/atoumsay /usr/local/bin/atoum-say 25 | RUN chmod +x /usr/local/bin/atoum-say 26 | 27 | RUN echo " /.autoloaders.atoum.php 28 | RUN echo " /.extensions.atoum.php 29 | ADD files/.atoum.php /.atoum.php 30 | ADD files/.bootstrap.atoum.php /.bootstrap.atoum.php 31 | 32 | RUN pickle install xdebug 33 | RUN composer global require atoum/atoum:$ATOUM_VERSION 34 | 35 | VOLUME /src 36 | WORKDIR /src 37 | 38 | ENTRYPOINT ["/sbin/entrypoint"] 39 | 40 | ADD tests /tests 41 | RUN git clone https://github.com/sstephenson/bats.git && \ 42 | cd bats && \ 43 | ./install.sh /usr/local && \ 44 | bats /tests/*.bats && \ 45 | rm -rf /tests && \ 46 | rm -rf /usr/local/{bin,libexec,share/man/man{1,7}}/bats* 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # atoum/atoum 2 | 3 | ![atoum](http://atoum.org/images/logo/atoum.png) 4 | 5 | ## Install it 6 | 7 | Pull the [docker](https://www.docker.com/) image: 8 | 9 | ```sh 10 | $ docker pull atoum/atoum 11 | ``` 12 | 13 | There are several tags available. Depending on the atoum version you want to use, you should use: 14 | 15 | * `atoum/atoum:latest` to get an image containing the last stable atoum release, 16 | * `atoum/atoum:2.x` to get an image containing the last `2.x` atoum release, 17 | * `atoum/atoum:1.x` to get an image containing the last `1.x` atoum release. 18 | 19 | ## Run it 20 | 21 | Run the container: 22 | 23 | ```sh 24 | $ docker run --rm -it -v $(pwd):/src atoum/atoum -d tests/units 25 | ``` 26 | 27 | The command explains as follow: 28 | 29 | ```sh 30 | $ docker run --rm -it -v :/src atoum/atoum [atoum-arguments] 31 | ``` 32 | 33 | As you can see, you will have to provide a directory to link to the `/src` volume. 34 | `atoum-arguments` are standard atoum CLI arguments which you can find by using `-h`. 35 | 36 | ## Utilities 37 | 38 | The docker image ships with a handy command line utility you can access to with the `atoum` command 39 | inside your containers. This command is automatically run as the entrypoint but if you are 40 | extending this image or working in it, you will probably use the `atoum` CLI so here is 41 | how it works: 42 | 43 | * the `ext-install` command lets you install and configure atoum extensions: 44 | 45 | ```sh 46 | $ atoum ext-install bdd 47 | 48 | $ atoum ext-install json '~1.0' 49 | ``` 50 | 51 | * the `ext-update` command lets you update installed extensions: 52 | 53 | ```sh 54 | $ atoum ext-update bdd 55 | ``` 56 | 57 | * the `update` command lets you keep atoum up-to-date: 58 | 59 | ```sh 60 | $ atoum update 61 | ``` 62 | 63 | * the `update-all` command lets you update everything (atoum and all installed extensions): 64 | 65 | ```sh 66 | $ atoum update-all 67 | ``` 68 | 69 | * the `say` command lets you make atoum talk: 70 | 71 | ```sh 72 | $ atoum say 'Hello World!' 73 | ``` 74 | 75 | * every other things you pass to the `atoum` CLI will be forwarded to the original `atoum` binary. For example 76 | the following command will run the tests in `tests/units` and enable the loop mode: 77 | 78 | ```sh 79 | $ atoum -d tests/units --loop 80 | ``` 81 | -------------------------------------------------------------------------------- /bin/atoum: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case "$1" in 4 | "ext-install") 5 | [ -n "$3" ] && CONSTRAINT=":$3" 6 | NAMESPACE=$(echo "$2" | sed "s/-\(.\)/\U\1/") 7 | 8 | composer global require atoum/$2-extension$CONSTRAINT 9 | 10 | if ! grep -q "atoum\\\\$NAMESPACE\\\\extension" /.extensions.atoum.php 11 | then 12 | echo "\$runner->addExtension(new atoum\\$NAMESPACE\\extension(\$script));" >> /.extensions.atoum.php 13 | fi 14 | 15 | if ! grep -q "$2-extension" /.autoloaders.atoum.php 16 | then 17 | if -f '/root/.composer/vendor/atoum/$2-extension/autoloader.php' 18 | then 19 | echo "require_once '/root/.composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 20 | fi 21 | 22 | if -f '/root/.composer/vendor/atoum/$2-extension/Autoloader.php' 23 | then 24 | echo "require_once '/root/.composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 25 | fi 26 | fi 27 | 28 | $0 --test-ext 29 | ;; 30 | 31 | "ext-update") 32 | composer global update atoum/$2-extension 33 | 34 | $0 --test-ext 35 | ;; 36 | 37 | "update") 38 | composer global update atoum/atoum 39 | 40 | $0 --test-it 41 | ;; 42 | 43 | "update-all") 44 | composer global update 45 | 46 | $0 --test-it 47 | ;; 48 | 49 | "say") 50 | shift 51 | /usr/local/bin/atoum-say "$*" 52 | ;; 53 | 54 | *) 55 | /root/.composer/vendor/bin/atoum $@ 56 | ;; 57 | esac 58 | -------------------------------------------------------------------------------- /bin/entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export HOME=/root 4 | 5 | /sbin/my_init -- atoum $@ 6 | -------------------------------------------------------------------------------- /files/.atoum.php: -------------------------------------------------------------------------------- 1 | getReports(); 7 | 8 | if (sizeof($reports) === 0) 9 | { 10 | $reports = array($script->addDefaultReport()); 11 | } 12 | 13 | $reports[0]->addField(new atoum\report\fields\runner\atoum\logo()); 14 | -------------------------------------------------------------------------------- /files/.bootstrap.atoum.php: -------------------------------------------------------------------------------- 1 | addExtension(new atoum\\$NAMESPACE\\extension(\$script));" >> /.extensions.atoum.php 13 | fi 14 | 15 | if ! grep -q "$2-extension" /.autoloaders.atoum.php 16 | then 17 | if -f '/root/.composer/vendor/atoum/$2-extension/autoloader.php' 18 | then 19 | echo "require_once '/root/.composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 20 | fi 21 | 22 | if -f '/root/.composer/vendor/atoum/$2-extension/Autoloader.php' 23 | then 24 | echo "require_once '/root/.composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 25 | fi 26 | fi 27 | 28 | $0 --test-ext 29 | ;; 30 | 31 | "ext-update") 32 | composer global update atoum/$2-extension 33 | 34 | $0 --test-ext 35 | ;; 36 | 37 | "update") 38 | composer global update atoum/atoum 39 | 40 | $0 --test-it 41 | ;; 42 | 43 | "update-all") 44 | composer global update 45 | 46 | $0 --test-it 47 | ;; 48 | 49 | "say") 50 | shift 51 | /usr/local/bin/atoum-say "$*" 52 | ;; 53 | 54 | *) 55 | /root/.composer/vendor/bin/atoum $@ 56 | ;; 57 | esac 58 | -------------------------------------------------------------------------------- /hhvm/bin/entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export HOME=/root 4 | 5 | atoum $@ 6 | -------------------------------------------------------------------------------- /hhvm/files/.atoum.php: -------------------------------------------------------------------------------- 1 | getReports(); 7 | 8 | if (sizeof($reports) === 0) 9 | { 10 | $reports = array($script->addDefaultReport()); 11 | } 12 | 13 | $reports[0]->addField(new atoum\report\fields\runner\atoum\logo()); 14 | -------------------------------------------------------------------------------- /hhvm/files/.bootstrap.atoum.php: -------------------------------------------------------------------------------- 1 | > /etc/apt/sources.list && \ 7 | apt-get update -y && \ 8 | apt-get install -y wget git libzip-dev 9 | 10 | WORKDIR /usr/local/src/php 11 | ENV PHP_DIR /usr/local/php 12 | 13 | RUN git pull origin && \ 14 | ./buildconf && \ 15 | ./configure \ 16 | --prefix=$PHP_DIR \ 17 | --with-config-file-path=$PHP_DIR \ 18 | --with-config-file-scan-dir=$PHP_DIR/conf.d \ 19 | --with-apxs2=/usr/bin/apxs2 \ 20 | --with-libdir=/lib/x86_64-linux-gnu \ 21 | --with-zlib \ 22 | --enable-mbstring \ 23 | --with-openssl \ 24 | --with-libzip --enable-zip \ 25 | --without-pear && \ 26 | make && \ 27 | make install && \ 28 | ln -sf /usr/local/php/bin/php /usr/local/bin/php && \ 29 | ln -sf /usr/local/php/bin/phpize /usr/local/bin/phpize && \ 30 | ln -sf /usr/local/php/bin/php-config /usr/local/bin/php-config 31 | 32 | RUN mkdir -p /usr/local/php/conf.d 33 | RUN echo "memory_limit=-1" >> /usr/local/php/conf.d/memory.ini && \ 34 | echo "date.timezone=Europe/Paris" >> /usr/local/php/conf.d/date.timezone.ini 35 | 36 | RUN wget -O /usr/local/bin/composer https://getcomposer.org/composer.phar && \ 37 | chmod +x /usr/local/bin/composer 38 | 39 | WORKDIR /usr/local/src 40 | RUN git clone https://github.com/FriendsOfPHP/pickle.git && \ 41 | cd pickle && composer install --prefer-dist --optimize-autoloader --no-dev && \ 42 | ln -sf /usr/local/src/pickle/bin/pickle /usr/local/bin/pickle && \ 43 | chmod +x /usr/local/bin/pickle 44 | 45 | ADD bin/entrypoint /sbin/entrypoint 46 | RUN chmod +x /sbin/entrypoint 47 | 48 | ADD bin/atoum /usr/local/bin/atoum 49 | RUN chmod +x /usr/local/bin/atoum 50 | 51 | ADD https://raw.githubusercontent.com/atoum/atoumsay/master/atoumsay /usr/local/bin/atoum-say 52 | RUN chmod +x /usr/local/bin/atoum-say 53 | 54 | RUN echo " /.autoloaders.atoum.php 55 | RUN echo " /.extensions.atoum.php 56 | ADD files/.atoum.php /.atoum.php 57 | ADD files/.bootstrap.atoum.php /.bootstrap.atoum.php 58 | 59 | RUN composer global require atoum/atoum:$ATOUM_VERSION 60 | 61 | VOLUME /src 62 | WORKDIR /src 63 | 64 | ENTRYPOINT ["/sbin/entrypoint"] 65 | -------------------------------------------------------------------------------- /php7/README.md: -------------------------------------------------------------------------------- 1 | # atoum/php7 2 | 3 | ![atoum](http://downloads.atoum.org/images/logo.png) 4 | 5 | ## Install it 6 | 7 | Pull the [docker](https://www.docker.com/) image: 8 | 9 | ```sh 10 | $ docker pull atoum/php7 11 | ``` 12 | 13 | There are several tags available. Depending on the atoum version you want to use, you should use: 14 | 15 | * `atoum/php7:latest` to get an image containing the last stable atoum release, 16 | * `atoum/php7:2.x` to get an image containing the last `2.x` atoum release. 17 | 18 | ## Run it 19 | 20 | Run the container: 21 | 22 | ```sh 23 | $ docker run --rm -it -v $(pwd):/src atoum/php7 -d tests/units 24 | ``` 25 | 26 | The command explains as follow: 27 | 28 | ```sh 29 | $ docker run --rm -it -v :/src atoum/php7 [atoum-arguments] 30 | ``` 31 | 32 | As you can see, you will have to provide a directory to link to the `/src` volume. 33 | `atoum-arguments` are standard atoum CLI arguments which you can find by using `-h`. 34 | 35 | ## Utilities 36 | 37 | The docker image ships with a handy command line utility you can access to with the `atoum` command 38 | inside your containers. This command is automatically run as the entrypoint but if you are 39 | extending this image or working in it, you will probably use the `atoum` CLI so here is 40 | how it works: 41 | 42 | * the `ext-install` command lets you install and configure atoum extensions: 43 | 44 | ```sh 45 | $ atoum ext-install bdd 46 | 47 | $ atoum ext-install json '~1.0' 48 | ``` 49 | 50 | * the `ext-update` command lets you update installed extensions: 51 | 52 | ```sh 53 | $ atoum ext-update bdd 54 | ``` 55 | 56 | * the `update` command lets you keep atoum up-to-date: 57 | 58 | ```sh 59 | $ atoum update 60 | ``` 61 | 62 | * the `update-all` command lets you update everything (atoum and all installed extensions): 63 | 64 | ```sh 65 | $ atoum update-all 66 | ``` 67 | 68 | * the `say` command lets you make atoum talk: 69 | 70 | ```sh 71 | $ atoum say 'Hello World!' 72 | ``` 73 | 74 | * every other things you pass to the `atoum` CLI will be forwarded to the original `atoum` binary. For example 75 | the following command will run the tests in `tests/units` and enable the loop mode: 76 | 77 | ```sh 78 | $ atoum -d tests/units --loop 79 | ``` 80 | -------------------------------------------------------------------------------- /php7/bin/atoum: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case "$1" in 4 | "ext-install") 5 | [ -n "$3" ] && CONSTRAINT=":$3" 6 | NAMESPACE=$(echo "$2" | sed "s/-\(.\)/\U\1/") 7 | 8 | composer global require atoum/$2-extension$CONSTRAINT 9 | 10 | if ! grep -q "atoum\\\\$NAMESPACE\\\\extension" /.extensions.atoum.php 11 | then 12 | echo "\$runner->addExtension(new atoum\\$NAMESPACE\\extension(\$script));" >> /.extensions.atoum.php 13 | fi 14 | 15 | if ! grep -q "$2-extension" /.autoloaders.atoum.php 16 | then 17 | if -f '/usr/local/composer/vendor/atoum/$2-extension/autoloader.php' 18 | then 19 | echo "require_once '/usr/local/composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 20 | fi 21 | 22 | if -f '/usr/local/composer/vendor/atoum/$2-extension/Autoloader.php' 23 | then 24 | echo "require_once '/usr/local/composer/vendor/atoum/$2-extension/autoloader.php';" >> /.autoloaders.atoum.php 25 | fi 26 | fi 27 | 28 | $0 --test-ext 29 | ;; 30 | 31 | "ext-update") 32 | composer global update atoum/$2-extension 33 | 34 | $0 --test-ext 35 | ;; 36 | 37 | "update") 38 | composer global update atoum/atoum 39 | 40 | $0 --test-it 41 | ;; 42 | 43 | "update-all") 44 | composer global update 45 | 46 | $0 --test-it 47 | ;; 48 | 49 | "say") 50 | shift 51 | /usr/local/bin/atoum-say "$*" 52 | ;; 53 | 54 | *) 55 | /usr/local/composer/vendor/bin/atoum $@ 56 | ;; 57 | esac 58 | -------------------------------------------------------------------------------- /php7/bin/entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export HOME=/root 4 | 5 | atoum $@ 6 | -------------------------------------------------------------------------------- /php7/files/.atoum.php: -------------------------------------------------------------------------------- 1 | getReports(); 7 | 8 | if (sizeof($reports) === 0) 9 | { 10 | $reports = array($script->addDefaultReport()); 11 | } 12 | 13 | $reports[0]->addField(new atoum\report\fields\runner\atoum\logo()); 14 | -------------------------------------------------------------------------------- /php7/files/.bootstrap.atoum.php: -------------------------------------------------------------------------------- 1 |