mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Replace unmangle with cygpath (#1490)
Use `-m` not `-w` so paths use forward slashes
This commit is contained in:
@@ -2,18 +2,12 @@
|
||||
|
||||
add_executable(randtilegen gfx/randtilegen.cpp)
|
||||
add_executable(rgbgfx_test gfx/rgbgfx_test.cpp)
|
||||
add_executable(unmangle link/unmangle.cpp)
|
||||
|
||||
install(TARGETS randtilegen rgbgfx_test
|
||||
DESTINATION ${rgbds_SOURCE_DIR}/test/gfx
|
||||
COMPONENT "Test support programs"
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
install(TARGETS unmangle
|
||||
DESTINATION ${rgbds_SOURCE_DIR}/test/link
|
||||
COMPONENT "Test support programs"
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
foreach(TARGET randtilegen rgbgfx_test)
|
||||
if(LIBPNG_FOUND) # pkg-config
|
||||
|
||||
2
test/link/.gitignore
vendored
2
test/link/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
# Test binaries
|
||||
/unmangle
|
||||
@@ -3,8 +3,6 @@
|
||||
export LC_ALL=C
|
||||
set -o pipefail
|
||||
|
||||
[[ -e ./unmangle ]] || make -C ../.. test/link/unmangle || exit
|
||||
|
||||
otemp="$(mktemp)"
|
||||
gbtemp="$(mktemp)"
|
||||
gbtemp2="$(mktemp)"
|
||||
@@ -88,13 +86,14 @@ evaluateTest () {
|
||||
}
|
||||
|
||||
substPath () {
|
||||
# Escape regex metacharacters
|
||||
# Replace the file name with a different one to match changed output, escaping regex metacharacters
|
||||
subst="$(printf '%s\n' "$1" | sed 's:[][\/.^$*]:\\&:g')"
|
||||
# Replace the file name with a different one to match changed output
|
||||
sed -i'' -e "s|$subst|$2|g" "$3"
|
||||
# Escape regex metacharacters in the un-MinGW-mangled path
|
||||
subst="$(./unmangle "$1" | sed 's:[][\/.^$*]:\\&:g')"
|
||||
sed -i'' -e "s|$subst|$2|g" "$3"
|
||||
if which cygpath &>/dev/null; then
|
||||
# Replace the MinGW path with a Windows path, escaping regex metacharacters
|
||||
subst="$(cygpath -m "$1" | sed 's:[][\/.^$*]:\\&:g')"
|
||||
sed -i'' -e "s|$subst|$2|g" "$3"
|
||||
fi
|
||||
}
|
||||
|
||||
for i in *.asm; do
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
* MinGW mangles path names before passing them as command-line arguments.
|
||||
* Some RGBLINK warning/error messages include those mangled paths on Windows.
|
||||
* We need to see those mangled paths in test.sh to replace them with placeholders.
|
||||
* This tool simply echoes each argument, which will be mangled iff they are paths.
|
||||
* (For example, the "/tmp/foo" will be unmangled to something like
|
||||
* "C:/Users/RUNNER~1/AppData/Local/Temp/foo".)
|
||||
*/
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
for (int i = 1; i < argc; i++)
|
||||
puts(argv[i]);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user