grasph / wrapit

Automatization of C++--Julia wrapper generation
MIT License
98 stars 12 forks source link

add `lib_prefix` option #26

Closed t-bltg closed 8 months ago

t-bltg commented 1 year ago

Fix https://github.com/grasph/wrapit/issues/18.

To recover the old behavior, use lib_prefix = "" in the config file.

With this fix, we can remove sourcing the setup.sh files in the tests (and replace JULIA_LOAD_PATH by a regular julian include statement include("<generated_julia_module>.jl")), so we could remove them from the repository and also remove the invocation from the Makefiles, thus simplifying the tests.

To illustrate my point, here is a single test diff:

diff --git a/test/TestAccessAndDelete/Makefile b/test/TestAccessAndDelete/Makefile
index 411f053..a71fb1e 100644
--- a/test/TestAccessAndDelete/Makefile
+++ b/test/TestAccessAndDelete/Makefile
@@ -40,7 +40,7 @@ echo_%:
         @echo $*=$($*)

 test:
-       $(MAKE) all && . ./setup.sh && julia run$(MODULE_NAME).jl
+       $(MAKE) all && julia run$(MODULE_NAME).jl

 -include $(addsuffix .d, $(basename $(CC_FILES)))
diff --git a/test/TestAccessAndDelete/runTestAccessAndDelete.jl b/test/TestAccessAndDelete/runTestAccessAndDelete.jl
index 2668679..108a9aa 100644
--- a/test/TestAccessAndDelete/runTestAccessAndDelete.jl
+++ b/test/TestAccessAndDelete/runTestAccessAndDelete.jl
@@ -1,4 +1,5 @@
-using TestAccessAndDelete
+include("TestAccessAndDelete.jl")
+using .TestAccessAndDelete
 using Test

 @testset "Access and deleted method test" begin
diff --git a/test/TestAccessAndDelete/setup.sh b/test/TestAccessAndDelete/setup.sh
deleted file mode 100644
index 829dbb7..0000000
--- a/test/TestAccessAndDelete/setup.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-export JULIA_LOAD_PATH="@:@v#.#:@stdlib:`pwd`"
-export LD_LIBRARY_PATH="`pwd`"
-
grasph commented 8 months ago

See https://github.com/grasph/wrapit/issues/18#issuecomment-1466431452 on rationale to not include the feature.