stevenkw
2020-9-15 07:10:58

@stevenkw has joined the channel


spdegabrielle
2020-9-15 11:56:51

Is it ok to subvert raco test by including (module test racket/base) in my code?https://github.com/nixin72/from-template/blob/master/main.rkt


spdegabrielle
2020-9-15 11:59:04

I should have a test but I can’t think of one right now. [...] raco setup: --- post-installing collections --- [3:32:43] raco test: "/home/root//user/.racket/7.8/pkgs/from-template/info.rkt" raco test: "/home/root//user/.racket/7.8/pkgs/from-template/main.rkt" main.rkt: raco test: non-empty stderr: #"Need to supply a name of a template. Checkout <https://github.com/racket-templates> for a list of available templates.\n context...:\n \"/home/root/user/.racket/7.8/pkgs/from-template/main.rkt\": [running body]\n temp35_0\n for-loop\n run-module-instance!\n (submod \"/home/root/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt\" process): [running body]\n temp35_0\n for-loop\n run-module-instance!\n eval-one-top\n" raco test: "/home/root//user/.racket/7.8/pkgs/from-template/scribblings/from-template.scrbl" 1/1 test failures 0 /home/root//user/.racket/7.8/pkgs/from-template/info.rkt 0 /home/root//user/.racket/7.8/pkgs/from-template/scribblings/from-template.scrbl 1 1 /home/root//user/.racket/7.8/pkgs/from-template/main.rkt The time is now Friday, September 11th, 2020 3:32:45am

https://pkg-build.racket-lang.org/server/built/test-fail/from-template.txt


mflatt
2020-9-15 12:08:52

Yes, (module test racket/base) seems like the right choice.


spdegabrielle
2020-9-15 12:09:54

ta. I need to make a test that ensures it doesn’t overwrite any user data, but that can wait. :slightly_smiling_face:


abmclin
2020-9-15 14:11:52

it’s documented in section 13.2 of https://docs.racket-lang.org/raco/test.html?q=raco%20test but it’s hard to find since it’s only a short phrase in the first paragraph. I’ve used the same approach to prevent raco test from running a module.

Also it looks like it’s possible to add to test-omit-paths in an info.rkt file in your collection package if that option works better for you.


notjack
2020-9-15 18:48:38

moving code you don’t want to run into a main submodule would be preferable to an empty test submodule IMO, assuming it makes sense for your use case


notjack
2020-9-15 18:49:20

(case where it makes sense: a script / launcher program)


notjack
2020-9-15 18:49:44

(case where it doesn’t: trying to avoid loading GUI libraries)


hj93
2020-9-15 23:36:49

@hj93 has joined the channel


robots-racket-slack
2020-9-16 03:46:21

@robots-racket-slack has joined the channel