Skip to content

Latest commit

 

History

History
128 lines (81 loc) · 3.17 KB

README.md

File metadata and controls

128 lines (81 loc) · 3.17 KB

crystal-examples Build Status

crystal examples checker

Install

  • create crystal-examples command
shards update
make
  • prepare a path of crystal src as ./crystal like this.
ln -s /opt/crystal .
  • prepare docker image when you want to run spec in docker.
docker pull jhass/crystal-build-x86_64

Usage

make check # scan and count examples

  • Found 1233 examples

make gen # generates

  • examples/ # extracted example files (1 example has 1 file)
  • gen/spec/ # converted into spec file (1 class has 1 file)

make compile # compiles ./examples/*.cr by using cache

make docker_spec # run specs in ./gen/spec/ by using cache in docker

make test # Run all at once: spec, gen, docker_spec

Pending controls

not wanted to generate codes

  • pendings/ # Pseudo codes or some stuff can be ignored by putting them here. (managed by SHA1)

not wanted to run specs

  • gen/skip/ # These files are skipped for spec execution.

Format and rules

Caution

Generated crystal codes in examples and gen/spec may destroy your server. Please be careful and check the code before run.

Spec

make spec

  • executes unit tests about this application itself

make generated_spec (should be used in TravisCI or docker) (!!!DANGER!!!)

  • executes generated spec files filtered by gen/skip in current host.

make docker_spec

  • executes same as generated_spec except running in docker containers. (needs docker image: see DOCKER_IMAGE in Makefile)

make status

  • shows statistics about the examples.
Specs 126 (102 successes, 4 failures, 20 pending)
Examples 1190 (994 successes, 9 failures, 187 pending)

make gen_fixtures generates

TODO

http/params.cr:273 (017.cr)

  • to_s should escape @ to %40 ?

io/memory.cr:355 (014.cr)

io.cr:544 (021.cr)

  • What happen when gets_to_end is called twice?

named_tuple.cr:42 (003.cr)

  • casting Int32 to Int64

object.cr

  • almost using macros

socket.cr

  • creates real connections

tuple.cr

  • casting Int32 to Int64

Contributing

  1. Fork it ( https://github.com/maiha/crystal-examples/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • maiha maiha - creator, maintainer