Tests on Freebsd

12 views
Skip to first unread message

Jose Quinteiro

unread,
Nov 10, 2021, 11:32:01 AM11/10/21
to tup-...@googlegroups.com
Hello,

I'm trying to get all the tests working on Freebsd. I'm currently using
symlink hacks to work around the fact that "gcc" is hard coded into a
lot of tests.

If I were to come up with a mega patch that introduced a "CC" variable
that could be set to clang or gcc, would it be considered?

Thanks,
Jose

Mike Shal

unread,
Nov 11, 2021, 7:11:08 AM11/11/21
to tup-...@googlegroups.com
Thanks for trying to get that working! Would it be easier to add some wrapper scripts to PATH? Or is that basically what your symlinks are?

Eg:
diff --git a/test/tup.sh b/test/tup.sh
index 6b56d900..d3a36ffc 100755
--- a/test/tup.sh
+++ b/test/tup.sh
@@ -29,11 +29,6 @@ tuptestdir="tuptesttmp-$testname"
 # avoid extra forks in win32
 : ${tupos:=`uname -s`}
 
-rm -rf $tuptestdir
-mkdir $tuptestdir
-cd $tuptestdir
-tup init --no-sync --force
-
 generate_script_name="build.sh"
 case $tupos in
 CYGWIN*)
@@ -42,8 +37,17 @@ CYGWIN*)
        in_windows=1
        generate_script_name="build.bat"
 ;;
+FreeBSD*)
+       PATH=$PWD/freebsd_wrappers:$PATH
+       export PATH
+;;
 esac
 
+rm -rf $tuptestdir
+mkdir $tuptestdir
+cd $tuptestdir
+tup init --no-sync --force
+
 # override any user settings for grep
 GREP_OPTIONS=""
 export GREP_OPTIONS


And in test/freebsd_wrappers/gcc:
clang "$@"

But if that or some other simple solution isn't feasible, I'd rather have working FreeBSD tests with the CC patch than non-working tests and keeping hard-coded gcc.

-Mike

Jose Quinteiro

unread,
Nov 11, 2021, 10:57:41 AM11/11/21
to tup-...@googlegroups.com
That looks /much/ better than what I was proposing. I'll give it a shot
and get back to you.

What I'm doing now is creating a link clang->gcc in a directory that's
in my PATH. Unfortunately that requires a link to /usr/lib in the parent
directory for reasons I don't understand.

Thanks,
Jose
Reply all
Reply to author
Forward
0 new messages