Skip to content

Commit

Permalink
Showing 344 changed files with 4,495 additions and 2,404 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ lib/ruby/stdlib/readline*
lib/ruby/stdlib/minitest*
lib/ruby/stdlib/power_assert*
lib/ruby/stdlib/psych*
lib/ruby/stdlib/**/maven-metadata-local.xml
release.properties
share
spaces test
3 changes: 3 additions & 0 deletions bin/jruby-truffle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

$(dirname $BASH_SOURCE[0])/jruby -X+T $@
2 changes: 1 addition & 1 deletion ci.hocon
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ graal-vm: {
downloads: {
GRAALVM_DIR: {
name: graalvm-release,
version: "0.15",
version: "0.16",
platformspecific: true
}
}
14 changes: 11 additions & 3 deletions core/src/main/java/org/jruby/runtime/Visibility.java
Original file line number Diff line number Diff line change
@@ -29,15 +29,23 @@ public enum Visibility {
PUBLIC, PROTECTED, PRIVATE, MODULE_FUNCTION;

private static final Visibility[] VALUES = values();
public boolean isPrivate() {
return this == PRIVATE;

public boolean isPublic() {
return this == PUBLIC;
}

public boolean isProtected() {
return this == PROTECTED;
}

public boolean isPrivate() {
return this == PRIVATE;
}

public boolean isModuleFunction() {
return this == MODULE_FUNCTION;
}

public static Visibility[] getValues() {
return VALUES;
}
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_COVERAGE_GLOBAL = bool(TRUFFLE, "truffle.coverage.global", false, "Run coverage for all code and print results on exit.");

public static final Option<String> TRUFFLE_CORE_LOAD_PATH = string(TRUFFLE, "truffle.core.load_path", "truffle:/jruby-truffle", "Location to load the Truffle core library from.");
public static final Option<Boolean> TRUFFLE_CORE_PARALLEL_LOAD = bool(TRUFFLE, "truffle.core.parallel_load", true, "Load the Truffle core library in parallel.");
public static final Option<Boolean> TRUFFLE_CORE_PARALLEL_LOAD = bool(TRUFFLE, "truffle.core.parallel_load", false, "Load the Truffle core library in parallel.");

public static final Option<Integer> TRUFFLE_ARRAY_UNINITIALIZED_SIZE = integer(TRUFFLE, "truffle.array.uninitialized_size", 32, "How large an Array to allocate when we have no other information to go on.");
public static final Option<Integer> TRUFFLE_ARRAY_SMALL = integer(TRUFFLE, "truffle.array.small", 3, "Maximum size of an Array to consider small for optimisations.");
@@ -306,6 +306,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_METRICS_MEMORY_USED_ON_EXIT = bool(TRUFFLE, "truffle.metrics.memory_used_on_exit", false, "Print the size of heap memory in use on exit.");
public static final Option<Boolean> TRUFFLE_CALL_GRAPH = bool(TRUFFLE, "truffle.callgraph", false, "Maintain a call graph.");
public static final Option<String> TRUFFLE_CALL_GRAPH_WRITE = string(TRUFFLE, "truffle.callgraph.write", "File to write the call garph to on exit.");
public static final Option<Boolean> TRUFFLE_CHAOS = bool(TRUFFLE, "truffle.chaos", false, "Randomly modify the representation of objects.");

public static final Option<Boolean> TRUFFLE_GRAAL_WARNING_UNLESS = bool(TRUFFLE, "truffle.graal.warn_unless", true, "Warn unless the JVM has the Graal compiler.");
public static final Option<Boolean> TRUFFLE_PERF_WARNING = bool(TRUFFLE, "truffle.perf.warn", false, "Warn when using a fature which is not optimized yet.");
2 changes: 1 addition & 1 deletion lib/pom.rb
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ class Gem::Installer
def say(message)
if message != spec.post_install_message || !MORE_QUIET
super
end
end
end
end
end
14 changes: 7 additions & 7 deletions lib/ruby/truffle/cext/ruby.h
Original file line number Diff line number Diff line change
@@ -52,11 +52,7 @@ extern "C" {

// Basic types

#ifdef JT_INT_VALUE
typedef uintptr_t VALUE;
#else
typedef void *VALUE;
#endif
typedef void *VALUE;

typedef VALUE ID;

@@ -420,7 +416,7 @@ VALUE rb_class_real(VALUE ruby_class);
VALUE rb_class_superclass(VALUE ruby_class);
VALUE rb_class_of(VALUE object);
VALUE rb_obj_class(VALUE object);
#define CLASS_OF(object) rb_class_of((VALUE) (object))
VALUE CLASS_OF(VALUE object);
VALUE rb_obj_alloc(VALUE ruby_class);
VALUE rb_class_path(VALUE ruby_class);
VALUE rb_path2class(const char *string);
@@ -522,7 +518,7 @@ void rb_undef(VALUE module, ID name);

void rb_attr(VALUE ruby_class, ID name, int read, int write, int ex);

typedef VALUE (*rb_alloc_func_t)(VALUE);
typedef VALUE (*rb_alloc_func_t)(VALUE ruby_class);
void rb_define_alloc_func(VALUE ruby_class, rb_alloc_func_t alloc_function);

// Mutexes
@@ -680,6 +676,10 @@ VALUE *rb_ruby_verbose_ptr(void);
VALUE *rb_ruby_debug_ptr(void);
#define ruby_debug (*rb_ruby_debug_ptr())

// Non-standard

NORETURN(void rb_jt_error(const char *message));

#if defined(__cplusplus)
}
#endif
88 changes: 74 additions & 14 deletions lib/ruby/truffle/jruby+truffle/lib/truffle/config.rb
Original file line number Diff line number Diff line change
@@ -174,6 +174,14 @@ def exclusion_file(gem_name)
data.pretty_inspect
end

def exclusions_for(name)
{ setup: { file: { 'excluded-tests.rb' => format(dedent(<<-RUBY), exclusion_file(name)) } } }
failures = %s
require 'truffle/exclude_rspec_examples'
Truffle.exclude_rspec_examples failures
RUBY
end

rails_common =
deep_merge replacements.fetch(:bundler),
stubs.fetch(:kernel_gem),
@@ -198,12 +206,13 @@ def exclusion_file(gem_name)
deep_merge(
rails_common,
stubs.fetch(:html_sanitizer),
setup: { file: { 'excluded-tests.rb' => format(dedent(<<-RUBY), exclusion_file(:actionpack)),
failures = %s
require 'truffle/exclude_rspec_examples'
Truffle.exclude_rspec_examples failures
RUBY
} })
exclusions_for(:actionpack))

Truffle::Runner.add_config :railties,
deep_merge(rails_common,
stubs.fetch(:activesupport_isolation),
exclusions_for(:railties),
run: { require: %w[bundler.rb] })

Truffle::Runner.add_config :'concurrent-ruby',
setup: { file: { "stub-processor_number.rb" => dedent(<<-RUBY) } },
@@ -235,27 +244,28 @@ def compute_physical_processor_count


class Truffle::Runner::CIEnvironment
def rails_ci
declare_options debug: ['--[no-]debug', 'Run tests with remote debugging enabled.',
STORE_NEW_VALUE, false],
exclude: ['--[no-]exclude', 'Exclude known failing tests',
STORE_NEW_VALUE, true]
def rails_ci(has_exclusions: false, skip_test_files: [])
options = {}
options[:debug] = ['-d', '--[no-]debug', 'Run tests with remote debugging enabled.', STORE_NEW_VALUE, false]
options[:exclude] = ['--[no-]exclusion', 'Exclude known failing tests', STORE_NEW_VALUE, true] if has_exclusions

declare_options options
repository_name 'rails'

use_only_https_git_paths!

has_to_succeed setup
set_result run([*%w[--require-pattern test/**/*_test.rb],
*(%w[-r excluded-tests] if option(:exclude)),
set_result run([*(['--exclude-pattern', *skip_test_files.join('|')] unless skip_test_files.empty?),
*%w[--require-pattern test/**/*_test.rb],
*(%w[-r excluded-tests] if has_exclusions && option(:exclude)),
*(%w[--debug] if option(:debug)),
*%w[-- -I test -e nil]])
end
end

Truffle::Runner.add_ci_definition :actionpack do
subdir 'actionpack'
rails_ci
rails_ci has_exclusions: true
end

Truffle::Runner.add_ci_definition :activemodel do
@@ -268,6 +278,56 @@ def rails_ci
rails_ci
end

Truffle::Runner.add_ci_definition :railties do
subdir 'railties'
rails_ci has_exclusions: true,
skip_test_files: %w[
test/application/asset_debugging_test.rb
test/application/assets_test.rb
test/application/bin_setup_test.rb
test/application/configuration_test.rb
test/application/console_test.rb
test/application/generators_test.rb
test/application/loading_test.rb
test/application/mailer_previews_test.rb
test/application/middleware_test.rb
test/application/multiple_applications_test.rb
test/application/paths_test.rb
test/application/rackup_test.rb
test/application/rake_test.rb
test/application/rendering_test.rb
test/application/routing_test.rb
test/application/runner_test.rb
test/application/test_runner_test.rb
test/application/test_test.rb
test/application/url_generation_test.rb
test/application/configuration/base_test.rb
test/application/configuration/custom_test.rb
test/application/initializers/frameworks_test.rb
test/application/initializers/hooks_test.rb
test/application/initializers/i18n_test.rb
test/application/initializers/load_path_test.rb
test/application/initializers/notifications_test.rb
test/application/middleware/cache_test.rb
test/application/middleware/cookies_test.rb
test/application/middleware/exceptions_test.rb
test/application/middleware/remote_ip_test.rb
test/application/middleware/sendfile_test.rb
test/application/middleware/session_test.rb
test/application/middleware/static_test.rb
test/application/rack/logger_test.rb
test/application/rake/dbs_test.rb
test/application/rake/migrations_test.rb
test/application/rake/notes_test.rb
test/railties/engine_test.rb
test/railties/generators_test.rb
test/railties/mounted_engine_test.rb
test/railties/railtie_test.rb
test/fixtures
test/rails_info_controller_test
test/commands/console_test]
end

Truffle::Runner.add_ci_definition :algebrick do

has_to_succeed setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
PathGenerationTest:
- test_original_script_name
Rails::TestInfoTest:
- test_with_file
- test_with_opts
Rails::DBConsoleTest:
- test_sqlite3_db_without_defined_rails_root
ActionsTest:
- test_environment_should_include_data_in_environment_initializer_block_with_env_option
AppGeneratorTest:
- test_application_name_is_detected_if_it_exists_and_app_folder_renamed
- test_application_name_with_spaces
- test_application_new_exits_with_message_and_non_zero_code_when_generating_inside_existing_rails_directory
- test_application_new_show_help_message_inside_existing_rails_directory
- test_assets
- test_generator_if_skip_sprockets_is_given
- test_generator_if_skip_turbolinks_is_given
- test_gitignore_when_sqlite3
- test_javascript_is_skipped_if_required
- test_jquery_is_the_default_javascript_library
- test_new_hash_style
- test_other_javascript_libraries
- test_rails_update_generates_correct_session_key
- test_spring
- test_template_is_executed_when_supplied
- test_template_is_executed_when_supplied_an_https_path
- test_web_console
GeneratorGeneratorTest:
- test_generator_skeleton_is_created
- test_generator_skeleton_is_created_without_file_name_namespace
- test_namespaced_generator_skeleton
- test_namespaced_generator_skeleton_without_file_name_namespace
Rails::Generators::GeneratorTest:
- test_filter
- test_two_filters
NamespacedScaffoldGeneratorTest:
- test_scaffold_with_namespace_on_invoke
- test_scaffold_with_namespace_on_revoke
- test_scaffold_with_nested_namespace_on_invoke
- test_scaffold_with_nested_namespace_on_revoke
OrmTest:
- test_orm_instance_returns_orm_class_instance_with_name
PluginGeneratorTest:
- test_create_mountable_application_with_mountable_option
- test_creating_engine_in_full_mode
- test_ensure_that_migration_tasks_work_with_mountable_option
- test_ensure_that_tests_work
- test_ensure_that_tests_works_in_full_mode
- test_generating_controller_inside_mountable_engine
- test_generation_runs_bundle_install_with_full_and_mountable
- test_shebang
- test_shebang_is_added_to_rails_file
- test_shebang_when_is_the_same_as_default_use_env
- test_template_is_executed_when_supplied
- test_template_is_executed_when_supplied_an_https_path
- test_usage_of_engine_commands
ResourceGeneratorTest:
- test_files_from_inherited_invocation
- test_inherited_invocations_with_attributes
- test_plural_names_are_singularized
- test_plural_names_can_be_forced
- test_resource_controller_with_actions
- test_resource_controller_with_pluralized_class_name
ScaffoldControllerGeneratorTest:
- test_controller_permit_polymorphic_references_attributes
- test_controller_permit_references_attributes
- test_controller_skeleton_is_created
- test_controller_tests_pass_by_default_inside_full_engine
- test_controller_tests_pass_by_default_inside_mountable_engine
- test_customized_orm_is_used
- test_default_orm_is_used
- test_dont_use_require_or_permit_if_there_are_no_attributes
- test_functional_tests
- test_functional_tests_without_attributes
- test_helper_are_invoked_with_a_pluralized_name
- test_index_page_have_notice
- test_views_are_generated
ScaffoldGeneratorTest:
- test_functional_tests_without_attributes
- test_scaffold_generator_belongs_to
- test_scaffold_generator_no_javascripts
- test_scaffold_generator_no_stylesheets
- test_scaffold_generator_outputs_error_message_on_missing_attribute_type
- test_scaffold_generator_password_digest
- test_scaffold_on_invoke
- test_scaffold_tests_pass_by_default_inside_full_engine
- test_scaffold_tests_pass_by_default_inside_mountable_engine
- test_scaffold_with_namespace_on_invoke
- test_scaffold_with_namespace_on_revoke
GeneratorsTest:
- test_rails_root_templates
Loading

0 comments on commit 990319d

Please sign in to comment.