Enable R2R in C for all CI except Windows (#16354) ##test

This commit is contained in:
Florian Märkl 2020-04-01 23:16:02 +02:00 committed by GitHub
parent c4b62fa1c1
commit 91c58506e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 56 additions and 37 deletions

View File

@ -5,12 +5,14 @@ packages:
- devel/gmake
- devel/llvm
- ftp/wget
- lang/python
environment:
CXX: clang++
CC: clang
HOST_CC: clang
sources:
- https://github.com/radareorg/radare2
- https://github.com/radareorg/radare2-testbins
tasks:
- build: |
cd radare2
@ -18,9 +20,18 @@ tasks:
gmake
- install: |
cd radare2
export PATH=${HOME}/install/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/install/lib:${HOME}/install/lib64:${LD_LIBRARY_PATH}
export PATH=${HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/lib:${HOME}/lib64:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
gmake install
# Running the new V suite
r2r -L
- test: |
cd radare2
export PATH=${HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/lib:${HOME}/lib64:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
# Workaround until the feature request is solved
# https://todo.sr.ht/~sircmpwn/builds.sr.ht/274
ln -s ${HOME}/radare2-testbins test/bins
# Running the test suite
cd test && gmake -k all

View File

@ -4,11 +4,13 @@ packages:
- devel/pkgconf
- devel/gmake
- devel/llvm
- lang/python
environment:
CXX: clang++
CC: clang
sources:
- https://github.com/radareorg/radare2
- https://github.com/radareorg/radare2-testbins
tasks:
- build: |
cd radare2
@ -16,9 +18,21 @@ tasks:
gmake
- install: |
cd radare2
export PATH=${HOME}/install/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/install/lib:${HOME}/install/lib64:${LD_LIBRARY_PATH}
export PATH=${HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/lib:${HOME}/lib64:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
gmake install
# Running the new V suite
r2r -L
- test: |
cd radare2
export PATH=${HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/lib:${HOME}/lib64:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
# OpenBSD does not have a "python" command by default
# but a test needs it.
ln -s /usr/local/bin/python3 ${HOME}/bin/python
# Workaround until the feature request is solved
# https://todo.sr.ht/~sircmpwn/builds.sr.ht/274
ln -s ${HOME}/radare2-testbins test/bins
# Running the test suite
cd test && gmake -k all

View File

@ -21,6 +21,11 @@ jobs:
- name: Install pkg-config with Homebrew
if: matrix.os == 'macos-latest'
run: brew install pkg-config
- name: Checkout our Testsuite Binaries
uses: actions/checkout@v2
with:
repository: radareorg/radare2-testbins
path: test/bins
- name: Configure with ACR
run: ./configure --prefix=${HOME}
- name: Build
@ -28,10 +33,10 @@ jobs:
- name: Install and run tests
run: |
# Install the radare2
export PATH=${HOME}/install/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/install/lib:${HOME}/install/lib64:${LD_LIBRARY_PATH}
export PATH=${HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/lib:${HOME}/lib64:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
make install
# Running the new C suite
# r2r -L
# Running the test suite
cd test && make

View File

@ -816,6 +816,7 @@ err_r_file_mmap_write:
return -1;
}
memcpy (mmap_buf+rest, buf, len);
msync (mmap_buf+rest, len, MS_INVALIDATE);
munmap (mmap_buf, mmlen*2);
close (fd);
return len;

View File

@ -785,30 +785,7 @@ R_API int r_sys_cmd(const char *str) {
if (r_sandbox_enable (0)) {
return false;
}
#if __FreeBSD__
/* freebsd system() is broken */
int st, pid, fds[2];
if (pipe (fds)) {
return -1;
}
pid = vfork ();
if (pid == -1) {
return -1;
}
if (!pid) {
dup2 (1, fds[1]);
// char *argv[] = { "/bin/sh", "-c", str, NULL};
// execv (argv[0], argv);
r_sandbox_system (str, 0);
_exit (127); /* error */
} else {
dup2 (1, fds[0]);
waitpid (pid, &st, 0);
}
return WEXITSTATUS (st);
#else
return r_sandbox_system (str, 1);
#endif
}
R_API char *r_sys_cmd_str(const char *cmd, const char *input, int *len) {

View File

@ -1,7 +1,7 @@
R2R=$(shell cd new ; npm bin)/r2r
RUNTEST=cd new && npm install ; $(R2R)
all: js-tests unit_tests
all: r2r-tests unit_tests
bins:
git clone --depth 1 https://github.com/radareorg/radare2-testbins bins
@ -9,7 +9,14 @@ bins:
fuzz/targets:
git clone --depth 1 https://github.com/radareorg/radare2-fuzztargets fuzz/targets
R2R_JS=$(shell cd new ; npm bin)/r2r
js-tests: bins
cd new && npm install ; $(R2R_JS)
RUNTEST=cd new && r2r -L
r2r-tests: bins
${RUNTEST}
keystone: bins

View File

@ -1445,6 +1445,7 @@ RUN
NAME=iD
FILE=../bins/elf/libmagic.so
BROKEN=1
EXPECT=<<EOF
Swift.String.init (_builtinStringLiteral(Builtin.RawPointer byteSize__Builtin.Word isASCII__Builtin.Int1 _) -> String
EOF

View File

@ -8,6 +8,7 @@ RUN
NAME=elf swift demangle (requires swift-demangle program)
FILE=../bins/elf/analysis/hello-swift
BROKEN=1
EXPECT=<<EOF
0x004009e0 16 Swift.String.init (_builtinStringLiteral(Builtin.RawPointer byteSize__Builtin.Word isASCII__Builtin.Int1 _) -> String
EOF

View File

@ -834,6 +834,7 @@ EOF
RUN
NAME=rabin2 -D swift
BROKEN=1
FILE=../bins/elf/libc.so.0
CMDS=!rabin2 -D swift _TFSSCfT21_builtinStringLiteralBp8byteSizeBw7isASCIIBi1__SS
EXPECT=<<EOF

View File

@ -104,6 +104,7 @@ RUN
NAME=rasm2 #1167 3
FILE=-
BROKEN=1
CMDS=!rasm2 -s att -a x86.as -b 64 "test %rbx, %rax"
EXPECT=<<EOF
4885d8
@ -112,6 +113,7 @@ RUN
NAME=rasm2 #1167 4
FILE=-
BROKEN=1
CMDS=!rasm2 -s intel -a x86.as -b 64 "test rax, rbx"
EXPECT=<<EOF
4885d8

View File

@ -95,7 +95,6 @@ else
fi
if [ "${R2_TESTS_DISABLE}" != "1" ] ; then
export NOOK=1
export NOREPORT=1
cd test
VERBOSE=1 make -k all || exit 1