-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Place scribbu types & functions in module
(scribbu)
, even
when defined in C. This commit will place the snarfed functions provided by libscribbu.so into module `(scribbu)` and updates `scribbu.scm` to load the extension.
- Loading branch information
Michael Herstine
committed
Sep 16, 2023
1 parent
e544648
commit 8720aa6
Showing
11 changed files
with
105 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
* | ||
*/ | ||
|
||
#include <boost/test/unit_test_suite.hpp> | ||
#include <scribbu/id3v2-utils.hh> | ||
|
||
#include "unit.hh" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
tmpfile=/tmp/test-scripting.scm | ||
scribbu_dir=`cd ../src; pwd` | ||
lib_dir=`cd ../scribbu; pwd` | ||
case `uname` in | ||
Linux) | ||
echo "#!${scribbu_dir}/scribbu \\" > $tmpfile;; | ||
Darwin) | ||
# Workaround for MacOS-- should be; for some reason I don't | ||
# understand (and don't care to debug), the `src/scribbu' | ||
# libtool script doesn't work well with the extended #! line | ||
# I use below. So, I call the MacOS binary directly, being careful | ||
# to set DYLD_LIBRARY_PATH (like the libtool script would) | ||
# so that we load the .so under test and not any previously installed | ||
# version. | ||
echo "#!${scribbu_dir}/.libs/scribbu \\" > $tmpfile; | ||
export DYLD_LIBRARY_PATH=$lib_dir/.libs:$DYLD_LIBRARY_PATH;; | ||
*) | ||
echo "Unknown system" 2>&1; | ||
exit 1;; | ||
esac | ||
|
||
cat >> $tmpfile<<EOF | ||
-e main -s | ||
!# | ||
;; Should fail | ||
(set! x (read-id3v1-tag "data/id3v1.2.3.tag")) | ||
EOF | ||
|
||
chmod a+x $tmpfile | ||
export GUILE_AUTO_COMPILE=0 | ||
cols=$(tput cols) | ||
export GUILE_LOAD_PATH=${srcdir}/../scheme | ||
|
||
eval "$($tmpfile \ | ||
2> >(t_err=$(cat); typeset -p t_err) \ | ||
> >(t_std=$(cat); typeset -p t_std) )" | ||
t_stat=$? | ||
t_err=$(echo "$t_err" | grep -vE ';;; note: source file /tmp/test-scripting.scm' | grep -v 'newer than compiled') | ||
if [ $t_stat -ne 0 ]; then | ||
>&2 echo "Non-zero exit code ($t_stat)." | ||
echo "stdout:" | ||
echo "$t_std" | ||
echo "stderr:" | ||
echo "$t_err" | ||
exit 1 | ||
fi | ||
|
||
if [ "${t_err}" !~ "Unbound variable: read-id3v1-tag" ]; then | ||
>&2 echo "Unexpected stderr" | ||
echo "stdout:" | ||
echo "$t_std" | ||
echo "stderr:" | ||
echo "$t_err" | ||
exit 1 | ||
fi |