<commit_before>Patch by MSP-Greg
allows running tests from standard ruby install
diff --git a/test/mkmf/base.rb b/test/mkmf/base.rb
index 80dec1421a..b4b5555f4e 100644
--- a/test/mkmf/base.rb
+++ b/test/mkmf/base.rb
@@ -1,14 +1,20 @@
 # frozen_string_literal: false
-$extmk = true
 require 'rbconfig'
-RbConfig.fire_update!("top_srcdir", File.expand_path("../..", __dir__))
-File.foreach(RbConfig::CONFIG["topdir"]+"/Makefile") do |line|
-  if /^CC_WRAPPER\s*=\s*/ =~ line
-    RbConfig.fire_update!('CC_WRAPPER', $'.strip)
-    break
+
+# below is test for whether running from make or not
+if RbConfig::TOPDIR == File.dirname(RbConfig.method(:fire_update!).source_location[0])
+  $extmk = true
+  RbConfig.fire_update!("top_srcdir", File.expand_path("../..", __dir__))
+  File.foreach(RbConfig::CONFIG["topdir"]+"/Makefile") do |line|
+    if /^CC_WRAPPER\s*=\s*/ =~ line
+      RbConfig.fire_update!('CC_WRAPPER', $'.strip)
+      break
+    end
   end
+else
+  $extmk = false
 end
-
+  
 require 'test/unit'
 require 'mkmf'
 require 'tmpdir'<commit_msg>mkmf-base_from_install.patch - fix for parallel test errors<commit_after>Patch by MSP-Greg
allows running tests from standard ruby install
diff --git a/test/mkmf/base.rb b/test/mkmf/base.rb
index 4f67478a56..b88b7c2bed 100644
--- a/test/mkmf/base.rb
+++ b/test/mkmf/base.rb
@@ -1,12 +1,18 @@
 # frozen_string_literal: false
-$extmk = true
 require 'rbconfig'
-RbConfig.fire_update!("top_srcdir", File.expand_path("../..", __dir__))
-File.foreach(RbConfig::CONFIG["topdir"]+"/Makefile") do |line|
-  if /^CC_WRAPPER\s*=\s*/ =~ line
-    RbConfig.fire_update!('CC_WRAPPER', $'.strip)
-    break
+
+# below is test for whether running from make or not
+if RbConfig::TOPDIR == File.dirname(RbConfig.method(:fire_update!).source_location[0])
+  $extmk = true
+  RbConfig.fire_update!("top_srcdir", File.expand_path("../..", __dir__))
+  File.foreach(RbConfig::CONFIG["topdir"]+"/Makefile") do |line|
+    if /^CC_WRAPPER\s*=\s*/ =~ line
+      RbConfig.fire_update!('CC_WRAPPER', $'.strip)
+      break
+    end
   end
+else
+  $extmk = false
 end
 
 require 'test/unit'
@@ -19,6 +25,14 @@
 $INCFLAGS << " -I."
 $extout_prefix = "$(extout)$(target_prefix)/"
 
+# when running tests parallel, may see "You have to install development tools first."
+if RUBY_PLATFORM.include? 'mingw'
+  begin
+    require 'devkit'
+  rescue LoadError
+  end
+end
+
 class TestMkmf < Test::Unit::TestCase
 end
 
{'fraction_non_alphanumeric': 0.1804418985270049, 'fraction_numerical': 0.023322422258592473, 'mean_word_length': 4.09375, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5819115', 'n_tokens_mistral': 1003, 'n_tokens_neox': 949, 'n_words': 189}