2019-09-18 13:10:55 +03:00
|
|
|
# can't put in helper or it will run (and fail) with parallel
|
|
|
|
#require "minitest/reporters"
|
|
|
|
#Minitest::Reporters.use!( Minitest::Reporters::MeanTimeReporter.new)
|
2015-08-08 18:08:15 +03:00
|
|
|
|
2019-09-18 22:36:56 +03:00
|
|
|
guard :minitest , all_on_start: false do # with Minitest::Unit
|
2017-04-12 20:36:16 +03:00
|
|
|
|
|
|
|
# if any test file changes, run that test
|
2015-08-08 18:08:15 +03:00
|
|
|
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
|
2017-04-12 20:36:16 +03:00
|
|
|
|
|
|
|
# if any helper in any directory changes, run test_all in the same directory
|
2016-12-17 00:15:27 +02:00
|
|
|
watch(%r{^test/(.*/)?helper.rb$}) { |m| "test/#{m[1]}test_all.rb" }
|
2017-04-12 20:36:16 +03:00
|
|
|
|
|
|
|
# if any file XX in any directory in the /lib changes, run a test_XX in the
|
|
|
|
# shadow directory in the /test
|
2015-08-08 18:08:15 +03:00
|
|
|
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
2018-05-07 22:30:43 +03:00
|
|
|
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}1.rb" }
|
|
|
|
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}2.rb" }
|
|
|
|
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}3.rb" }
|
2015-08-08 18:08:15 +03:00
|
|
|
|
2016-12-14 19:06:32 +02:00
|
|
|
#Arm instructions
|
|
|
|
watch(%r{^lib/arm/instructions/(.+)_instruction.rb}) { |m| "test/arm/test_#{m[1]}.rb" }
|
|
|
|
|
2017-04-23 18:43:32 +03:00
|
|
|
#parfait type tests have a whole directory
|
|
|
|
watch(%r{^lib/parfait/type.rb}) { Dir["test/parfait/type/test_*.rb"] }
|
2015-08-08 18:08:15 +03:00
|
|
|
|
2018-06-25 16:32:20 +03:00
|
|
|
# ruby compiler tests have a whole directory
|
2018-07-19 14:47:29 +03:00
|
|
|
watch(%r{^lib/ruby/ruby_compiler.rb}) { Dir["test/ruby/test_*.rb"] }
|
2018-06-25 16:32:20 +03:00
|
|
|
|
2019-10-04 00:36:49 +03:00
|
|
|
watch(%r{^lib/sol/statements/send_statement.rb}) {
|
|
|
|
[ Dir["test/sol/send/test_*.rb"] ] }
|
2017-04-12 20:18:41 +03:00
|
|
|
|
2018-05-15 19:29:06 +03:00
|
|
|
# message setup
|
2019-10-03 20:55:41 +03:00
|
|
|
watch(%r{^lib/slot_machine/instruction/message_setup.rb}) { Dir["test/slot_machine/send/test_setup*.rb"] }
|
2018-04-05 20:10:00 +03:00
|
|
|
|
2019-08-24 16:58:14 +03:00
|
|
|
# mains test
|
|
|
|
watch(%r{^test/mains/source/(.*)\.rb}) { "test/mains/test_interpreted.rb" }
|
|
|
|
|
2015-08-08 18:08:15 +03:00
|
|
|
end
|