From d4571501fb8737983aa45d3832e7394d64ad4089 Mon Sep 17 00:00:00 2001 From: Loic Jaquemet Date: Sat, 8 Aug 2015 09:56:42 -0600 Subject: [PATCH] debug travis-ci --- .travis.yml | 10 +++--- setup.py | 5 ++- test/src/Makefile.prep | 73 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 test/src/Makefile.prep diff --git a/.travis.yml b/.travis.yml index 4f6d940a..ba323265 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: # we need sudo, and we need to have installed haystack for root. install: ## install with requirements - - python setup.py install +# - python setup.py install ## or try the develop way to use the git tree - pip install -r requirements.txt --use-mirrors # - python setup.py develop @@ -59,10 +59,10 @@ before_script: - wget https://dl.dropboxusercontent.com/u/10222931/HAYSTACK/ssh.x64.6653.dump.tgz - tar zxf ssh.x64.6653.dump.tgz - mv ssh.x64.6653.dump test/dumps/ssh/ -# build memory tests. The Makefile will build a 32 bits and 64 bits version -# of simple C program, and dump their memory. -# You need root for memory dumps. -# FIXME: package the memory dump in the tgz +# build memory tests. +# just uncompress the tgz contained in the LFS. +# the preps tests does not build the binaries on travis-ci anymore. +# no need for root. No need for install haystack. - python setup.py preptests script: diff --git a/setup.py b/setup.py index a4c6eb5a..5c048fca 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,10 @@ def run(self): import os import sys os.getcwd() - makeCmd = ['make', '-d'] + # all dump files are in .tgz + #makeCmd = ['make', '-d'] + #p = subprocess.Popen(makeCmd, stdout=sys.stdout, cwd='test/src/') + makeCmd = ['make', '-f', 'Makefile.prep'] p = subprocess.Popen(makeCmd, stdout=sys.stdout, cwd='test/src/') p.wait() return p.returncode diff --git a/test/src/Makefile.prep b/test/src/Makefile.prep new file mode 100644 index 00000000..cd0f6ee8 --- /dev/null +++ b/test/src/Makefile.prep @@ -0,0 +1,73 @@ +#!/usr/bin/make -f + +LDFLAGS = -ldl +INCLS = + +# use the virtualenv python even in sudo +PYTHON=$(shell which python) + +USER=$(shell whoami) +G=$(shell groups) +GROUP=$(word 1, $(G)) + +EXTRA = + +CFLAGS = -O2 -g -Wall $(INCLS) $(EXTRA) +CPPFLAGS = -O2 -g -Wall -stdlib=libstdc++ -x c++ +CPPLIB = /usr/lib/gcc/i686-linux-gnu/4.8/ +CPPINCLUDE = /usr/include/i386-linux-gnu/c++/4.8/ +CC=clang +CXX=clang++ + +TGT32=i386-linux +TGT64=x86_64-linux + +pid= + +C2PY=clang2py + +SRCS := $(wildcard *.c *.cpp) +OBJS32x := $(patsubst %.c,%.32,$(SRCS)) +OBJS32 := $(patsubst %.cpp,%.32,$(OBJS32x)) +OBJS64 := $(patsubst %.32,%.64,$(OBJS32)) + +PY32 := $(patsubst test-%.32,%_gen32.py,$(OBJS32)) +PY64 := $(patsubst test-%.64,%_gen64.py,$(OBJS64)) + +DUMPS32 := $(patsubst %,%.dump,$(OBJS32)) +OUTLOGS32 := $(patsubst %,%.stdout,$(OBJS32)) +TGZ32 := $(patsubst %,%.dump.tgz,$(OBJS32)) +DUMPS64 := $(patsubst %,%.dump,$(OBJS64)) +OUTLOGS64 := $(patsubst %,%.stdout,$(OBJS64)) +TGZ64 := $(patsubst %,%.dump.tgz,$(OBJS64)) + +.PHONY: + + +all: py unpack + +unpack: $(DUMPS32) $(DUMPS64) + +py: $(PY32) $(PY64) + +%_gen32.py: test-%.c + $(C2PY) -k dstu -x $< -o $@ --target $(TGT32) + +%_gen32.py: test-%.cpp + $(C2PY) -k dstu -x $< -o $@ --target $(TGT32) + +%_gen64.py: test-%.c + $(C2PY) -k dstu -x $< -o $@ --target $(TGT64) + +%_gen64.py: test-%.cpp + $(C2PY) -k dstu -x $< -o $@ --target $(TGT64) + +%.dump: %.dump.tgz + tar zxf $< + +clean: + rm -f $(PY32) $(PY64) + rm -rf $(DUMPS32) $(DUMPS64) + rm -f *~ *.pyc + +