Skip to content

Commit

Permalink
remove the files (crashes AppVeyor), port bash generation script to p…
Browse files Browse the repository at this point in the history
…ython
  • Loading branch information
Aurel300 committed May 2, 2019
1 parent b3796c8 commit 9b12833
Show file tree
Hide file tree
Showing 228 changed files with 74 additions and 637 deletions.
73 changes: 73 additions & 0 deletions tests/sys/genTestRes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env python3

# Generates files and directories in test-res used for Unicode sys tests.
# The test vector printf'ed into data.bin, as well as the names in filenames()
# should correspond exactly to the sequences in UnicodeSequences.valid.

import os
import shutil

TESTDIR = "test-res"

# delete previous, if any
if os.path.isdir(TESTDIR):
shutil.rmtree(TESTDIR)

os.mkdir(TESTDIR)

# Unicode test vectors
allUnicode = [
[0x01],
[0x7F],
[0xC2, 0x80],
[0xDF, 0xBF],
[0xE0, 0xA0, 0x80],
[0xED, 0x9F, 0xBF],
[0xEE, 0x80, 0x80],
[0xEF, 0xBF, 0xBD],
[0xF0, 0x90, 0x80, 0x80],
[0xF0, 0x9F, 0xBF, 0xBF],
[0xF3, 0xBF, 0xBF, 0xBF],
[0xF4, 0x80, 0x80, 0x80],
[0xF4, 0x8F, 0xBF, 0xBF],
[0xF0, 0x9F, 0x98, 0x82, 0xF0, 0x9F, 0x98, 0x84, 0xF0, 0x9F, 0x98, 0x99],
[0xC8, 0xA7],
[0xE4, 0xB8, 0xAD, 0xE6, 0x96, 0x87, 0xEF, 0xBC, 0x8C, 0xE3, 0x81, 0xAB, 0xE3, 0x81, 0xBB, 0xE3, 0x82, 0x93, 0xE3, 0x81, 0x94]
]

allStrings = [ bytes(data).decode("utf-8") for data in allUnicode ]

allBinary = b""
for data in allUnicode:
allBinary += bytes(data) + b"\n"

# generate a file with Unicode data
with open(os.path.join(TESTDIR, "data.bin"), "wb") as f:
f.write(allBinary)

# generate sub-directories with symlinks
os.mkdir(os.path.join(TESTDIR, "a"))
for data in allStrings:
os.mkdir(os.path.join(TESTDIR, data))
os.mkdir(os.path.join(TESTDIR, "a", data))
for target, name in [
("../../bin/cpp/UtilityProcess-debug", "bin-cpp-debug"),
("../../bin/cpp/UtilityProcess", "bin-cpp"),
("../../bin/cs/bin/UtilityProcess-Debug.exe", "bin-cs-debug"),
("../../bin/cs/bin/UtilityProcess.exe", "bin-cs"),
("../../bin/hl/UtilityProcess.hl", "bin-hl"),
("../../bin/lua/UtilityProcess.lua", "bin-lua"),
("../../bin/java/UtilityProcess-Debug.jar", "bin-java-debug"),
("../../bin/java/UtilityProcess.jar", "bin-java"),
("../../bin/neko/UtilityProcess.n", "bin-neko"),
("../../bin/php/UtilityProcess/index.php", "bin-php"),
("../../bin/python/UtilityProcess.py", "bin-py"),
("../../src/UtilityProcess.hx", "bin-eval")
]:
os.symlink(target, os.path.join(TESTDIR, data, name), target_is_directory = False)

# files
os.mkdir(os.path.join(TESTDIR, "b"))
for data in allStrings:
with open(os.path.join(TESTDIR, "b", data), "wb") as f:
f.write(allBinary)
157 changes: 0 additions & 157 deletions tests/sys/genTestRes.sh

This file was deleted.

1 change: 1 addition & 0 deletions tests/sys/src/TestUnicode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class TestUnicode extends utest.Test {

function setupClass() {
sys.FileSystem.createDirectory("temp-unicode");
Sys.command("python3", ["genTestRes.py"]);
}

function teardownClass() {
Expand Down
1 change: 0 additions & 1 deletion tests/sys/test-res//bin-cpp

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-cpp-debug

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-cs

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-cs-debug

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-eval

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-hl

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-java

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-java-debug

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-lua

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-neko

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-php

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res//bin-py

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a//.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a//.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/€/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/ȧ/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/߿/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/ࠀ/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/中文,にほんご/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/퟿/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a//.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/�/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/𐀀/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/😂😄😙/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/🿿/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/󿿿/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/􀀀/.keep

This file was deleted.

1 change: 0 additions & 1 deletion tests/sys/test-res/a/􏿿/.keep

This file was deleted.

16 changes: 0 additions & 16 deletions tests/sys/test-res/b/

This file was deleted.

16 changes: 0 additions & 16 deletions tests/sys/test-res/b/

This file was deleted.

16 changes: 0 additions & 16 deletions tests/sys/test-res/b/€

This file was deleted.

16 changes: 0 additions & 16 deletions tests/sys/test-res/b/ȧ

This file was deleted.

16 changes: 0 additions & 16 deletions tests/sys/test-res/b/߿

This file was deleted.

Loading

0 comments on commit 9b12833

Please sign in to comment.