diff options
| author | Tom Black <[email protected]> | 2016-11-27 23:31:40 -0500 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2016-11-27 23:31:40 -0500 |
| commit | 1a25d83171672151abebfec28aa6251987b53a25 (patch) | |
| tree | bd35ec819e29831f948146415861384f346fa32b | |
| parent | 616ec4108450f93f7e8625b490c7ae4c4e2054af (diff) | |
| download | ruby2d-1a25d83171672151abebfec28aa6251987b53a25.tar.gz ruby2d-1a25d83171672151abebfec28aa6251987b53a25.zip | |
Update Rakefile to run native and web tests
Also other cosmetic fixes
| -rw-r--r-- | Rakefile | 28 |
1 files changed, 22 insertions, 6 deletions
@@ -17,13 +17,17 @@ if `which simple2d`.empty? exit end +def print_task(task) + print "\n", "==> ".blue, task.bold, "\n\n" +end + def run_cmd(cmd) - print "\n==> ".blue, cmd.bold, "\n\n" + puts "==> #{cmd}\n" system cmd end def run_test(file) - print "\n==> ".blue, "running tests/#{file}.rb".bold, "\n\n" + print_task "Running tests/#{file}.rb" system "( cd tests/ ; ruby #{file}.rb )" end @@ -33,22 +37,25 @@ task default: 'all' desc "Uninstall gem" task :uninstall do + print_task "Uninstalling" run_cmd "gem uninstall ruby2d --executables" end desc "Build gem" task :build do + print_task "Building" run_cmd "gem build ruby2d.gemspec --verbose" end desc "Install gem" task :install do + print_task "Installing" run_cmd "gem install ruby2d-#{Ruby2D::VERSION}.gem --local --verbose" end desc "Run the RSpec tests" RSpec::Core::RakeTask.new do |t| - print "\n==> ".blue, "running RSpec".bold, "\n\n" + print_task "Running RSpec" t.pattern = "spec/*spec.rb" end @@ -62,9 +69,18 @@ task :input do run_test 'input' end -desc "Run controller tests" -task :controller do - run_test 'controller' +desc "Run native build test" +task :native do + print_task "Running native build test" + run_cmd "ruby2d build native tests/testcard.rb" + print_task "Running native tests/testcard.rb" + system "( cd tests/ ; ../build/app )" +end + +desc "Run web build test" +task :web do + print_task "Running web build test" + run_cmd "ruby2d build web tests/testcard.rb" end desc "Uninstall, build, install, and test" |
