forked from FlatAssembler/AECforWebAssembly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (72 loc) · 3.45 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# https://discord.com/channels/172018499005317120/172018499005317120/807727805080010804
cmake_minimum_required(VERSION 3.10)
project(AECForWebAssembly VERSION 2.9.2)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED true)
add_executable(aec AECforWebAssembly.cpp)
enable_testing()
# TODO: Some tests are dependent on others having been already run, I do not
# know enough about CMAKE to denote that.
add_test(NAME globalVariablesDeclarationTestCompiles
COMMAND aec globalVariablesDeclarationTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME globalVariablesDeclarationTestAssembles
COMMAND npx -q -p wabt wat2wasm globalVariablesDeclarationTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# TODO: Maybe we can add some test whether global variables are dealt with
# correctly, rather than whether the test just compiles and assembles.
# Of course, it is unlikely the "structureDeclarationTestRuns" would pass
# if that is not the case.
add_test(NAME emptyFunctionTestCompiles
COMMAND aec emptyFunctionTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME emptyFunctionTestAssembles
COMMAND npx -q -p wabt wat2wasm emptyFunctionTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# TODO: There is a small chance empty functions compile and assemble, but
# improperly. Maybe we should check for that somehow.
add_test(NAME structureDeclarationTestCompiles
COMMAND aec structureDeclarationTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME structureDeclarationTestAssembles
COMMAND npx -q -p wabt wat2wasm structureDeclarationTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME structureDeclarationTestRuns
COMMAND node structureDeclarationTest.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME namedArgumentsTestCompiles
COMMAND aec namedArgumentsTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME namedArgumentsTestAssembles
COMMAND npx -q -p wabt wat2wasm namedArgumentsTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME namedArgumentsTestRuns
COMMAND node namedArgumentsTest.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME leftHandSideConditionalTestCompiles
COMMAND aec leftHandSideConditionalTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME leftHandSideConditionalTestAssembles
COMMAND npx -q -p wabt wat2wasm leftHandSideConditionalTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME leftHandSideConditionalTestRuns
COMMAND node leftHandSideConditionalTest.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME multiLineStringTestCompiles
COMMAND aec multiLineStringTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME multiLineStringTestAssembles
COMMAND npx -q -p wabt wat2wasm multiLineStringTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME multiLineStringTestRuns
COMMAND node multiLineStringTest.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME chainedComparisonsTestCompiles
COMMAND aec chainedComparisonsTest.aec
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME chainedComparisonsTestAssembles
COMMAND npx -q -p wabt wat2wasm chainedComparisonsTest.wat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_test(NAME chainedComparisonsTestRuns
COMMAND node chainedComparisonsTest.js
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})