mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests: test_bloom: fix PROJDEPS concurrency
Our buildtests build one project concurrently for multiple boards. The current creation of the `PROJDEPS` for `test_bloom` might fail if * board `A` notices that the dependency is missing and gets preempted, * board `B` creates the dependency and gets preempted, * board `A` starts the creation but gets preempted in the middle of the process, * board `B` works with a half complete created file. This PR creates the dependency in the individual `BINDIR`.
This commit is contained in:
parent
4142d87bbe
commit
20163e1452
1
tests/test_bloom/.gitignore
vendored
1
tests/test_bloom/.gitignore
vendored
@ -1 +0,0 @@
|
||||
sets.h
|
@ -7,11 +7,14 @@ BOARD_INSUFFICIENT_RAM := chronos mbed_lpc1768 msb-430 msb-430h redbee-econotag
|
||||
USEMODULE += hashes
|
||||
USEMODULE += bloom
|
||||
|
||||
export PROJDEPS = sets.h
|
||||
PROJDEPS = $(BINDIR)projdeps/sets.h
|
||||
|
||||
INCLUDES += -I$(BINDIR)projdeps
|
||||
|
||||
DISABLE_MODULE += auto_init
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
sets.h: generate_sets.py words.txt.gz
|
||||
./generate_sets.py 10000 20
|
||||
$(BINDIR)projdeps/sets.h: generate_sets.py words.txt.gz
|
||||
mkdir -p ${@D}
|
||||
./generate_sets.py words.txt.gz $@
|
||||
|
@ -8,12 +8,12 @@ sizeOfA = 10 * 1000
|
||||
sizeOfB = 20
|
||||
|
||||
print sys.argv
|
||||
if len(sys.argv) == 3:
|
||||
sizeOfA = int(sys.argv[1])
|
||||
sizeOfB = int(sys.argv[2])
|
||||
if len(sys.argv) == 5:
|
||||
sizeOfA = int(sys.argv[3])
|
||||
sizeOfB = int(sys.argv[4])
|
||||
|
||||
# read all words
|
||||
lines = [line.strip() for line in gzip.open('words.txt.gz')]
|
||||
lines = [line.strip() for line in gzip.open(sys.argv[1])]
|
||||
|
||||
# get A lines
|
||||
A = random.sample(lines, sizeOfA + sizeOfB)
|
||||
@ -22,8 +22,7 @@ A = random.sample(lines, sizeOfA + sizeOfB)
|
||||
B = A[:sizeOfB]
|
||||
A = A[sizeOfB:]
|
||||
|
||||
|
||||
SetsFile = open('sets.h', 'w')
|
||||
SetsFile = open(sys.argv[2], 'w')
|
||||
SetsFile.write('const int lenA = ' + str(sizeOfA) + ';\n')
|
||||
SetsFile.write('const char* A[' + str(sizeOfA) + '] = {')
|
||||
SetsFile.writelines(",".join('"' + x + '"\n' for x in A))
|
||||
@ -34,5 +33,4 @@ SetsFile.write('const char* B[' + str(sizeOfB) + '] = {')
|
||||
SetsFile.writelines(",".join('"' + x + '"\n' for x in B))
|
||||
SetsFile.write('};\n')
|
||||
|
||||
|
||||
print("sets.h: sizeOfA = " + str(len(A) + len(B)) + " generated...")
|
||||
|
Loading…
Reference in New Issue
Block a user