ThrowTheSwitch / CMock

CMock - Mock/stub generator for C
http://throwtheswitch.org
MIT License
684 stars 276 forks source link

Psych::BadAlias: Unknown alias: unit_tests_path #394

Closed PiKa20 closed 8 months ago

PiKa20 commented 2 years ago

hi I use CMock in Windows. And I executed the following command

cd cmock
bundle install # Ensures you have all RubyGems needed
cd ./examples/temp_sensor
rake all

But, this prompt appears

E:\git\cicd\cmock\test>rake
E:\git\cicd\cmock\examples\temp_sensor>rake all
rake aborted!
Psych::BadAlias: Unknown alias: unit_tests_path
E:/git/cicd/cmock/examples/temp_sensor/rakefile_helper.rb:14:in `load_configuration'
E:/git/cicd/cmock/examples/temp_sensor/rakefile_helper.rb:24:in `configure_toolchain'
E:/git/cicd/cmock/examples/temp_sensor/rakefile.rb:17:in `<top (required)>'
(See full trace by running task with --trace)

I'm not sure what causes this problem.

I tried to execute it in the cmock/test directory and had similar problems.

E:\git\cicd\cmock\test>rake
rake aborted!
Psych::BadAlias: Unknown alias: systest_generated_path
E:/git/cicd/cmock/test/rakefile_helper.rb:24:in `load_configuration'
E:/git/cicd/cmock/test/rakefile_helper.rb:34:in `configure_toolchain'
E:/git/cicd/cmock/test/rakefile:32:in `<top (required)>'
(See full trace by running task with --trace)
mvandervoord commented 2 years ago

interesting. can you execute the following and post the contents here? I'm curious if there's a change in the latest yaml code or something:

ruby --version
gem list

Because it's the alias it's not liking, you could try changing a couple lines in gcc.yml. The first is the declaration of the alias:

unit_tests_path: &unit_tests_path 'test/'

could just become

unit_tests_path: 'test/'

and then where the alias is used in includes and items:

- *unit_tests_path

could become

- test/

Very likely you'd have to do the same with &build_path and *build_path.

I don't know why those would have problems, but it'd be interesting to know if they did.

Mark

PiKa20 commented 2 years ago

hi, I execute the following command

ruby --version
gem list

C:\Users\Administrator>ruby --version ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]

C:\Users\Administrator>gem list

LOCAL GEMS

abbrev (default: 0.1.0) base64 (default: 0.1.1) benchmark (default: 0.2.0) bigdecimal (default: 3.1.1) bundler (2.3.12) cgi (default: 0.3.1) constructor (2.0.0) csv (3.2.3, default: 3.2.2) date (default: 3.2.2) debug (1.4.0) delegate (default: 0.2.0) did_you_mean (default: 1.6.1) digest (default: 3.1.0) diy (1.1.2) drb (default: 2.1.0) english (default: 0.7.1) erb (default: 2.2.3) error_highlight (default: 0.3.0) etc (default: 1.3.0) fcntl (default: 1.0.1) fiddle (default: 1.1.0) fileutils (default: 1.6.0) find (default: 0.1.1) forwardable (default: 1.3.2) getoptlong (default: 0.1.1) io-console (default: 0.5.11) io-nonblock (default: 0.1.0) io-wait (default: 0.2.1) ipaddr (default: 1.2.4) irb (default: 1.4.1) json (default: 2.6.1) logger (1.5.1, default: 1.5.0) matrix (0.4.2) minitest (5.15.0) mutex_m (default: 0.1.1) net-ftp (0.1.3) net-http (default: 0.2.0) net-imap (0.2.3) net-pop (0.1.1) net-protocol (0.1.3, default: 0.1.2) net-smtp (0.3.1) nkf (default: 0.1.1) observer (default: 0.1.1) open-uri (default: 0.2.0) open3 (default: 0.1.1) openssl (default: 3.0.0) optparse (default: 0.2.0) ostruct (0.5.5, default: 0.5.2) pathname (default: 0.2.0) power_assert (2.0.1) pp (default: 0.3.0) prettyprint (default: 0.1.1) prime (0.1.2) pstore (default: 0.1.1) psych (default: 4.0.3) racc (default: 1.6.0) rake (13.0.6) rbs (2.1.0) rdoc (default: 6.4.0) readline (default: 0.0.3) reline (0.3.1, default: 0.3.0) require_all (3.0.0) resolv (default: 0.2.1) resolv-replace (default: 0.1.0) rexml (3.2.5) rinda (default: 0.1.1) rss (0.2.9) ruby2_keywords (default: 0.0.5) securerandom (0.2.0, default: 0.1.1) set (default: 1.0.2) shellwords (default: 0.1.0) singleton (default: 0.1.1) stringio (default: 3.0.1) strscan (default: 3.0.1) tempfile (default: 0.1.2) test-unit (3.5.3) time (default: 0.2.0) timeout (default: 0.2.0) tmpdir (default: 0.1.2) tsort (default: 0.1.0) typeprof (0.21.2) un (default: 0.2.0) uri (default: 0.11.0) weakref (default: 0.1.1) win32ole (default: 1.8.8) yaml (default: 0.2.0) zlib (default: 2.1.1)

PiKa20 commented 2 years ago

I modified gcc. yml as you said, now it can work, thank you!

mvandervoord commented 2 years ago

And thank you for posting the feedback! I'll try to dig into why that would have been failing.

PiKa20 commented 2 years ago

My guess is that there may be a problem with the installation package version.

gem "bundler"
gem "rake"
gem "minitest"
gem "require_all"
gem "constructor"
gem "diy"
thekyria commented 1 year ago

I feel this might be related. https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias