[A] Added check for amalgamation script has been run

This commit is contained in:
seleznevae 2018-11-18 00:04:46 +03:00
parent a1ffd31ae3
commit a933b13d25
2 changed files with 12 additions and 1 deletions

View File

@ -87,6 +87,11 @@ matrix:
script: script:
# Check library file was generated
- python amalgamate.py -o dummy.c
- diff dummy.c lib/fort.c
- rm dummy.c
# make sure CC is correctly set # make sure CC is correctly set
- if [[ "${FORT_C_COMPILER}" != "" ]]; - if [[ "${FORT_C_COMPILER}" != "" ]];
then then
@ -186,3 +191,5 @@ script:

View File

@ -1,5 +1,6 @@
import os import os
import sys
def comment_line(line): def comment_line(line):
return "/* {} */ /* Commented by amalgamation script */".format(line) return "/* {} */ /* Commented by amalgamation script */".format(line)
@ -84,6 +85,9 @@ def is_c_source_file(file):
def main(): def main():
config = {} config = {}
if len(sys.argv) >= 3 and sys.argv[1] == "-o":
config["output_file"] = sys.argv[2]
else:
config["output_file"] = "./lib/fort.c" config["output_file"] = "./lib/fort.c"
config["src_dir"] = "./src" config["src_dir"] = "./src"
all_files = os.listdir(config["src_dir"]) all_files = os.listdir(config["src_dir"])