forked from criblio/appscope
-
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.
- add minimial nsterm example which reflects the issue with `top` Ref: criblio#1567
- Loading branch information
1 parent
25f900a
commit 850da8f
Showing
4 changed files
with
106 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM fedora:39 | ||
|
||
RUN dnf update -y && dnf install -y \ | ||
gcc \ | ||
ncurses-devel \ | ||
&& dnf clean all | ||
|
||
ENV PATH="/usr/local/scope:/usr/local/scope/bin:${PATH}" | ||
COPY scope-profile.sh /etc/profile.d/scope.sh | ||
COPY gdbinit /root/.gdbinit | ||
|
||
RUN mkdir /opt/test | ||
COPY ./fedora/nsterm.c /opt/test/nsterm.c | ||
RUN gcc -g -o /opt/test/nsterm /opt/test/nsterm.c -lncurses | ||
|
||
RUN mkdir /usr/local/scope && \ | ||
mkdir /usr/local/scope/bin && \ | ||
mkdir /usr/local/scope/lib && \ | ||
mkdir -p /opt/test-runner/logs/ && \ | ||
ln -s /opt/appscope/bin/linux/$(uname -m)/scope /usr/local/scope/bin/scope && \ | ||
ln -s /opt/appscope/lib/linux/$(uname -m)/libscope.so /usr/local/scope/lib/libscope.so | ||
|
||
COPY fedora/scope-test /usr/local/scope/scope-test | ||
|
||
COPY docker-entrypoint.sh / | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["test"] |
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,12 @@ | ||
#define _GNU_SOURCE | ||
#include <curses.h> | ||
#include <term.h> | ||
|
||
int | ||
main(int argc, char *argv[]) | ||
{ | ||
int res = setupterm((char *)0, 1, (int *)0); | ||
|
||
printf("setupterm res %d\n", res); | ||
return 0; | ||
} |
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,58 @@ | ||
#! /bin/bash | ||
DEBUG=0 # set this to 1 to capture the EVT_FILE for each test | ||
|
||
FAILED_TEST_LIST="" | ||
FAILED_TEST_COUNT=0 | ||
|
||
starttest(){ | ||
CURRENT_TEST=$1 | ||
echo "===============================================" | ||
echo " Testing $CURRENT_TEST " | ||
echo "===============================================" | ||
ERR=0 | ||
} | ||
|
||
evaltest(){ | ||
echo " Evaluating $CURRENT_TEST" | ||
} | ||
|
||
endtest(){ | ||
if [ $ERR -eq "0" ]; then | ||
RESULT=PASSED | ||
else | ||
RESULT=FAILED | ||
FAILED_TEST_LIST+=$CURRENT_TEST | ||
FAILED_TEST_LIST+=" " | ||
FAILED_TEST_COUNT=$(($FAILED_TEST_COUNT + 1)) | ||
fi | ||
|
||
echo "*************** $CURRENT_TEST $RESULT ***************" | ||
echo "" | ||
echo "" | ||
} | ||
|
||
|
||
starttest nsterm_test | ||
|
||
cd /opt/test/ | ||
scope run -- ./nsterm | ||
if [ $? -ne 0 ]; then | ||
ERR+=1 | ||
fi | ||
|
||
endtest | ||
|
||
if (( $FAILED_TEST_COUNT == 0 )); then | ||
echo "" | ||
echo "" | ||
echo "*************** ALL TESTS PASSED ***************" | ||
else | ||
echo "*************** SOME TESTS FAILED ***************" | ||
echo "Failed tests: $FAILED_TEST_LIST" | ||
echo "Refer to these files for more info:" | ||
for FAILED_TEST in $FAILED_TEST_LIST; do | ||
echo " $EVT_FILE.$FAILED_TEST" | ||
done | ||
fi | ||
|
||
exit ${FAILED_TEST_COUNT} |