aboutsummaryrefslogtreecommitdiff
path: root/spec/build_spec.lua
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-19 11:55:39 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-19 16:35:00 -0300
commitc13ff298bdd424d7b7401fce4f0379cda0348af8 (patch)
tree9cc8551a3c23ae09020bb135c202aa34029d150d /spec/build_spec.lua
parent50ebdd5d17c8390d30132c165d2e0a614dc0ecae (diff)
downloadluarocks-c13ff298bdd424d7b7401fce4f0379cda0348af8.tar.gz
luarocks-c13ff298bdd424d7b7401fce4f0379cda0348af8.tar.bz2
luarocks-c13ff298bdd424d7b7401fce4f0379cda0348af8.zip
fix(build): don't look for Lua headers when installing pure-Lua rocks
This only applies to 'builtin' as we can't know about other modes, but this should be good enough. Fixes #1275.
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r--spec/build_spec.lua117
1 files changed, 0 insertions, 117 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 653f2160..3b33a1aa 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -598,123 +598,6 @@ describe("LuaRocks build #unit", function()
598 end, finally) 598 end, finally)
599 end) 599 end)
600 600
601 describe("builtin.autodetect_external_dependencies", function()
602 it("returns false if the given build table has no external dependencies", function()
603 local build_table = {
604 type = "builtin"
605 }
606
607 assert.falsy(build_builtin.autodetect_external_dependencies(build_table))
608 end)
609
610 it("returns a table of the external dependencies found in the given build table", function()
611 local build_table = {
612 type = "builtin",
613 modules = {
614 module1 = {
615 libraries = { "foo1", "foo2" },
616 },
617 module2 = {
618 libraries = "foo3"
619 },
620 }
621 }
622
623 local extdeps = build_builtin.autodetect_external_dependencies(build_table)
624 assert.same(extdeps["FOO1"], { library = "foo1" })
625 assert.same(extdeps["FOO2"], { library = "foo2" })
626 assert.same(extdeps["FOO3"], { library = "foo3" })
627 end)
628
629 it("adds proper include and library dirs to the given build table", function()
630 local build_table
631
632 build_table = {
633 type = "builtin",
634 modules = {
635 module1 = {
636 libraries = "foo"
637 }
638 }
639 }
640 build_builtin.autodetect_external_dependencies(build_table)
641 assert.same(build_table, {
642 type = "builtin",
643 modules = {
644 module1 = {
645 libraries = "foo",
646 incdirs = { "$(FOO_INCDIR)" },
647 libdirs = { "$(FOO_LIBDIR)" }
648 }
649 }
650 })
651
652 build_table = {
653 type = "builtin",
654 modules = {
655 module1 = {
656 libraries = "foo",
657 incdirs = { "INCDIRS" }
658 }
659 }
660 }
661 build_builtin.autodetect_external_dependencies(build_table)
662 assert.same(build_table, {
663 type = "builtin",
664 modules = {
665 module1 = {
666 libraries = "foo",
667 incdirs = { "INCDIRS" },
668 libdirs = { "$(FOO_LIBDIR)" }
669 }
670 }
671 })
672
673 build_table = {
674 type = "builtin",
675 modules = {
676 module1 = {
677 libraries = "foo",
678 libdirs = { "LIBDIRS" }
679 }
680 }
681 }
682 build_builtin.autodetect_external_dependencies(build_table)
683 assert.same(build_table, {
684 type = "builtin",
685 modules = {
686 module1 = {
687 libraries = "foo",
688 incdirs = { "$(FOO_INCDIR)" },
689 libdirs = { "LIBDIRS" }
690 }
691 }
692 })
693
694 build_table = {
695 type = "builtin",
696 modules = {
697 module1 = {
698 libraries = "foo",
699 incdirs = { "INCDIRS" },
700 libdirs = { "LIBDIRS" }
701 }
702 }
703 }
704 build_builtin.autodetect_external_dependencies(build_table)
705 assert.same(build_table, {
706 type = "builtin",
707 modules = {
708 module1 = {
709 libraries = "foo",
710 incdirs = { "INCDIRS" },
711 libdirs = { "LIBDIRS" }
712 }
713 }
714 })
715 end)
716 end)
717
718 describe("builtin.autodetect_modules", function() 601 describe("builtin.autodetect_modules", function()
719 local tmpdir 602 local tmpdir
720 local olddir 603 local olddir