forked from kenkeiras/org-rw
Add testing Organice's testing files.
This commit is contained in:
parent
ffd82c2d76
commit
28a63a7e5e
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "extra-tests/organice"]
|
||||
path = extra-tests/organice
|
||||
url = https://github.com/200ok-ch/organice.git
|
12
extra-tests/check_all.sh
Normal file
12
extra-tests/check_all.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
# Get to the script's directory
|
||||
cd "`dirname $0`"
|
||||
|
||||
# Update the extra submodules
|
||||
git submodule update --init --recursive .
|
||||
|
||||
# Run all checks
|
||||
python3 org_dom_check.py .
|
27
extra-tests/org_dom_check.py
Normal file
27
extra-tests/org_dom_check.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import org_dom
|
||||
|
||||
top = sys.argv[1]
|
||||
count = 0
|
||||
|
||||
for root, dirs, files in os.walk(top):
|
||||
for name in files:
|
||||
if ".org" not in name:
|
||||
continue
|
||||
|
||||
path = os.path.join(root, name)
|
||||
count += 1
|
||||
try:
|
||||
org_dom.load(open(path), extra_cautious=True)
|
||||
except Exception as err:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
print(f"== On {path}")
|
||||
sys.exit(1)
|
||||
|
||||
print("[OK] Check passed on {} files".format(count))
|
1
extra-tests/organice
Submodule
1
extra-tests/organice
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 3c142203a6617253a1008e368af6971fc6f936a1
|
Loading…
Reference in New Issue
Block a user