Skip to content

Commit

Permalink
Merge pull request #212 from mentebinaria/new_testfile
Browse files Browse the repository at this point in the history
Add new test executable
  • Loading branch information
GoGoOtaku committed Feb 1, 2024
2 parents 62de24d + 0015707 commit 4b88b9a
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ src/readpe
src/rva2ofs
src/peres
src/plugins/build/
tests/samples
tests/samples/*
!tests/samples/helloworld.exe
tests/*.exe
tests/*.bin
tests/*.log
Expand Down
Binary file added tests/samples/helloworld.exe
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/samples_src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is probably not standardized but WorksForMe
CC = x86_64-w64-mingw32-gcc
# Very generic test file
CFLAGS += -DNDEBUG -Oz -mtune=generic -march=x86-64 -s -Wl,-s -Wl,--gc-sections

all: helloworld.exe

.PHONY: all

helloworld: helloworld.c

%.exe: %
mv $@ ../samples/$@

43 changes: 43 additions & 0 deletions tests/samples_src/helloworld.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
pev - the PE file analyzer toolkit
helloworld.c - basic hello world program
Copyright (C) 2013 - 2020 pev authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the
OpenSSL library under certain conditions as described in each
individual source file, and distribute linked combinations
including the two.
You must obey the GNU General Public License in all respects
for all of the code used other than OpenSSL. If you modify
file(s) with this exception, you may extend this exception to your
version of the file(s), but you are not obligated to do so. If you
do not wish to do so, delete this exception statement from your
version. If you delete this exception statement from all source
files in the program, then also delete it here.
*/

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
printf("Hello World\n");
return EXIT_SUCCESS;
}

2 changes: 1 addition & 1 deletion tests/valgrind_pedis.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

prog="valgrind -q ../src/build/pedis"
samples=../support_files/samples/*
samples=../samples/*

n=0
err=0
Expand Down
2 changes: 1 addition & 1 deletion tests/valgrind_pepack.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

prog="valgrind -q ../src/build/pepack"
samples=../support_files/samples/*
samples=../samples/*

n=0
err=0
Expand Down
2 changes: 1 addition & 1 deletion tests/valgrind_pesec.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

prog="valgrind -q ../src/build/pesec"
samples=../support_files/samples/*
samples=../samples/*

n=0
err=0
Expand Down
2 changes: 1 addition & 1 deletion tests/valgrind_readpe.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

readpe="valgrind -q ../src/build/readpe"
samples=../support_files/samples/*
samples=../samples/*
opts_noarg='-A -H -d -i'
opts_arg[0]='-h dos'
opts_arg[1]='-h coff'
Expand Down

0 comments on commit 4b88b9a

Please sign in to comment.