Easy file-tests macros
See original GitHub issueSome ideas for easier writing tests. Currently people do stuff like
- test -f $PREFIX/include/mamba/test.hpp # [unix]
- if not %LIBRARY_PREFIX%\include\mamba\test.hpp exit 1 # [win]
which is super error prone and hard to get right.
Ideas for “files” macros:
site-packages("mamba")
-> checks that pythonX.X/site-packages/<mamba> exists and has contents (at least one init.py)pymodule("mamba")
-> checks that pythonX.X/site-packages/<mamba> exists and has contents (at least one init.py)lib("libmamba", soversion="...")
-> check that at leastlibmamba.so
/libamamba.dylib
is found inlib/
, additionally check for so-versions that link to that, or for windows, check thatbin/libmamba.dll
andlib/libmamba.lib
are thereinclude("mamba")
-> check that include folderinclude/mamba/
existsinclude("mamba/test.hpp") -> check that file
include/mamba/test.hpp` exists in package- `bin(“mamba”)
I am unsure about the following ones:
cmake_find("mamba")
-> make sure that find_package(“mamba”) would workpkgconfig("mamba")
-> make sure that pkgconfig mamba works
There are probably some good ideas to support other languages and their install prefixes. I don’t know where R installs to?!
We can also use qualifiers to disallow any files outside those matched by the macros, except maybe files in /share
or some other data-centric directory. That would give pretty strict control over the package content.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Simply Macros - Moxie by Lindsey
The ingredient list is broken down into four categories: carbs, protein, fat, and FLAVOR! And each recipe is complete with tips, tricks, and...
Read more >Nine Rules for Creating Procedural Macros in Rust
While creating anyinput , I learned nine rules that can help you easily create procedure macros in Rust. The rules are:.
Read more >Read a file and store its contents in a variable - TeX
I'm not sure what the right way to do this with the LaTeX macros like \IfFileExists , but using the low-level TeX primitives...
Read more >Laravel Tip: 5 examples of why you should be using Macros
Then in the new macro file tests/macros.php file we can add the following. Now we can use it our tests. It's a very...
Read more >Load macro with TWIG - php - Stack Overflow
I installed TWIG in my project but I can't load my macro, I would like to create a file tests (For example testmacro.twig)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We probably want to express this as something like
This has the nice advantage that we can include it easily in our json schema and get completions / validations at the json schema level for correctness of the specifiction
One other lint we could do when we have a more semantic way of testing for a shared library is to automatically strongly warn if there is no run-exports.